Shaun_B

Commodore 64/VIC-20 Decimal to Binary in BASIC

Feb 20th, 2017
1,227
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. REM TESTED AND CORRECTED VERSION
  2. REM FOR MY CODE GOLF CHALLENGE HERE:
  3. REM http://codegolf.stackexchange.com/questions/110166/counting-in-binary-nybbles
  4. 0 DEF FN B(X)=SGN(X AND B)
  5. 1 FOR I=0 TO 10:B=8
  6. 2 FOR J=0 TO 3:PRINT RIGHT$(STR$(FN B(I)),1);:B=B/2:NEXT J
  7. 3 PRINT:NEXT I
RAW Paste Data