Created
November 25, 2010 11:43
-
-
Save rboyd/715258 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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