Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,34 @@
print "Pop count (3^x): "
for i = 0 to 29
print population(3^i);
next
print "\n"
print "Evil: "
EvilOdious(30)
print "\n"
print "Odious: "
EvilOdious(30, 1)
print "\n"
sub EvilOdious(limit, type)
local i, count, eo
repeat
eo = mod(population(i), 2)
if (type and eo) or (not type and not eo) count = count + 1 : print i;
i = i + 1
until(count = limit)
end sub
sub population(number)
local i, binary$, popul
binary$ = bin$(number)
for i = 1 to len(binary$)
popul = popul + val(mid$(binary$, i, 1))
next
return popul
end sub