Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

use the language c + + and object oriented programming for the following tasks Task 1 . Implement a console version of connect 4 .

use the language c++ and object oriented programming for the following tasks
Task 1. Implement a console version of connect 4. The playing field has five rows and seven columns.
Players are alternately asked to enter the column number to make a move. Make sure you only allow valid moves.
No invalid columns may be entered and no piece may be added to a column that is already full. Mark the squares
occupied by player 1 with X, those occupied by player 2 with O and the empty squares with '.'(see figure 1). As soon
as a player has four tiles in a row, they have won. If all squares are occupied and no player has won, it is a draw. Use
object-orientation in the implementation and divide the game sensibly into classes. A sensible division is, for
example, to separate the game logic, the playing field and the input and output from each other.
Task 2. Use pbmag to create a graphical version of the game. Add the command line option -g to start the
graphical version. There should be several command line options for the game. Add the options -rows= and -
cols= to play the game in a different size. You should also be able to specify how long to wait until the
window closes. Your programme will output suitable help with the command line flag -h.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Select Healthcare Classification Systems And Databases

Authors: Katherine S. Rowell, Ann Cutrell

1st Edition

0615909760, 978-0615909769

More Books

Students also viewed these Databases questions

Question

Explain the various techniques of Management Development.

Answered: 1 week ago