Implemented length storage of allocated memory
This commit is contained in:
@ -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)
|
||||
}
|
Reference in New Issue
Block a user