CCN2042 Computer Programming
Group Project – Ludo Game
Expected Learning Outcomes
familiarise themselves with at least one high level language programming environment.
develop a structured and documented computer program.
understand the fundamentals of object-oriented programming and apply it in computer
program development.
apply the computer programming techniques to solve practical problems.
Introduction
In this assignment, you are going to develop the Ludo Game, a board game that runs in the
command line environment. Ludo game is a board game for two to four players. The players
race their four chesses from start (“Base”) to finish (“Home”) according to the rolls of a
single die. The player who first moves all chesses to “Home” is the winner.
This is a group assignment. You need to form a group with 5 to 6 students, and write a
Win32 Console Application program called LudoGame.cpp. The requirements are listed
below.
System Requirements
R0 When the program starts, the console should display a welcome message, and then
the Game Menu of the program. User can enter the options of the corresponding
actions (see R1 to R6 below).
Welcome Message designed by your group
*** Game Menu ***
[1] Start Game
[2] Settings
[3] Game Demo
[4] Instructions
[5] Credits
[6] Exit
Option (1 - 6):
R1 [1] Start Game
When the user inputs 1 in the Game Menu, the game starts with the current game
settings (see R2). Each player has FOUR chesses. Names of the chesses for each
player are listed in the table below.
a b c d e f g h i j k l m n o p
Initially, all chesses are at their starting location “Base”. By rolling a die (i.e.,
generating a random number from 1 to 6) and according to the rules of the game (see
R1.3), the player can race the chesses to the finishing location “Home”.
R1.1 Game board
The players play on a square game board, with ‘.’ showing the board positions and ‘X’
showing the “Home” location. When the game begins, the game board together with
each player’s chess information should be displayed. In the example below, there are
two players. Player 1 is the human player whereas Player 2 is the computer player.
Player 1: Human
Base: a b c d
Home:
Player 2: COMP
Base: e f g h
Home:
R1.2 Moving paths
When a chess leaves its “Base”, it enters the game board and stops at the first position,
which is different for each player:
Chess Information for each player
Player 1 Player 2 Player 3 Player 4
Top-left corner Top-right corner Bottom-right corner Bottom-left corner
For each player, the moving paths for the chess to complete are shown below. Note
that after a chess leaves its “Base”, it needs to move 45 steps to reach ‘X’, i.e.,
“Home”.
Player 1
Player 2
Player 3
Player 4
R1.3 Game rules
To have a chess leaving “Base” and entering the game board, a player must roll
‘6’. If the player has no chess on the game board and fails to roll ‘6’, the turn
passes to the next player.
If a player has one or more chess to move, he chooses a movable chess from the
given list and moves the chess along the path by the number of positions
according to the rolling result.
If a player rolls a ‘6’, he gets a bonus turn. If the bonus turn rolls a ‘6’ again, he
gets one more bonus turn. If he rolls a ‘6’ once again, there is no more bonus turn;
after his move the turn passes to the next player.
A player cannot move a chess into a location that is occupied by other chesses of
that player.
If a chess ends on a position occupied by an opponent’s chess, the opponent chess
is sent back to the opponent’s “Base”. Any chess that has reached “Home” should
be “safe” from being sent back.
A chess can reaches “Home” only if it exactly steps on ‘X’. If the rolling value
exceeds the number of steps required, the chess should move backward for the
remaining steps.
R1.4 Human and Computer Player
There can be 2 to 4 players to play the game. Players can be human players or
computer players. A human player will select which chess to move among the
movable chesses, whereas a computer player will choose one of the movable chesses
randomly. Choice made by the computer should be displayed clearly on the console
screen.
When the program begins, the game is played by two players, one human and one
computer player, as the default setting.
R1.5 Game play – Players take turns
Each player takes turn (starting from Player 1 to Player 4) to roll a die to get a number
from 1 to 6. Based on the game rules (see R1.3), the system shows a list of movable
chesses according to the rolling result. The player then can choose a movable chess to
move on the game board according to the moving path of the player (see R1.2).
R1.6 Game play – Command “q”
Player can input ‘q’ to quit the game at any time during the game when he is asked to
choose a movable chess. If this happens, the system should prompts for player’s
confirmation. If the player inputs ‘y’ or ‘Y’, the game ends and the system returns to
the Game Menu. If the player inputs ‘n’ or ‘N’, the game continues at its current
status. Other input is not acceptable and the system should ask the player to confirm
again.
R1.7 Game Play – Game ends
The game finishes when there is a winner, who moved all four chesses to “Home”, i.e.,
‘X’ on the game board. If the game finishes, the system should display who is the
winner, and the program returns back to the Game Menu.
R2 [2] Settings
When the user inputs 2 in the Game Menu, the console displays the Settings Menu.
User can enter the options of the corresponding actions (see R2.1 to R2.3 below).
Settings Menu
[1] Number of players
[2] Number of human players
[3] Return to Game Menu
Option (1 - 3):
R2.1 [1] Number of players
When the user inputs 1 in the Settings Menu, the console displays the current game
setting of how many players play the game, and prompts for the user input of the new
setting. Note that acceptable number of players is from 2 to 4 only, and should not be
less than the current number of human players.
After the setting is updated, the new setting should be displayed and the system
returns back to the Settings Menu.
R2.2 [2] Number of human players
When the user inputs 2 in the Settings Menu, the console displays the current game
setting of how many human players play the game, and prompts for the user input of
the new setting. Note that acceptable number of human players is 0 to the number of
players of the game.
After the setting is updated, the new setting should be displayed and the system
returns back to the Settings Menu.