Data update
This commit is contained in:
parent
29a5eea0d4
commit
5c1bb7bfa9
2011 changed files with 35081 additions and 3229 deletions
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
13
Task/Guess-the-number/PascalABC.NET/guess-the-number.pas
Normal file
13
Task/Guess-the-number/PascalABC.NET/guess-the-number.pas
Normal 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.
|
||||
Loading…
Add table
Add a link
Reference in a new issue