> OK, let me stress that I hardly know anything about GAME code. But I read somewhere that it is a Turing-complete programming language.
It is Turing-complete, but it is also relies on specialized functions, and code written in GAME Code follows certain conventions. One of these is that the movement of a piece is usually defined by two functions, and sometimes by an optional subroutine for actual moves. One function defines the range of the piece, and the other checks whether a particular move is legal. Using both functions is an optimization that saves the code from checking for legal moves to every space on the board. Since actual moves sometimes include complications that may be ignored when checking whether a potential move is legal, and also because they are evaluated after pieces have moved instead of before, subroutines are sometimes used to handle actual moves. The distinction that GAME Code makes between functions and subroutines is not part of most languages, including JavaScript. It was borrowed from BASIC.
> OK, let me stress that I hardly know anything about GAME code. But I read somewhere that it is a Turing-complete programming language.
It is Turing-complete, but it is also relies on specialized functions, and code written in GAME Code follows certain conventions. One of these is that the movement of a piece is usually defined by two functions, and sometimes by an optional subroutine for actual moves. One function defines the range of the piece, and the other checks whether a particular move is legal. Using both functions is an optimization that saves the code from checking for legal moves to every space on the board. Since actual moves sometimes include complications that may be ignored when checking whether a potential move is legal, and also because they are evaluated after pieces have moved instead of before, subroutines are sometimes used to handle actual moves. The distinction that GAME Code makes between functions and subroutines is not part of most languages, including JavaScript. It was borrowed from BASIC.