Advertisement
sci4me

s2dlang

Feb 11th, 2018
299
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. Instructions:
  2. ^ -> moves IP up
  3. > -> moves IP right
  4. v -> moves IP down
  5. < -> moves IP left
  6.  
  7. + -> pops two values and pushes their sum
  8. - -> pops two values and pushes their difference
  9.  
  10. ] -> pops a value; if it is 0, next instruction in IP direction is skipped, direction becomes right
  11. [ -> pops a value; if it is 0, next instruction in IP direction is skipped, direction becomes left
  12.  
  13. @ -> pops a value and discards it
  14. $ -> swaps top two values on stack
  15. ! -> duplicates top value on stack
  16.  
  17. . -> pops a value and prints it as an integer
  18. ' -> pops a value and prints it as a character
  19. , -> reads a character from stdin and pushes it
  20.  
  21. 0-9 -> pushes an integer between 0 and 9
  22.  
  23. & -> start of program; direction = right
  24. % -> end of program
  25.  
  26. Examples:
  27. Infinite Loop:
  28. >v
  29. ^<
  30.  
  31. Cat:
  32. &>,'v
  33. ^ <
  34.  
  35. Loop:
  36. &01+!'v
  37. ^ <
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement