Implemented length storage of allocated memory

This commit is contained in:
2025-02-09 14:14:41 +01:00
parent 1ff56e0856
commit 2b2e707520
27 changed files with 134 additions and 49 deletions

View File

@ -1,5 +1,5 @@
import io
import log
import sys
main() {
fizzbuzz(15)
@ -10,9 +10,9 @@ fizzbuzz(n Int) {
loop {
switch {
x % 15 == 0 { print("FizzBuzz", 8) }
x % 5 == 0 { print("Buzz", 4) }
x % 3 == 0 { print("Fizz", 4) }
x % 15 == 0 { io.out("FizzBuzz") }
x % 5 == 0 { io.out("Buzz") }
x % 3 == 0 { io.out("Fizz") }
_ { log.number(x) }
}
@ -22,10 +22,6 @@ fizzbuzz(n Int) {
return
}
print(" ", 1)
io.out(" ")
}
}
print(address Pointer, length Int) {
sys.write(1, address, length)
}