We are currently working on new rules for what content should and shouldn't be allowed on this website, and are looking for feedback! See Esolang:2026 topicality proposal to view and give feedback on the current draft.
Topsy Turvy
Jump to navigation
Jump to search
Topsy Turvy operates on an array of cells, each initially set to an undefined value. A data pointer initially points to the cell in the centre of the array.
| Operation | Behaviour |
|---|---|
<
|
Decrement the data pointer |
>
|
Increment the data pointer |
-
|
Decrement the cell pointed to by the data pointer |
+
|
Increment the cell pointed to by the data pointer |
,
|
Read a character into the cell pointed to by the data pointer |
.
|
Output the character in the cell pointed to by the data pointer |
]
|
If the cell pointed to by the data pointer is zero, jump back to the matching [
|
[
|
If the cell pointed to by the data pointer is nonzero, jump forward to the matching ]
|
^
|
Change data polarity. Swaps the behavior of < with > and - with +
|
v
|
Change program polarity. The direction of program execution is reversed |