Implemented length storage of allocated memory

This commit is contained in:
Eduard Urbach 2025-02-09 14:14:41 +01:00
parent 79bb606e8d
commit 3043e4e2c4
Signed by: eduard
GPG key ID: 49226B848C78F6C8
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)
}