added not instruction and escape sequences
This commit is contained in:
42
test2.grnd
42
test2.grnd
@@ -1,5 +1,39 @@
|
||||
stdout "Type something: "
|
||||
stdin &myString
|
||||
stdout "You said: "
|
||||
stdout $myString
|
||||
set &number 4
|
||||
set &stop 0
|
||||
|
||||
fun -double !mod -double &in -double &modulus
|
||||
lesser $in $modulus &store
|
||||
not $store &store
|
||||
if $store %downloop
|
||||
|
||||
lesser $in 0 &store
|
||||
if $store %uploop
|
||||
|
||||
jump %end
|
||||
|
||||
@downloop
|
||||
subtract $in $modulus &in
|
||||
lesser $in $modulus &store
|
||||
not $store &store
|
||||
if $store %downloop
|
||||
jump %end
|
||||
|
||||
@uploop
|
||||
add $in $modulus &in
|
||||
lesser $in 0 &store
|
||||
if $store %uploop
|
||||
jump %end
|
||||
|
||||
@end
|
||||
return $in
|
||||
endfun
|
||||
|
||||
@loop
|
||||
equal $number 1 &stop
|
||||
if $stop %end
|
||||
|
||||
|
||||
jump %loop
|
||||
|
||||
@end
|
||||
end 0
|
Reference in New Issue
Block a user