You find a strange mirror that always shows a hand that is moving. The hand appears to be alive, and after a lot of questions of "yes" and "no" answer, you know that the hand is trying to teach you a program that is written in HPL (Hand Programming Language).
This language works with a memory of an indefinite size of bytes, with all values initialized to 0. This language haves 7 instructions:
๐ : moves the memory pointer to the next cell
๐ : moves the memory pointer to the previous cell
๐ : increment the memory cell at the current position
๐ : decreases the memory cell at the current position.
๐ค : if the memory cell at the current position is 0, jump just after the corresponding ๐ค
๐ค : if the memory cell at the current position is not 0, jump just after the corresponding ๐ค
๐ : Display the current character represented by the ASCII code defined by the current position.
- As memory cells are bytes, from 0 to 255 value, if you decrease 0 you'll get 255, if you increment 255 you'll get 0.
- Loops of ๐ค and ๐ค can be nested.
The hand shows you two small programs and their outputs:
๐๐ค๐๐๐๐๐๐๐๐๐๐๐ค๐๐๐๐๐ค๐๐๐๐๐๐๐๐๐ค๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐
๐๐๐๐๐๐๐๐๐๐ค๐๐๐๐๐๐๐๐๐๐๐๐๐ค๐๐๐๐๐๐๐๐ค๐๐ค๐๐๐๐๐๐๐๐๐๐ค๐๐ค๐๐๐๐๐๐๐๐๐๐๐๐ค๐๐๐ค๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐ค๐๐ค๐๐๐๐ค๐๐๐ค๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐
The file "input.hand" is the code of the program
Good luck!