Skip to content

Instantly share code, notes, and snippets.

@rboyd
Created November 25, 2010 11:43
Show Gist options
  • Select an option

  • Save rboyd/715258 to your computer and use it in GitHub Desktop.

Select an option

Save rboyd/715258 to your computer and use it in GitHub Desktop.
Chipmunk basic for OS X can be downloaded here: http://www.nicholson.com/rhn/basic/#3
The algorithm for binary conversion is a simple one, as described here: http://trunix.org/programlama/cpp/fred/notes/cpp/misc/decimal2binary.html
10 INPUT num
20 WHILE num > 0
30 m = num mod 2
40 out$ = str$(m) + out$
50 num = int(num/2)
60 WEND
70 PRINT out$
Chipmunk seems to have a built-in command for binary conversion:
10 INPUT MYNUM
20 PRINT bin$(MYNUM)
It provides a reference in the README file:
http://www.nicholson.com/rhn/basic/basic.man.html
Hope this helps.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment