Chessoteric

From Esolang
Jump to navigation Jump to search

Chessoteric is an esoteric programming language created by User:Largejamie in 2022 whose programs are written in proper Portable Game Notation. The programs simulate a chess game and based on the position of the pieces at certain key moments will create and run input on a Turing machine.

Overview

Chessoteric programs must be valid PGN that describes an entire game of chess.

If a move ends in !, ?, !!, or ?? then the board will be converted into binary and then treated as an instruction of a language very similar to Binary Turing Machine!?. The binary is created beginning with square a1, then b1, then c1, until h1, then continues on with a2, b2, c2, et cetera until h8.

So the following board:

would produce 111111111111110000000000000010 when converted to binary.

The binary code is then stripped of all leading 1s (and leading 0s, which have no effect) to generate the binary string, and then does the following based on the symbol(s) that the move ended in.

Character Description
! Create a new part of a rule for the Turing machine
!! Continue the previous part of the rule for the Turing machine
? Create a new symbol that is initially written onto the tape (part of the Turing machine's input)
?? Continue the previous symbol that is initially written onto the tape

The continues are necessary in order to ensure that there are an arbitrarily large number of symbols and rules that may be specified for the Turing machine. So, for example, the following 4 lines

1!
10!!
0!!
1?
101??

Are equivalent to

1100!
1101?

Other than skipping leading 1s and the ability to continue previous lines, both of which are necessary to ensure Turing-completeness, the programs function the exact same as Binary Turing Machine!? programs. See its article to understand how the binary is compiled and run.

Examples

Hello, world!

Program

1. e3 e6 2. h4 Qxh4 3. Qg4 Qe7 4. Qxg7 Nf6 5. Qg8! Nd5 6. Rxh7 Qf6 7. Rxh8! Ke7 8. Nf3 Kd6 9. Qxf8+ Ne7 10. Rg8 Qh8! 
11. Qh6 Nbc6 12. Qf4+! Ne5! 13. Qh6 Qf6 14. Qh8? N5c6 15. Re8 Ng8 16. Ne5 Qg7 17. Re7 Kc5 18. Nxd7+ Kd6 19. Qh7? Qe5 20. Qh8 f6 
21. Nf8 Qd5 22. Bd3 b6 23. Bh7 a5 24. g4 f5 25. gxf5 Ba6 26. f6 Bc8 27. f7? Ne5 28. Qf6 Ng6 29. Re8 Nh8 30. Qg7 Ra6? 
31. Nc3? Ng6 32. fxg8=Q Ne7 33. Q7h8 Qc6 34. Ne4+ Kd5 35. b3 a4 36. Bb2 b5 37. Bg7 Bb7 38. Ng5 Bc8 39. Nf7? e5 40. Ng5+ Qe6 
41. Qf7 Rd6 42. Qf3+ Kc5 43. Bd3 Ng6 44. Qh7 Nh8 45. Nh3 Qg8? 46. Ng6 Rd8 47. Nh4 Kd6 48. Re6+ Kd7 49. Rf6 Ke8 50. Rf4 c6 
51. bxa4? Qd5 52. Rf8+ Kd7 53. Qg8 Ng6 54. Bh8 Kc7 55. Nf5 Rd6 56. Ne7 Kb6 57. Qff7 Nf4 58. Bg6 Ne6 59. Ng5 Ka6 60. Nh7? Kb6 
61. Qe8? Rd8 62. Bd3 Nc5 63. Qg4 Qg8 64. Bg7 Ka6 65. Qf7? Rxf8 66. Qe8 Bb7 67. Nc8 Ba8 68. Qgd7? Nb7 69. Nd6 Nd8 70. Ne4? Ka5 
71. Qh5 Kb6 72. Bh8 Ka6 73. Qh4? Bb7 74. Bg7 Kb6 75. Bxf8? 1/2-1/2

Walkthrough

We play 1. e3 e6 2. h4 Qxh4 3. Qg4 Qe7 4. Qxg7 Nf6 5. Qg8! to get the following board:

Which translates to 111111111111110000000000000010!, or 10!

We play (5.) Nd5 6. Rxh7 Qf6 7. Rxh8! to get the following board:

Which translates to 1111111111111000000000000011!, or 11!

We play (7.) Ke7 8. Nf3 Kd6 9. Qxf8+ Ne7 10. Rg8 Qh8! to get the following board:

Which translates to 111111111111100000000000110!, or 110!

We play 11. Qh6 Nbc6 12. Qf4+! to get the following board:

Which translates to 111111111111110000000000010!, or 10!

We play (12.) Ne5! to get the following board:

Which translates to 111111111111110000000000010!, or 10!

We play 13. Qh6 Qf6 14. Qh8? to get the following board:

Which translates to 111111111111100000000000011?, or 11?

We play (14.) N5c6 15. Re8 Ng8 16. Ne5 Qg7 17. Re7 Kc5 18. Nxd7+ Kd6 19. Qh7? to get the following board:

Which translates to 11111111111100000011001000?, or 11001000

We play (19.) Qe5 20. Qh8 f6 21. Nf8 Qd5 22. Bd3 b6 23. Bh7 a5 24. g4 f5 25. gxf5 Ba6 26. f6 Bc8 27. f7? to get the following board:

Which translates to 1111111111000000011100101?, or 11100101?

We play (27.) Ne5 28. Qf6 Ng6 29. Re8 Nh8 30. Qg7 Ra6? to get the following board:

Which translates to 1111111111000000011101100?, or 11101100?

We play 31. Nc3? to get the following board:

Which translates to 1111111111000000011101100?, or 11101100?

We play (31.) Ng6 32. fxg8=Q Ne7 33. Q7h8 Qc6 34. Ne4+ Kd5 35. b3 a4 36. Bb2 b5 37. Bg7 Bb7 38. Ng5 Bc8 39. Nf7? to get the following board:

Which translates to 111111110000000011101111?, or 11101111?

We play (39.) e5 40. Ng5+ Qe6 41. Qf7 Rd6 42. Qf3+ Kc5 43. Bd3 Ng6 44. Qh7 Nh8 45. Nh3 Qg8? to get the following board:

Which translates to 111111111110000001101100?, or 1101100?

We play 46. Ng6 Rd8 47. Nh4 Kd6 48. Re6+ Kd7 49. Rf6 Ke8 50. Rf4 c6 51. bxa4? to get the following board:

Which translates to 11111111111110001100000?, or 1100000?

We play (51.) Qd5 52. Rf8+ Kd7 53. Qg8 Ng6 54. Bh8 Kc7 55. Nf5 Rd6 56. Ne7 Kb6 57. Qff7 Nf4 58. Bg6 Ne6 59. Ng5 Ka6 60. Nh7? to get the following board:

Which translates to 11111111000000011110111?, or 11110111?

We play (60.) Kb6 61. Qe8? to get the following board:

Which translates to 11111111000000011101111?, or 11101111?

We play (61.) Rd8 62. Bd3 Nc5 63. Qg4 Qg8 64. Bg7 Ka6 65. Qf7? to get the following board:

Which translates to 11111111110000011110010?, or 11110010?

We play (65.) Rxf8 66. Qe8 Bb7 67. Nc8 Ba8 68. Qgd7? to get the following board:

Which translates to 1111111110000011101100?, or 11101100?

We play (68.) Nb7 69. Nd6 Nd8 70. Ne4? to get the following board:

Which translates to 1111111111000011100100?, or 11100100?

We play (70.) Ka5 71. Qh5 Kb6 72. Bh8 Ka6 73. Qh4? to get the following board:

Which translates to 1111111111100001100001?, or 1100001?

We play (73.) Bb7 74. Bg7 Kb6 75. Bxf8? to get the following board:

Which translates to 111111111110000011010?, or 11010?.

The game ends in a draw in this final position. Therefore, the Binary Turing Machine!? program generated is:

10!
11!
110!
10!
10!
11?
11001000?
11100101?
11101100?
11101100?
11101111?
1101100?
1100000?
11110111?
11101111?
11110010?
11101100?
11100100?
1100001?
11010?

Computational Class

The language Chessoteric compiles to, Binary Turing Machine!?, is Turing-complete. However, there is a limited number of chess games, meaning that Chessoteric is unfortunately not Turing-complete.

Interpreters

Interpreter in Python

See also