Before adding pointer idea

This commit is contained in:
Krzosa Karol
2022-06-08 12:59:43 +02:00
parent 19356026fe
commit 2f127dea98

View File

@@ -1,13 +1,15 @@
// @todo: Add more stats in the preview
// @todo: for 0..1000(implicit i) and for i in 0..1000
// @todo: Add blocks of stmts that you can simply define inside a function etc.
entry :: ()
printf("\n")
euler1()
euler3()
// @todo: Add more stats in the preview
// @todo: for 0..1000(implicit i) and for i in 0..1000
// @todo: Add blocks of stmts that you can simply define inside a function etc.
//-----------------------------------------------------------------------------
// Euler 2
//-----------------------------------------------------------------------------
euler1 :: ()
end := 1000
result := 0
@@ -19,6 +21,9 @@ euler1 :: ()
printf("Euler1: %lld\n", result)
//-----------------------------------------------------------------------------
// Euler 3
//-----------------------------------------------------------------------------
int_sqrt :: (s: S64): S64
result := sqrt(cast(s: F64))
return cast(result: S64)
@@ -52,6 +57,7 @@ euler3 :: ()
results[results_len++] = i
n /= i
// Then check if our number is a prime it self
if n > 2
results[results_len++] = n
@@ -64,6 +70,10 @@ euler3 :: ()
printf(":: %lld", is_correct)
//-----------------------------------------------------------------------------
// Euler 4
//-----------------------------------------------------------------------------
print_int :: (i: S64)