We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8e3c589 commit e2a0035Copy full SHA for e2a0035
bin/adventurejs
@@ -0,0 +1,27 @@
1
+#!/usr/bin/env node
2
+
3
+/* eslint-disable no-console */
4
+var rl = require('readline');
5
+var advent = require("../src");
6
7
+var app = advent.makeState();
8
+app.advance().forEach(_print);
9
10
+var _input = rl.createInterface(process.stdin, process.stdout);
11
+_input.setPrompt('> ');
12
+_input.prompt();
13
14
+_input.on('line', (l) => {
15
16
+ app.advance(l).forEach(_print);
17
18
+ if (app.isDone()) {
19
+ process.exit(0);
20
+ }
21
22
+ _input.prompt();
23
+});
24
25
+function _print(line) {
26
+ console.log(line);
27
+}
0 commit comments