Krux
From Carls wiki
Image:Krux.png Krux is the name of a two-player game created by Jonatan Rydh. It is played on a 7×7 board with a hole in the middle. A winning move is one that places an opponent piece in the hole.
The pieces of the first player, White, are given the odd numbers Ⅰ, Ⅲ and Ⅴ, while the pieces of the second player, Black, have the even numbers Ⅱ, Ⅳ and Ⅵ. The first time a piece is moved, a ring must be placed around it. There are three rings: one blue, one green and one pink.
Contents |
Rules
Image:Krux Board 3D.png In the below discussion, each mention of neighbor is taken to mean 4-neighbor, that is, either horizontal or vertical neighbor. No diagonal steps are ever taken in the game.
Moves
- The pieces move in numerical order, from Ⅰ to Ⅵ.
- Each move consists of up to three steps and up to two actions. Steps and actions may come in any order, and may if desired be omitted altogether. Thus, a move which does nothing is allowed, for example.
- A step consists of moving to a free neighboring square.
- A piece may not take a step if, at a point during a move, it finds itself next to an opponent piece.
- Steps into the hole are illegal. In general, any move that places a friendly piece in the hole, even during parts of the move, is illegal.
Actions
All actions apply equally to friendly and opponent pieces.
- The active piece may repel (push away) another piece. The active piece and the piece pushed away must line up either vertically or horizontally, and the sight between them must be clear (i.e., there must be no pieces in between). The other piece is pushed away two steps, or until stopped by something behind. Pushing over, across or into the hole is expressly allowed.
- Alternatively, the action may attract (pull) another piece. As with repulsion, the two pieces must line up and have clear sight. The other piece is pulled two steps, or until stopped by the attracting piece. Pulling over, across or into the hole is allowed.
- Lastly, a piece may perform an action based on the ring it wears.
Ring-based actions
- A blue-ringed piece is called a carrier. It may pick up neighboring pieces and carry them around. The carrier must drop the other piece on an free neighboring square before it is done moving. Picking up and dropping are considered one action together. No other actions may be performed while a blue-ringed piece is carrying a piece.
- A green-ringed piece is called a jumper. It may jump to any free square located zero to three steps away. It may jump over other pieces and over the hole. When it lands, all neighboring pieces are pushed one step away where applicable.
- A pink-ringed piece is called a switcher. It may exchange places with any piece up to five steps away (regardless of what is in between).
Implementation
A Perl 5 implementation was written during the 2006 Hex tournament in Oslo. Its current state is whatever Greek letter happens to mean "feature-complete, but kind of slow"... Also, the object-orientation in the module is more of a token gesture than the honest application of a paradigm, as it stands. In short, the code would be a grateful receiver of the techniques learned from Refactoring: Improving the Design of Existing Code once I finish reading it.
