Post History
Embed ESCR, 16 characters [int n "base 2"] The INT function produces the text representation of an integer with lots of formatting options. The only non-default option needed was to set the numb...
Answer
#2: Post edited
Embed <a href="http://www.embedinc.com/pic/escr">ESCR</a>, 16 characters- <pre>[int n "base 2"]</pre>
- The INT function produces the text representation of an integer with lots of formatting options. The only non-default option needed was to set the number base to 2.
- Full example:
- <pre>loop with n from 0 to 10
- show n ": " [int n "base 2"]
- endloop</pre>
- and its output:
- <pre>0: 0
- 1: 1
- 2: 10
- 3: 11
- 4: 100
- 5: 101
- 6: 110
- 7: 111
- 8: 1000
- 9: 1001
- 10: 1010</pre>
- 16 characters: OK<br>
- Readability: priceless
- <h2>Embed <a href="http://www.embedinc.com/pic/escr">ESCR</a>, 16 characters</h2>
- <pre>[int n "base 2"]</pre>
- The INT function produces the text representation of an integer with lots of formatting options. The only non-default option needed was to set the number base to 2.
- Full example:
- <pre>loop with n from 0 to 10
- show n ": " [int n "base 2"]
- endloop</pre>
- and its output:
- <pre>0: 0
- 1: 1
- 2: 10
- 3: 11
- 4: 100
- 5: 101
- 6: 110
- 7: 111
- 8: 1000
- 9: 1001
- 10: 1010</pre>
- 16 characters: OK<br>
- Readability: priceless
#1: Initial revision
Embed <a href="http://www.embedinc.com/pic/escr">ESCR</a>, 16 characters <pre>[int n "base 2"]</pre> The INT function produces the text representation of an integer with lots of formatting options. The only non-default option needed was to set the number base to 2. Full example: <pre>loop with n from 0 to 10 show n ": " [int n "base 2"] endloop</pre> and its output: <pre>0: 0 1: 1 2: 10 3: 11 4: 100 5: 101 6: 110 7: 111 8: 1000 9: 1001 10: 1010</pre> 16 characters: OK<br> Readability: priceless