Posted: Fri Sep 30, 2005 11:10 am Post subject: (No subject)
this is what i get for not being on compsci for the entire summer... anyways, i've yet to get much work done on the project, mainly cause its all math (aaaaarrrrrgggggghhhhh!) slowly but surely, its coming tho.
Sponsor Sponsor
[Gandalf]
Posted: Fri Sep 30, 2005 7:34 pm Post subject: (No subject)
Did you get something like so:
code:
var inputNum : int
var binaryOut : array 1 .. 8 of int := init (0, 0, 0, 0, 0, 0, 0, 0)
get inputNum
for count : 1 .. 8
if inputNum mod 2 = 1 then
binaryOut (count) := 1
else
binaryOut (count) := 0
end if
inputNum := inputNum div 2
end for
for decreasing count : 8 .. 1
put binaryOut (count) ..
end for
Oops, wrong thread, but it's about the same thing anyway .