#Portal
Portal is an esoteric language that loosely implements the Wang B-Machine.
Portal | Description |
---|---|
o | Move the pointer to the other o portal |
> | Move the pointer to the right |
< | Move the pointer to the left |
+ | Increment the memory cell under the pointer |
- | Decrement the memory cell under the pointer |
. | Output the character signified by the cell at the pointer |
, | Input a character and store it in the cell at the pointer |
] | Move the first o portal to the right |
[ | Move the last o portal to the left |
Portal 2 | Description |
---|---|
o | Move the pointer to the other o portal |
O | Move the pointer to the other O portal |
> | Move the pointer to the right |
< | Move the pointer to the left |
+ | Increment the memory cell under the pointer |
- | Decrement the memory cell under the pointer |
. | Output the character signified by the cell at the pointer |
, | Input a character and store it in the cell at the pointer |
] | Move the first o portal to the right |
[ | Move the last o portal to the left |
} | Move the first O portal to the right |
{ | Move the last O portal to the left |
Important note: A pointer does not go in the a portal on the first pass. Check the examples.
###Portal: Prints an ampersand(&):
+++++++++++++o+++++]]]]]o++++++++++++++++++++.
Code trace:
+++++++++++++o+++++]]]]]o++++++++++++++++++++.
# omitted
+++++++++++++o+++++]]]]]o++++++++++++++++++++.
++++++++++++++o++++]]]]]o++++++++++++++++++++.
+++++++++++++++o+++]]]]]o++++++++++++++++++++.
++++++++++++++++o++]]]]]o++++++++++++++++++++.
+++++++++++++++++o+]]]]]o++++++++++++++++++++.
++++++++++++++++++o]]]]]o++++++++++++++++++++.
++++++++++++++++++o]]]]]o++++++++++++++++++++.
++++++++++++++++++]o]]]]o++++++++++++++++++++.
++++++++++++++++++]]o]]]o++++++++++++++++++++.
++++++++++++++++++]]]o]]o++++++++++++++++++++.
++++++++++++++++++]]]]o]o++++++++++++++++++++.
++++++++++++++++++]]]]]o++++++++++++++++++++.
++++++++++++++++++]]]]]o++++++++++++++++++++.
++++++++++++++++++]]]]]o++++++++++++++++++++.
# omitted
++++++++++++++++++]]]]]o++++++++++++++++++++.
###Portal 2
The following code prints an Ö O with diaeresis
O++++++o----}}o]]O.
Code trace:
O++++++o----}}o]]O.
O++++++o----}}o]]O.
O++++++o----}}o]]O.
O++++++o----}}o]]O.
O++++++o----}}o]]O.
O++++++o----}}o]]O.
O++++++o----}}o]]O.
O++++++o----}}o]]O.
O++++++o----}}o]]O.
O++++++o----}}o]]O.
O++++++o----}}o]]O.
O++++++o----}}o]]O.
+O+++++o----}}o]]O.
++O++++o----}}o]]O.
++O++++o----}}o]]O.
++O++++o----}}o]]O.
++O++++o----}}o]]O.
++O++++o----}}o]]O.
++O++++o----}}o]]O.
+++O+++o----}}o]]O.
++++O++o----}}o]]O.
++++O++o----}}o]]O.
++++O++o----}}o]]O.
++++O++o----}}o]]O.
++++O++o----}}o]]O.
++++O++o----}}o]]O.
+++++O+o----}}o]]O.
++++++Oo----}}o]]O.
++++++Oo----}}o]]O.
++++++Oo----}}o]]O.
++++++Oo----}}o]]O.
++++++Oo----}}o]]O.
++++++Oo----}}o]]O.
++++++oO----}}o]]O.
++++++o-O---}}o]]O.
++++++o-O---}}o]]O.
++++++o-O---}}o]]O.
++++++o-O---}}o]]O.
$ ./portal.py [filename]
$ ./portal2.py [filename]
How do I print Hello World?
The python interpreter is a fork of pocmo/Python-Brainfuck.