Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,5 @@
num = Math.ceil(Math.random() * 10)
guess = prompt "Guess the number. (1-10)"
while parseInt(guess) isnt num
guess = prompt "YOU LOSE! Guess again. (1-10)"
alert "Well guessed!"

View file

@ -0,0 +1,19 @@
# This shows how to do simple REPL-like I/O in node.js.
readline = require "readline"
do ->
number = Math.ceil(10 * Math.random())
interface = readline.createInterface process.stdin, process.stdout
guess = ->
interface.question "Guess the number between 1 and 10: ", (answer) ->
if parseInt(answer) == number
# These lines allow the program to terminate.
console.log "GOT IT!"
interface.close()
process.stdin.destroy()
else
console.log "Sorry, guess again"
guess()
guess()