Standard Chess

From Esolang
Jump to navigation Jump to search
Standard Chess
Designed by MasterWoodie
Appeared in 2023
Memory system tape
Computational class Turing complete (Probably)
Reference implementation MasterWoodie Homepage
File extension(s) .stdchess

Standard Chess is a programming language, that is designed to look like a chess game. It was created by MasterWoodie in 2023

Moves

Standard Chess uses Chess Notation:

Piece Notation
King K
Queen Q
Rook R
Bishop B
Knight N
Pawn Nothing

The position is defined by a letter (a-h) and a number (0-8)

Special Moves:

Move Notation
Capture x in front of the position
Check + behind the position
Castle 0-0 or 0-0-0
Pawn Promotion =<Piece> behind the move
Mate #
Draw 1/2


Structure

In a Standard Chess Program only chess moves are allowed.
The language operates on a tape, where each cell can hold a value between 0 and 255
Important: Every Standard Chess Program needs a result (Mate or Draw)

The commands of the program are based on the piece:

Piece Description
King Flow control:

a = check? or take?, j = currentValue is not 0?, dif = positionLetter - positionDigit, amount= 1
if a: amount = nextMove as number
if j: no move if dif > 0: move instruction pointer left by amount
if dif < 0: move instruction pointer right by amount(if a: exclude nextMove)

Queen Random Stuff:

a = check? or take?, dif = positionLetter - positionDigit
if dif is 0: currentCell = randomNumber
if dif is 1: currentCell = if a: cellPointer else length of output
if dif is 2: currentCell = if currentCell is 0: 1 else 0
if dif is 3: currentCell = if a: nextMove as number else 0

Rook Tape Movement:

a = check? or take?, dif = positionLetter - positionDigit, amount = 1
if a: amount = nextMove as number if dif > 0: move cell pointer left by amount
if div < 0: move cell pointer right by amount

Bishop Input/Output:

a = check? or take?, dif = positionLetter - positionDigit, amount = 1
if dif > 0: take input -> if a: a number else a character
if div < 0: output current cell -> if a: as a number else as a character
if div is 0: if a: amount = nextMove as number; remove amount characters from output and set currentCell = value of last character
-> if amount is 0: clear output and set currentCell = value of first character

Knight Arithemtic Operations:

a = check? or take?, dif = positionLetter - positionDigit, amount = 1
if a: amount = nextMove as number if dif > 0: remove amount from current cell
if div < 0: add amount to current cell

Pawn no command, except on promotion, in which case it will evaluate like it is the promoted piece

To turn a move into a number, it first must be a normal move -> no castle, mate or draw
for the position -> evaluate as a base 8 number, where the letter is the 10th place, both places are first reduced by 1 (to have the digits 0-7)
if the move is a take add 127 to the number
if the move is a check add 64 to the number

Additionally there are a few more commands:

Command Description
0-0 start of loop
0-0-0 jump to start of loop
Mate or Draw end program

Examples

Hello World

Qa4+ b1+ Ba3 Na3+ d6 Bb8 Nxb4 a8 Bd7 
Ba3 Na3+ a4 Bb5 Ra2 Qb5+ e1 Ba3 Na3+ 
g8 Ba3 Rf1 Ba3 Ng8+ a4 Ba3 Ne1+ a7 
Ba3 Nf2+ b1 Ba3 Qb5+ e2 Ba3 #

Cat Program

0-0 Be1 Bb5 0-0-0 #