From Esolang
Jump to navigation Jump to search

Clockwise is a two-dimensional esolang by User:PythonshellDebugwindow where the only turns are 90° clockwise.


Clockwise code is two-dimensional. It uses an instruction pointer (IP), which can point north, east, south, or west, to keep track of the current position in the code; it starts out in the northwesternmost corner facing east. If the IP ever returns to the northwesternmost character, the program halts. Each character is one command.


Clockwise uses an unbounded signed accumulator, initialized to a random positive number.


Command Effect
R Rotate the IP 90° clockwise
? If the accumulator is not 0, rotate the IP 90° clockwise, else do nothing
! If the accumulator is 0, rotate the IP 90° clockwise, else do nothing
+ Increment the accumulator
- Decrement the accumulator
(space) Nop