首页
网站开发
桌面应用
管理软件
微信开发
App开发
嵌入式软件
工具软件
数据采集与分析
其他
首页
>
> 详细
SEHH2042编程辅导、辅导c++编程、Programming程序设计讲解 讲解R语言编程|讲解数据库SQL
项目预算:
开发周期:
发布时间:
要求地区:
SEHH2042 2020-2021 Semester 1 – Individual Project Page 1 of 7
SEHH2042 Computer Programming
Individual Project – Connect Four Game
(Due: 18:00, 30 Nov 2020 Monday)
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 a Connect Four Game that runs in the command line
environment. Player plays against another player by inputting commands to drop checker discs
into a vertically suspended grid. You may find more information about the game via this link:
https://en.wikipedia.org/wiki/Connect_Four
This is an individual project. You need to write a Win32 Console Application program called
ConnectFour.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 R5 below).
[Welcome Message designed by you]
*** Game Menu ***
[1] Start Game
[2] Settings
[3] Instructions
[4] Credits
[5] Exit
*****************
Option (1 - 5):
SEHH2042 2020-2021 Semester 1 – Individual Project Page 2 of 7
R1 [1] Start Game
When the user inputs 1 in the Game Menu, the game starts with the current game settings
(see R2). Player 1 and player 2 take turns to drop a checker into the game board. The
game’s objective is to connect four of your checkers in a row (either vertically, horizontally,
or diagonally) while preventing your opponent from doing the same. The game ends when
any one has connected four checkers, or the game board is full. When the game board is
full, the game is drawn.
R1.1 Game Board
The game board size is 6-row, 7-column (6 x 7) vertically suspended grid. The game board
is enclosed by a boundary with characters ‘|’ for vertical boundary, ‘-’ for horizontal
boundary, and ‘+’ for the corner. Each location in the board is identified by a letter and a
number.
An example of game board is given below, with the top-left location identified by A1:
R1.2 Checkers
By default, the game use ‘O’ to represent the player 1’s checkers and ‘X’ to represent the
player 2’s checkers. The checker symbols can be modified in the settings menu, see R2.2
for more details.
R1.3 Player’s move
In each round, the game console should indicate it is which player’s turn and display
appropriate instructions that assist player to drop the checker. When a column is full, the
player cannot drop further checker to that column. The game should check whether input
column name (A to G) is already full. If the column is full, the player should enter another
column for the game to proceed. If all columns were full before the player drop the next
checker, the game should be ended before the input.
SEHH2042 2020-2021 Semester 1 – Individual Project Page 3 of 7
R1.4 Quit command ‘Q’
In each round, instead of inputting a column name to drop the next checker, player can
input ‘Q’ to exit the current game. If this happens, the system should prompt for player’s
confirmation. If the player inputs ‘y’ or ‘Y’, the player loses. The game result should be
displayed, 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 accepted, and the system should ask
the player to confirm again.
R1.5 Game Ends
The game continues until either player win the game or the game board is full. If any player
has 4 checkers in a row (horizontally, vertically or diagonally), that player wins
immediately. If the game board is full, the game is drawn. When the game ends, the game
result is displayed. Then it returns to the Game Menu.
For sample games, please refers to Appendix B.
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] Who starts first
[2] Checker symbols
[3] Return to Game Menu
*********************
Option (1 - 3):
R2.1 [1] Who starts first
When the user inputs 1 in the Settings Menu, the console displays the current setting of
who starts first (default: player 1 first). The program should let the user to choose either
player 1 or player 2 to start first. There should be relevant prompts for the user input of the
new setting. For invalid input, the program should ask for user input again until a valid
choice is made.
When it is done, the system displays the updated status and returns to the Settings Menu.
SEHH2042 2020-2021 Semester 1 – Individual Project Page 4 of 7
R2.2 [2] Checker symbols
When the user inputs 2 in the Settings Menu, the console displays the current setting of
checker symbols (default: ‘O’ for player 1, ‘X’ for player 2). The program should prompt
for the user input of the new symbols. The program should check that the new symbols are
not space (‘ ’) nor border symbols (‘+’, ‘-’, ‘|’). Symbols of the two players cannot be the
same as well. The symbols will reset back to ‘O’ and ‘X’ if the new symbols were invalid.
When it is done, the system displays the updated symbols and returns to the Settings Menu.
R2.3 [3] Return to Game Menu
When the user inputs 3 in the Settings Menu, the system returns to the Game Menu.
R3 [3] Instructions
The system displays the instructions for playing the game. After displaying the instruction,
the system returns to the Game Menu.
R4 [4] Credits
The system displays your personal details (e.g. student name, student ID, class, tutorial
group, etc.). After displaying the information, the system returns to the Game Menu.
R5 [5] Exit
When the user inputs this option, the system prompts for user’s confirmation. If the user
inputs ‘y’ or ‘Y’, the program terminates. If the user inputs ‘n’ or ‘N’, the system returns
to the Game Menu. Other input is not accepted, and the system should ask the user to
confirm again.
Other General Requirements
R6 Meaningful guidelines should be printed to assist with user’s input. Whenever an option is
selected, meaningful messages should be displayed.
R7 Suitable checking on user’s input is expected. Appropriate error messages should be
printed whenever unexpected situation happens, e.g., invalid input, input out-of-range, etc.
SEHH2042 2020-2021 Semester 1 – Individual Project Page 5 of 7
R8 The use of functions (in addition to main function) and classes are expected in your
program. Appropriate comments should be added in your source code file.
Submission
Submit one source code file (i.e., ConnectFour.cpp) that implements this project via Moodle
(class page) before the due date. Late submission is NOT accepted.
Grading criteria
Aspects Percentage
Program correctness
(Follow ALL requirements stated above)
70%
Program design
(Appropriate use of functions, use of class, modularity, etc.)
10%
Program standard
(Use of variable names, indentation, line spacing, clarity, comments, etc.)
10%
User-friendliness
(Clear guidelines to users, messages to users, etc.)
10%
Total 100% (max)
Note: the length of your program does not affect the grading of the assignment. However,
appropriate use of loops and functions are expected to avoid too many repeated codes in your
program, which contributes to the program design score of this assignment.
Marks deduction
Marks will be deducted if the program fails to be compiled. The deduction is from 5 to 20 marks,
depending on how serious the syntax error is. Note that if the program contains unacceptably too
many serious syntax errors, your program will score 0 marks.
Syntax errors also lead to failure in the program correctness if the function cannot be tested. So
please make sure that your program can be compiled successfully before your submission.
SEHH2042 2020-2021 Semester 1 – Individual Project Page 6 of 7
Appendix A - Tips
To refresh the console screen, you may use the following windows platform commands
appropriately in your program by adding the header file
:
system("cls"); // Clear everything on the screen
system("pause"); // Wait until user pressing any key to continue
To handle unexpected input error (e.g. input a character to an integer variable), you may use the
following code appropriately in your program:
int choice;
cin >> choice; // assume incorrect input a string
if (cin.fail()){ // check whether last input was failed
cin.clear(); // Reset the input error status to no error
cin.ignore(255, '\n'); // ignore maximum of 255 characters,
// or reached end of line.
}
// now, it can read again
Appendix B - Sample games.
Players moves
([Player number]: [Column])
Result of the moves
Player 1: A, Player 2: B
Player 1: A, Player 2: C
Player 1: A, Player 2: A
Player 1: B, Player 2: D
Player 1: C, Player 2: E
Game Over, player 2 wins
A B C D E F G
+---------------+
1 | |
2 | |
3 | X |
4 | O |
5 | O O O |
6 | O X X X X |
+---------------+
Player 1: A, Player 2: B
Player 1: A, Player 2: C
Player 1: A, Player 2: D
Player 1: A
Game Over, player 1 wins
A B C D E F G
+---------------+
1 | |
2 | |
3 | O |
4 | O |
5 | O |
6 | O X X X |
+---------------+
SEHH2042 2020-2021 Semester 1 – Individual Project Page 7 of 7
Player 1: A, Player 2: B
Player 1: B, Player 2: C
Player 1: D, Player 2: C
Player 1: C, Player 2: D
Player 1: D, Player 2: E
Player 1: D
Game Over, player 1 wins
A B C D E F G
+---------------+
1 | |
2 | |
3 | O |
4 | O O |
5 | O X X |
6 | O X X O X |
+---------------+
Player 1: A, Player 2: D
Player 1: B, Player 2: B
Player 1: C, Player 2: C
Player 1: A, Player 2: B
Player 1: A, Player 2: A
Game Over, player 2 wins
A B C D E F G
+---------------+
1 | |
2 | |
3 | X |
4 | O X |
5 | O X X |
6 | O O O X |
+---------------+
Player 1: A, Player 2: B
Player 1: B, Player 2: C
Player 1: D, Player 2: C
… (Skipped 36 moves)
Game board is full. Game is a draw.
A B C D E F G
+---------------+
1 | X O X O O X X |
2 | O X O X X X O |
3 | O X O X X O X |
4 | X O O O X O O |
5 | O O X X O O X |
6 | O X X O X X O |
+---------------+
*** Ensure the originality of your work. Plagiarism in any form is highly prohibited. ***
- End -
软件开发、广告设计客服
QQ:99515681
邮箱:99515681@qq.com
工作时间:8:00-23:00
微信:codinghelp
热点项目
更多
代写math 1151, autumn 2024 w...
2024-11-14
代做comp4336/9336 mobile dat...
2024-11-14
代做eesa01 lab 2: weather an...
2024-11-14
代写comp1521 - 24t3 assignme...
2024-11-14
代写nbs8020 - dissertation s...
2024-11-14
代做fin b377f technical anal...
2024-11-14
代做ceic6714 mini design pro...
2024-11-14
代做introduction to computer...
2024-11-14
代做cs 353, fall 2024 introd...
2024-11-14
代做phy254 problem set #3 fa...
2024-11-14
代写n1569 financial risk man...
2024-11-14
代写csci-ua.0202 lab 3: enco...
2024-11-14
代写econ2226: chinese econom...
2024-11-14
热点标签
mktg2509
csci 2600
38170
lng302
csse3010
phas3226
77938
arch1162
engn4536/engn6536
acx5903
comp151101
phl245
cse12
comp9312
stat3016/6016
phas0038
comp2140
6qqmb312
xjco3011
rest0005
ematm0051
5qqmn219
lubs5062m
eee8155
cege0100
eap033
artd1109
mat246
etc3430
ecmm462
mis102
inft6800
ddes9903
comp6521
comp9517
comp3331/9331
comp4337
comp6008
comp9414
bu.231.790.81
man00150m
csb352h
math1041
eengm4100
isys1002
08
6057cem
mktg3504
mthm036
mtrx1701
mth3241
eeee3086
cmp-7038b
cmp-7000a
ints4010
econ2151
infs5710
fins5516
fin3309
fins5510
gsoe9340
math2007
math2036
soee5010
mark3088
infs3605
elec9714
comp2271
ma214
comp2211
infs3604
600426
sit254
acct3091
bbt405
msin0116
com107/com113
mark5826
sit120
comp9021
eco2101
eeen40700
cs253
ece3114
ecmm447
chns3000
math377
itd102
comp9444
comp(2041|9044)
econ0060
econ7230
mgt001371
ecs-323
cs6250
mgdi60012
mdia2012
comm221001
comm5000
ma1008
engl642
econ241
com333
math367
mis201
nbs-7041x
meek16104
econ2003
comm1190
mbas902
comp-1027
dpst1091
comp7315
eppd1033
m06
ee3025
msci231
bb113/bbs1063
fc709
comp3425
comp9417
econ42915
cb9101
math1102e
chme0017
fc307
mkt60104
5522usst
litr1-uc6201.200
ee1102
cosc2803
math39512
omp9727
int2067/int5051
bsb151
mgt253
fc021
babs2202
mis2002s
phya21
18-213
cege0012
mdia1002
math38032
mech5125
07
cisc102
mgx3110
cs240
11175
fin3020s
eco3420
ictten622
comp9727
cpt111
de114102d
mgm320h5s
bafi1019
math21112
efim20036
mn-3503
fins5568
110.807
bcpm000028
info6030
bma0092
bcpm0054
math20212
ce335
cs365
cenv6141
ftec5580
math2010
ec3450
comm1170
ecmt1010
csci-ua.0480-003
econ12-200
ib3960
ectb60h3f
cs247—assignment
tk3163
ics3u
ib3j80
comp20008
comp9334
eppd1063
acct2343
cct109
isys1055/3412
math350-real
math2014
eec180
stat141b
econ2101
msinm014/msing014/msing014b
fit2004
comp643
bu1002
cm2030
联系我们
- QQ: 9951568
© 2021
www.rj363.com
软件定制开发网!