Casting out nines: Difference between revisions
m
→{{header|Craft Basic}}
Basicgames (talk | contribs) |
Basicgames (talk | contribs) |
||
Line 515:
=={{header|Craft Basic}}==
<syntaxhighlight lang="basic">
for k = 1 to (base ^ 2) - 1
let c1 = c1 + 1
if k % (base - 1) = (k * k) % (base - 1)
let c2 = c2 + 1
Line 528 ⟶ 530:
endif
print "trying ", c2, " numbers instead of ", c1, " numbers saves ", 100 - (100 * c2 / c1), "%"
|