This commit is contained in:
2025-06-03 12:52:07 +02:00
parent 98f01350f8
commit 178ad8b9c0
7 changed files with 87 additions and 22 deletions

10
examples/arrays.zr Normal file
View File

@@ -0,0 +1,10 @@
func main[] : I64
let xs: Array = Array.new()
Array.push(xs, 5242)
Array.push(xs, 6533)
Array.push(xs, 4574)
for i in 0:Array.size(xs)
xs
|> Array.nth(i)
|> print_i64()

View File

@@ -1,5 +1,5 @@
func num_divisors[n: I64] : I64
let end: I64 = isqrt(n)
let end: I64 = Math.isqrt(n)
let result: I64 = 0
for i in 1:end+1
@@ -13,7 +13,7 @@ func num_divisors[n: I64] : I64
func main[] : I64
let n: I64 = 0
let i: I64 = 1
while 1
while true
n = n + i
if num_divisors(n) > 500
print_i64(n)

View File

@@ -2,7 +2,7 @@ func main[] : I64
let found: I64 = 0
let i: I64 = 1
while 1
while true
if Math.is_prime(i)
found = found + 1
if found == 10001

View File

@@ -7,7 +7,7 @@ func main[] : I64
let s: I64 = 1
let j: I64 = 0
while j < 13
s = s * Char.to_i64(nth(n, i + j))
s = s * Char.to_i64(String.nth(n, i + j))
j = j + 1
if s > out
out = s