代写C代码 代做C程序 C辅导 C家教

远程写代码 Debug 讲解答疑 不是中介,本人直接写

微信: ittutor QQ: 14061936 Email: ittutor@qq.com

导航

这是一个Java算法小游戏

Page 3 of 12
TASK 2 (50%)
Research and write a report detailing the importance to software development of high
cohesion, loose coupling, data hiding and information hiding (1500 words).
Write the Java code for the following exercises and provide appropriate unit tests using
JUnit. All code must be submitted to the repository mentioned in Task 1, with evidence of
continuous commits.
Build a Connect 4 style Console game which allows the players to select the column they
wish to drop their counter (O or X) down. The program should be able to detect a winning
horizontal, vertical or diagonal line of 4 matching counters, then stop the game and declare
the winner. However, in our version of the game, we will allow each player two optional
special moves that they can each play once during the game. These are:
1. BLITZ activated by pressing the B key and selecting a column to clear.
2. TIME BOMB activated by pressing the T key and selecting a column. This places a special
symbol ‘*’ in the selected column as normal. However, it clears the counters surrounding it
horizontally, vertically and diagonally after the next player has made 2 more moves.
The game might look like this:
0 1 2 3 4 5 Player 1 X
- - - - - - Player 2 O
- - - - - -
X - - - - -
O X X - - -
O X X O - -
O O X O - -
Player 1 Select Column > 3
0 1 2 3 4 5 Player 1 X
- - - - - - Player 2 O
- - - - - -

X - - - - -
O X X X - -
O X X O - -
O O X O - -

Player 2 Select Column > B
Blitz please select column > 2
0 1 2 3 4 5 Player 1 X
- - - - - - Player 2 O
- - - - - -

X - - - - -
O X - X - -
O X - O - -
O O - O - -

X added to column 3
for player 1
Column 2 is cleared

相关推荐