hex, base64, Math.urandom, IO.read_line

This commit is contained in:
2025-06-16 17:22:20 +02:00
parent 7425ab256b
commit 2b6f39135a
4 changed files with 130 additions and 7 deletions

14
examples/guess_number.zr Normal file
View File

@@ -0,0 +1,14 @@
func main[] : I64
let answer: I64 = Math.abs(Math.urandom()) % 100
while true
print("Guess a number: ")
let guess: I64 = IO.read_line() |> String.trim() |> I64.parse()
if guess == answer
print("You win!")
return 0
else if guess < answer
print("Too low!")
else
print("Too high!")