I made a litle converter, so decimal numbers can be changed into binary. I made a program for this once on a TI83+ for an exam. And thought it would be fun to do in Kix. Please tell me what you think of it.
Code:
Break ON
:Start
$X=1
$Power=1
$Length=1
$Binval=""
$Exponent=2
$Expval=1
CLS
?" BitCrusher"
?" Decimal to Binary Calculator"
?" Made by Muesli"
???" Decimal value: "
Gets $Decval
$EndDecval= $Decval
While $X=1
While Val($Expval) < Val($Power)
$Exponent= Val($Exponent) *2
$Expval= Val($Expval) +1
Loop
If Val($Decval) - Val($Exponent)<1
$X=2
Goto "Result"
Else
$Power= Val($Power) + 1
$Length= Val($Length) + 1
EndIf
Loop
:Result
While $X=2
$Exponent=2
If $Length<0
$X=3
Goto 'END'
EndIf
While Val($Expval) > 0
$Exponent= Val($Exponent) *2
$Expval= Val($Expval) -1
Loop
If Val($Decval) - Val($Exponent)>=0
$Decval= Val($Decval) - Val($Exponent)
$Binval= $Binval + "1"
Else
$Binval= $Binval + "0"
EndIf
$Power= Val($Power) - 1
$Length= Val($Length) - 1
$Expval= Val($Power)
Loop
:END
If $Decval=1
$Binval= $Binval + "1"
Else
$Binval= $Binval + "0"
EndIf
??"The Decimal number "$EndDecval" In Binary is "$Binval
?
?"Again? y/n" Get $Key
If $Key=y
$X=1
Goto "Start"
Else
Exit
EndIf