The Pragmatic Programmer

Tulisan iseng kalo ada waktu.
See also: Other Geeks@INDC

The Hint

What if I have a language that run in a simple machine that consists of an array of 300 byte cells initialized to zero, a moveable pointer to the array (initialized to point to the lefmost byte of the array), and two streams of bytes for input and output using ASCII as the character encoding.

The language itself has eight commands:

> : increment the pointer (to point to the next cell to the right)
< : decrement the pointer (to point to the next cell to the left)
+ : increment (increase by one) the byte at the pointer
- : decrement (decrease by one) the byte at the pointer
. : output the value of the byte at the pointer
, : accept one byte of input, storing its value in the byte at the pointer
[ : jump forward to the command after the corresponding ] if the byte at the pointer is zero
] : jump back to the command after the corresponding [ if the byte at the pointer is nonzero

So, can you answer the question?

Share this post: | | | |

Comments

Edward Chitrahadi said:

irwa... ur name?

# July 15, 2007 10:42 PM
Leave a Comment

(required) 

(required) 

(optional)

(required) 
Are you human?:  


Enter the numbers above: