Quote Originally Posted by skimask View Post
Keep going!!!

(What do they call those 'machines' that take the most indirect route to accomplish something? Remember that kids game 'Mousetrap'?)

My next submission:
Code:
testnumber var word
onescount var byte
onescount1 var byte
loopvar var byte

testnumber = 12345

main:
for loopvar = 0 to 15 'counts bits set in the testnumber
if testnumber.0[loopvar] = 1 then
onescount = onescount + 1
endif
next loopvar

testnumber = testnumber >> 1 'shifts the LSB out
testnumber = testnumber << 1 'shifts a zero bit back in

for loopvar = 0 to 15 'recounts bits set in the testnumber
if testnumber.0[loopvar] = 1 then
onescount1 = onescount1 + 1
endif
next loopvar

if onescount = onescount1 then lcdout "EVEN" 'if the number of set bits is the same, its even
if onescount <> onescount1 then lcdout "ODD"
STOP 'please stop!
That submission is void. The method for direct bit testing has already recognized. You were actually in the running for first prize of ($100,000) for your first submission. But unfortunately you have been suspended from the competition for acts plagiarism.

Naughty, naughty

Trent Jackson