lol-io

Codeforces uses d8 for testing javascript code. d8 provides IO functions, but if you don't want install d8 and you want testing your solutions using node.js then you can use this module If you want try d8 you can download it compiled for windows here Post about js on codeforces http://codeforces.com/blog/entry/10024 Discussing on codeforces http://codeforces.com/blog/entry/57807

Usage no npm install needed!

<script type="module">
  import lolIo from 'https://cdn.skypack.dev/lol-io';
</script>

README

lol-io

Codeforces uses d8 for testing javascript code. d8 provides IO functions, but if you don't want install d8 and you want testing your solutions using node.js then you can use this module

If you want try d8 you can download it compiled for windows here

Post about js on codeforces http://codeforces.com/blog/entry/10024
Discussing on codeforces http://codeforces.com/blog/entry/57807

When you use this library, your code is valid for submitting to codeforces

Example

var print = this.print || require('lol-io').print
var write = this.write || require('lol-io').write
var readline = this.readline || require('lol-io').readline
// a + b
const s = readline().split(' ')
print(+s[0] + +s[1]);

Installation

This is a Node.js module available through the npm registry.

Before installing, download and install Node.js.

Installation is done using the npm install command:

$ npm install lol-io

Functions

  • write - write line into output.txt, example write('hello', 'world')
  • print - write line into output.txt, automatically prints new line, example print('hello', 'world')
  • readline - read line from input.txt, example var line = readline(), if no more lines return undefined

Features

  • automatic creation of input.txt and output.txt, if does not exist