Please specify what version of Turing you are using
the newest one I think..
Sponsor Sponsor
Diablo117
Posted: Sun May 31, 2009 9:18 pm Post subject: Re: Decimal to Binary
Your remainder constantly changes. If you put the remainder inside the loop, you will see that the digits do in fact appear. What you need to do is store the remainder in reverse order :
for example
astring := astring+intstr(remainder)
that should be inside your loop. it isnt in reverse order but I leave it up to you to figure that out.
if your too lazy to think:
Spoiler:
astring := intstr(remainder)+astring
TW iz Rippin
Posted: Tue Mar 20, 2012 11:02 am Post subject: RE:Decimal to Binary
code:
var base_10 : int
get base_10
put intstr (base_10, 0, 2)
Raknarg
Posted: Tue Mar 20, 2012 11:54 am Post subject: RE:Decimal to Binary
TW, dont necro post. Notice how this topic is dated back in 2009.
TW iz Rippin
Posted: Wed Mar 21, 2012 10:40 am Post subject: Re: RE:Decimal to Binary
Raknarg @ Tue Mar 20, 2012 11:54 am wrote:
TW, dont necro post. Notice how this topic is dated back in 2009.