R
Ruby Quiz
The three rules of Ruby Quiz:
1. Please do not post any solutions or spoiler discussion for this quiz until
48 hours have passed from the time on this message.
2. Support Ruby Quiz by submitting ideas as often as you can:
http://www.rubyquiz.com/
3. Enjoy!
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
One of the greatest challenges in programming is modular design. Building code
that adapts well to change is a Holy Grail quest for most of us. This two-part
Ruby Quiz is designed to put your ability to predict the future to the test.
This week, the Ruby Quiz is to build an engine for two player chess. Note that
I said "two player" there. You are not expected to develop an AI at any point,
just a board and piece interface players can use for games. The game should
prevent illegal moves, make sure the right player moves at the right time,
declare a winner when a game ends, etc.
You can use any interface you like, but my recommendation is to keep it as
simple as possible. ASCII art is fine. Pieces are traditionally represented as
follows:
K = King
Q = Queen
B = Bishop
N = Knight
R = Rook
P = Pawn
Uppercase is usually used for white pieces, lowercase for black. It's fine to
assume that both players alternate turns at the same keyboard. Just provide
some means to make moves and see the resulting position. That's all we need.
Next week, in part two of this quiz, I will provide a list of chess variants you
are expected to modify your program to support. You may prepare for this with
your initial version in any way that you like (plug-in support, a domain
specific language for chess games, etc.) There is little point in trying to
predict my chosen variations exactly though. You don't want to know how many
different variations there are to chess, trust me.
Please do not post any variations this week, even after the spoiler period. For
now, we are concerned only with standard chess.
If you are not familiar with the rules of chess, you can read about them here:
http://www.chessvariants.com/d.chess/chess.html
Note the description of the "en-passant" rule for pawns. Some casual chess
players are not aware of this rule. Some people are also unaware that you can
castle to queenside, but you can as the rules show.
You do not need to concern yourself with chess notation (unless you want to use
it as an interface) or recognizing draws (other than stalemate). You should
recognize check (because it affects legal moves) and checkmate (as it signals
the end of the game).
1. Please do not post any solutions or spoiler discussion for this quiz until
48 hours have passed from the time on this message.
2. Support Ruby Quiz by submitting ideas as often as you can:
http://www.rubyquiz.com/
3. Enjoy!
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
One of the greatest challenges in programming is modular design. Building code
that adapts well to change is a Holy Grail quest for most of us. This two-part
Ruby Quiz is designed to put your ability to predict the future to the test.
This week, the Ruby Quiz is to build an engine for two player chess. Note that
I said "two player" there. You are not expected to develop an AI at any point,
just a board and piece interface players can use for games. The game should
prevent illegal moves, make sure the right player moves at the right time,
declare a winner when a game ends, etc.
You can use any interface you like, but my recommendation is to keep it as
simple as possible. ASCII art is fine. Pieces are traditionally represented as
follows:
K = King
Q = Queen
B = Bishop
N = Knight
R = Rook
P = Pawn
Uppercase is usually used for white pieces, lowercase for black. It's fine to
assume that both players alternate turns at the same keyboard. Just provide
some means to make moves and see the resulting position. That's all we need.
Next week, in part two of this quiz, I will provide a list of chess variants you
are expected to modify your program to support. You may prepare for this with
your initial version in any way that you like (plug-in support, a domain
specific language for chess games, etc.) There is little point in trying to
predict my chosen variations exactly though. You don't want to know how many
different variations there are to chess, trust me.
Please do not post any variations this week, even after the spoiler period. For
now, we are concerned only with standard chess.
If you are not familiar with the rules of chess, you can read about them here:
http://www.chessvariants.com/d.chess/chess.html
Note the description of the "en-passant" rule for pawns. Some casual chess
players are not aware of this rule. Some people are also unaware that you can
castle to queenside, but you can as the rules show.
You do not need to concern yourself with chess notation (unless you want to use
it as an interface) or recognizing draws (other than stalemate). You should
recognize check (because it affects legal moves) and checkmate (as it signals
the end of the game).