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
|
||||
var prompt = require( 'prompt' );
|
||||
// // Modules
|
||||
// var prompt = require( 'prompt' );
|
||||
|
||||
// Create a variable x and assign value 3 to it
|
||||
var x = 3;
|
||||
// // Create a variable x and assign value 3 to it
|
||||
// var x = 3;
|
||||
|
||||
// Bind x to value 9
|
||||
x *= x; // or x = x * x;
|
||||
console.log( x );
|
||||
// // Bind x to value 9
|
||||
// x *= x; // or x = x * x;
|
||||
// console.log( x );
|
||||
|
||||
// read input data from terminal
|
||||
process.stdin.resume();
|
||||
|
||||
console.log( '' );
|
||||
|
||||
prompt.start();
|
||||
prompt.get({
|
||||
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