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,29 @@
command guessTheNumber lowN highN
local tNumber, tguess, tmin, tmax
if lowN is empty or lowN < 1 then
put 1 into tmin
else
put lowN into tmin
end if
if highN is empty then
put 10 into tmax
else
put highN into tmax
end if
put random(tmax - tmin + 1) + tmin - 1 into tNumber
repeat until tguess is tNumber
ask question "Please enter a number between" && tmin && "and" && tmax titled "Guess the number"
if it is not empty then
put it into tguess
if tguess is tNumber then
answer "Well guessed!"
else if tguess < tNumber then
answer "too low"
else
answer "too high"
end if
else
exit repeat
end if
end repeat
end guessTheNumber

View file

@ -0,0 +1,4 @@
command testGuessNumber
guessTheNumber --defaults to 1-10
guessTheNumber 9,12
end testGuessNumber