RosettaCodeData/Task/Van-der-Corput-sequence/BASIC256/van-der-corput-sequence.basic

29 lines
424 B
Plaintext

function num_base$(number, base)
if base > 9 then
print "base not handled by function"
pause 5
return ""
end if
ans$ = ""
while number <> 0
n = (number mod base)
ans$ = string(n) + ans$
number = number \ base
end while
if ans$ = "" then ans$ = "0"
return "." + ans$
end function
for k = 2 to 5
print "Base = "; k
for l = 0 to 12
print ljust(num_base$(l, k), 6);
next l
print : print
next k
end