2 Player

From Esolang
Jump to navigation Jump to search

2 Player is a esolang created by User:Yayimhere. its a 2d esolang with two pointers: the data and code pointer. they both move starting going left in the upper left corner of the program. for the data pointer the grid is topologically the same as a donut, but for the code pointer if it goes to the edge it halts

commands

commands
command description
^ move the pointer up unless its the data pointer
* if whats at the data pointer move the code pointer:
  • a ^: turn 90 degrees anti clockwise
  • a *: change the data at the data pointer to a ^ and move the code and data pointer to the left
  • a ?: push the command to the left of the code pointer up once
  • / and \: use the table specified below table to change the command at the data pointer and the von neumann neighbourhood of the data pointer. table:
command transition
^ X
! !
x X
X x
* [space]
/ \
\ /
?  *
  • a x: swap the data and code pointer directions
  • a X: swap data and code pointer positions
  • a !: swap the commands at data and code pointer
  • a ;: move the data pointer down one row and make it go in left direction
  • anything else: set the command at code pointer to that
? move the code pointer to the data pointer location
/ and \ mirror unless the code pointer has already been at a mirror(both pointers)
x skip the command in pointer direction
X this command function depends on code pointer direction(for the data pointer it turns 90 degress clockwise):
  • up: set the cell to the left of the pointer to whats at the data pointer
  • right: set direction to down
  • left: push the command and whats at the data pointer down one and go right
  • down: halt
! turn 90 degrees clockwise
; make the data pointer stop moving
~ apply the * transition to the data pointer command, also not running the command at data pointer

everything else is a NOP

examples

infinite loop(not including the data pointer):

 \
/x \

^/ 
\ x/
 \;

with data pointer:

\
x
/\
\/

oscillator(at data pointer):

\/ \
\^\x
   / \
  x\~/
  / \
  \x/