Data update

This commit is contained in:
Ingy döt Net 2024-07-13 15:19:22 -07:00
parent 29a5eea0d4
commit 5c1bb7bfa9
2011 changed files with 35081 additions and 3229 deletions

View file

@ -1,13 +1,13 @@
writeln "Guess a number from 1 to 10"
val .n = string random 10
val n = string(random(10))
for {
val .guess = read ">> ", RE/^0*(?:[1-9]|10)(?:\.0+)?$/, "bad data\n", 7, ""
if .guess == "" {
val guess = read(">> ", RE/^0*(?:[1-9]|10)(?:\.0+)?$/, "bad data\n", 7, "")
if guess == "" {
writeln "too much bad data"
break
}
if .guess == .n {
if guess == n {
writeln "That's it."
break
}

View file

@ -0,0 +1,13 @@
begin
var randomNumber := Random(1..10);
Println('I''m thinking of a number between 1 and 10. Can you guess it?');
while True do
begin
Print('Guess:');
var x := ReadlnInteger;
if x = randomNumber then
break;
Println('That''s not it. Guess again.');
end;
Println('Congrats!! You guessed right!6');
end.