From 92778f9ed072cab0553696dca9881d6a36ec140a Mon Sep 17 00:00:00 2001 From: ericdouglas Date: Mon, 1 Jun 2015 11:44:43 -0300 Subject: [PATCH] read input data from terminal with prompt --- .../src/02-lecture.js | 20 ++++++++----------- 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/computer-science/01-introduction-to-cs-and-programming-mit/src/02-lecture.js b/computer-science/01-introduction-to-cs-and-programming-mit/src/02-lecture.js index 41e47d5..24c4224 100644 --- a/computer-science/01-introduction-to-cs-and-programming-mit/src/02-lecture.js +++ b/computer-science/01-introduction-to-cs-and-programming-mit/src/02-lecture.js @@ -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