MuckyFoot-UrbanChaos/MuckyBasic/test2.mbs
2017-05-20 11:14:17 +10:00

32 lines
299 B
Plaintext

LOCAL x
FUNCTION isprime(n)
LOCAL i,j
FOR i = 2 TO SQRT(n)
IF n MOD i = 0 THEN RETURN FALSE
NEXT i
j = 55
RETURN TRUE
ENDFUNC
i = 100
PRINT "i = " + i
PRINT "j = " + j
PRINT "127 is prime ? " + isprime(127)
PRINT "i = " + i
PRINT "j = " + j
PRINT "x = " + x