In this challenge, you are to draw the chessboard below, and allow for moves to be made.
1. Drawing
Each white square has 5x9 spaces.
Each black square has 5x9 colons.
The board is surrounded by a border of colons.
The pieces are 5 characters wide and sit on the bottom row of the square in the centre.
The pawns are 4 characters wide. They sit slightly off centre to the right, with 3 blank squares on the left and 2 blank squares on the right. They sit one line above the bottom of the square.
There shall be no whitespace outside the area of the board, with the exception of an optional trailing newline.
The board and the chessmen shall be drawn exactly as shown, except that:
You may subsitute the
:
in the black squares and border for a different symbol, and you may substitute the@
in the black pieces for a different symbol (but not the same one used for the black squares.)You may move the pawns one character to the left if you wish.
.
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
: ::::::::: :::www::: _+_ ::::::::: ::::::::::
: |_|_| :: _,,::: (/) :::)@(::: )@( :::(/)::: _,, ::|_|_|:::
: |@| ::"- \~:: |@| :::|@|::: |@| :::|@|::: "- \~ :::|@|::::
: |@| :::|@|::: |@| :::|@|::: |@| :::|@|::: |@| :::|@|::::
: /@@@\ ::/@@@\:: /@@@\ ::/@@@\:: /@@@\ ::/@@@\:: /@@@\ ::/@@@\:::
:::::::::: ::::::::: ::::::::: ::::::::: :
:::::()::: () ::::()::: () ::::()::: () ::::()::: () :
:::::)(::: )( ::::)(::: )( ::::)(::: )( ::::)(::: )( :
::::/@@\:: /@@\ :::/@@\:: /@@\ :::/@@\:: /@@\ :::/@@\:: /@@\ :
:::::::::: ::::::::: ::::::::: ::::::::: :
: ::::::::: ::::::::: ::::::::: ::::::::::
: ::::::::: ::::::::: ::::::::: ::::::::::
: ::::::::: ::::::::: ::::::::: ::::::::::
: ::::::::: ::::::::: ::::::::: ::::::::::
: ::::::::: ::::::::: ::::::::: ::::::::::
:::::::::: ::::::::: ::::::::: ::::::::: :
:::::::::: ::::::::: ::::::::: ::::::::: :
:::::::::: ::::::::: ::::::::: ::::::::: :
:::::::::: ::::::::: ::::::::: ::::::::: :
:::::::::: ::::::::: ::::::::: ::::::::: :
: ::::::::: ::::::::: ::::::::: ::::::::::
: ::::::::: ::::::::: ::::::::: ::::::::::
: ::::::::: ::::::::: ::::::::: ::::::::::
: ::::::::: ::::::::: ::::::::: ::::::::::
: ::::::::: ::::::::: ::::::::: ::::::::::
:::::::::: ::::::::: ::::::::: ::::::::: :
:::::::::: ::::::::: ::::::::: ::::::::: :
:::::::::: ::::::::: ::::::::: ::::::::: :
:::::::::: ::::::::: ::::::::: ::::::::: :
:::::::::: ::::::::: ::::::::: ::::::::: :
: ::::::::: ::::::::: ::::::::: ::::::::::
: () ::::()::: () ::::()::: () ::::()::: () ::::()::::
: )( ::::)(::: )( ::::)(::: )( ::::)(::: )( ::::)(::::
: /__\ :::/__\:: /__\ :::/__\:: /__\ :::/__\:: /__\ :::/__\:::
: ::::::::: ::::::::: ::::::::: ::::::::::
:::::::::: ::::::::: www :::_+_::: ::::::::: :
:::|_|_|:: _,, :::(/)::: ) ( :::) (::: (/) :::_,,::: |_|_| :
::::| |::: "- \~ :::| |::: | | :::| |::: | | ::"- \~:: | | :
::::| |::: | | :::| |::: | | :::| |::: | | :::| |::: | | :
:::/___\:: /___\ ::/___\:: /___\ ::/___\:: /___\ ::/___\:: /___\ :
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
2. Moving
The columns are labelled A-H from left to right and 1 to 8 from bottom to top. The user shall be able to enter a move in the following form:
<start column><start row><space><destination column><destination row>
For example B1 C3
means move the knight to the square in front of the bishop's pawn (assuming the game has just started).
Alternatively the ICCF system can be used, in which the columns are labelled 1 to 8 instead of A to H. So the knight move mentioned above becomes 21 33
.
The following image (source) clarifies both systems:
The move shall be executed and the new board displayed. Any resulting capture shall occur with the moving chessman removing the chessman on the destination square from the board.
There is no need to check for a legal chess move, as that has been covered in other challenges: Smallest chess program and The smallest Chess arbiter If the user tries to move from an empty square, your program or function should ignore the move. If the user tries to capture a friendly piece, you can either ignore the move or allow the stationary piece to be captured.
There is no need to support en passant or castling.
You may assume the input will be well formed, i.e. always in the format described above. Letters will always be in the same case, you can decide what case that is.
3. Scoring and Bonuses
This is code golf. Shortest code wins.
-10% bonus if your program or function allows for promotion. The user enters a third input, this time one of the following letters: Q B R N. This should only be allowed if the move ends with a pawn on the last row. The pawn is exchanged for the named piece. QBRN.
-10% bonus if your program or function implements a special "undo" move for reversal of moves (as far back as the beginning of the game if required.) Obviously it is possible for amateur players to make illegal moves, and they may wish to undo them. You may define the input the user must give for this "undo" move (it must always be the same.) Behaviour is undefined if the user tries to undo beyond the beginning of the game.
Bonuses sum, i.e. if you go for both bonuses you get -20%.