Hedgehogs in a Hurry

Designed by Frank Nestel Published by Doris and Frank Copyright Doris and Frank This game is a sort of racing game for 2-6 players (best 4).

The game consists of a board, with 6 numbered tracks (rows), each 9 columns long, and 24 tokens in 6 colors, the "hedgehogs". Each player selects a color and takes the four tokens of his/her color.

The objective of the game is to be the first player to bring 3 of one's own tokens from the "Start" column to the "Ziel" (goal) column, i.e. the rightmost column. It makes no difference on which row the tokens reach the goal column.

The Beginning

In the beginning, the players put their tokens in the start column, one token per turn. The order in which each player places his/her tokens on the start column can be the same as the order in which the players were created. If a token has already been placed on the same square, the current token has to be placed on top of the existing one.

The tokens must be put on the board such that the resulting stacks remain as low as possible, i.e. empty fields in the start column have to be used first then the first level has to be filled and so on. Thus, there are stacks of nearly equal height on every field of the start column. There is one exception from the rule of putting in a token as low as possible: you are not forced to block yourself, that is, you cannot put your token on top of a token of your same colour.

The Movement

When all tokens are stacked in the start column, the normal game begins. The players make a move until one becomes the winner and ends the game.

A move of a player consists of three parts, which have to be played in the following order:

Part A) The player has to roll the dice. The rolled number tells the player on which row s/he has to move a token forward at the end of his/her turn. That is, the rolled number has no direct consequences at the beginning, but can be taken into account during part C of the move.

Part B) The player may (s/he is not forced to) do a sidestep: that is, s/he is allowed to take one of his/her own tokens, which is laying at the top of any stack (all tokens below the top of the stack are blocked) and move it one row up or down. This can be done in any square, with any token belonging to the player.

Part C) Finally, the player has to move one token forward. S/he must move a free (i.e. on top of a stack) token in the row with the number of the dice rolled in part A. The movement is one column in the direction of the goal (right), not changing the row. If there is none of his/her own tokens that can be moved in this row, the player is forced to move a token of another player.

Some remarks:

  • At any time, only tokens from the top of stacks can be moved.
  • Each move forward or a sidestep is only of 1 square.
  • Sidesteps are only allowed for the player's own color, forward movement is for any color.
  • Forward and sideways movement can be performed with tokens in different squares (except in the rightmost column or obstacle squares).
  • No token ever moves backward.

Obstacle Squares (The Black Fields)

On each row of the board, there is one obstacle square (black field). All tokens on an obstacle square have to wait, until there are no tokens behind them on any row. Since your opponents may move your tokens forward (if they roll the appropriate number with the dice) it is risky to put oneself in front of such an obstacle square.

The End

With the first player achieving the goal and getting 3 tokens in the goal column (regardless of which row), the game ends immediately. The further ranking of players is determined by the number of tokens they have in the goal at this time.

Objectives

1.Provide experience managing a moderately large project in a group

2.Provide experience with key C programming concepts including

  • Two-dimensional arrays
  • Data structures
  • Pointers
  • Stacks
  • Good design and documentation

3.Provide experience in using a distributed version repository for collaborative software development

A. Problem Definition

Design and implement the game engine for a C application to play the board game Igel rgern (commonly translated as "Hedgehogs in a Hurry").

Rules are very easy to find on the web (begin by reading this document that describes the basic rules of the game as well as others at boardgamegeek.com); and I will demonstrate the game in class. Therefore, I provide only a very brief overview here:

The standard game is played on a grid with 6 rows and 9 columns. The game allows 2--6 players. Each player has four tokens (representing hedgehogs) that he or she must move from the left column to the right column. Tokens sharing a square stack on top of each other. Only the token on the top of a stack may move.

On his/her turn a player:

1.rolls the dice,

2.optionally moves one of his/her token up or down one row (we call this a "sideways" move, because the token is moved sideways relative to the direction of travel toward the finish line), and

3.chooses one token (either his or another player's) in the row indicated by the dice roll and moves it one space to the right (i.e., "forward").

The winner of the game is the player who can move three of his/her tokens in the last column of the board.

Requirements:

Implement the game logic for Igel rgern. In addition to playing a basic game of Igel rgern.

  • A Graphical User Interface will not be required to be implemented but it is sufficient that you allow players to play from the command line. You can draw the board on the command line at each turn of the game.
  • You are only required to implement basic obstacles. Note that 1 obstacle square should be present for each row of the board. Obstacle squares should also be placed in different columns of the board and cannot be placed in the first and the last column on the board. A token that falls into an obstacle is stuck there until every other token has caught up (i.e. no token is placed in a column on the left of the obstacle in any row). A way to implement obstacle squares could be to turn an obstacle square into a normal one once there is no token placed in a column on the left of the obstacle in any row.
  • Use the Git distributed version control to commit your code regularly from the beginning of your project.

Code Design Requirements:

  • Comment your code, where necessary.
  • Use functions where you can.
    • Separate your code into independent modules as much as you can.

Design Hints:

1.Start by representing the squares, the players, the tokens, and the dice roll functionality without considering obstacles and the possibility to stack tokens. Subsequently add obstacles squares to the implementation of the board and the game logic. Finally include the possibility to stack tokens on the same square dynamically.

2.Use custom data structures to represent the players and the cells of the board.

3.Use 2-dimensional arrays to represent the board

4. Use a dynamic data structure (stack) to allow to stack different tokens in the same cell.

Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.