Skip to content

Instantly share code, notes, and snippets.

@chastell
Forked from practicingruby/pressman.md
Created May 23, 2012 22:55
Show Gist options
  • Save chastell/2778350 to your computer and use it in GitHub Desktop.
Save chastell/2778350 to your computer and use it in GitHub Desktop.

Pressman

General Information

Pressman is a two-player game played with sixteen black and sixteen white stones on a square, eight by eight board. Each player controls all of the stones of a single colour, and they take alternating turns to move their stones; the goal of the game is to capture all of the opponent’s stones.

Initial Setup

The initial setup of the board matches chess; the stones are put inside the board’s squares, and with the two players sitting at opposite sides of the board the sixteen white stones fill the two rows of the board closest to the white player while the sixteen black stones fill the two rows closest to the black player. All of the stones on the board are considered to be active.

Movement

The black player gets the first move, after which the players take alternative turns. During a given player’s turn, they must move one of their stones the way queen moves in chess: vertically, horizontally or diagonally (they can’t forfeit the move, nor ‘move’ a stone by zero squares). The stone can travel as far as there are either empty squares or a square occupied by the opponent: the stone can’t move off the board, it can’t move past another stone, and it can only move to an occupied square if it’s occupied by a stone of the other colour (in which case it captures it).

Capture

When a player captures their opponent’s stone, the capturing stone stays on the board in the captured stone’s square, while the captured stone is moved to the side of the board.

Regeneration

Whenever (a) a given player’s active stone gets to the far side of the board (the row furthest away from that player), (b) the player has any of their stones captured (by their opponent) and (c) the player has an empty square in the row closest to them, they can regenerate one of the captured stones and put it in any empty spot in the row closed to them. The stone that initiated the regeneration gets deactivated.

Deactivation and Activation

Initially all stones are active; when a stone initiates a regeneration it becomes deactivated. A deactivated stone can’t initiate a regeneration and stays deactivated until it moves back past the middle of the board (i.e., back to any of the four rows closest to the stone’s player), at which point it becomes active again.

Winning

The game ends when either one of the players loses their last piece (at which point they lose and the capturing player wins) or both players agree to a draw.

@chastell
Copy link
Author

I was lucky enough to have implementing Pressman rules as one of my core course’s tasks, so I shamelessly looked up the final implementation – note: that code sucks in may ways, and I learned so much since then, mostly thanks to Mendicant University – to resolve any questions and add the activation rules.

@chastell
Copy link
Author

…although I’m almost happy with the two sets of movement fixtures. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment