mirror of
https://github.com/ossu/computer-science.git
synced 2024-10-01 01:26:01 -04:00
read input data from terminal with prompt
This commit is contained in:
parent
7b02d7403f
commit
92778f9ed0
@ -1,18 +1,14 @@
|
|||||||
// Modules
|
// // Modules
|
||||||
var prompt = require( 'prompt' );
|
// var prompt = require( 'prompt' );
|
||||||
|
|
||||||
// Create a variable x and assign value 3 to it
|
// // Create a variable x and assign value 3 to it
|
||||||
var x = 3;
|
// var x = 3;
|
||||||
|
|
||||||
// Bind x to value 9
|
// // Bind x to value 9
|
||||||
x *= x; // or x = x * x;
|
// x *= x; // or x = x * x;
|
||||||
console.log( x );
|
// console.log( x );
|
||||||
|
|
||||||
// read input data from terminal
|
// read input data from terminal
|
||||||
process.stdin.resume();
|
|
||||||
|
|
||||||
console.log( '' );
|
|
||||||
|
|
||||||
prompt.start();
|
prompt.start();
|
||||||
prompt.get({
|
prompt.get({
|
||||||
name : 'number',
|
name : 'number',
|
||||||
@ -55,4 +51,4 @@ prompt.get({
|
|||||||
|
|
||||||
// });
|
// });
|
||||||
|
|
||||||
// Find the lowest of three numbers
|
// // Find the lowest of three numbers
|
||||||
|
Loading…
Reference in New Issue
Block a user