Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Directions: Write a program in Java to simulate the game Connect Four between a human and a bot. Each player should be allowed to add

image text in transcribed
Directions: Write a program in Java to simulate the game Connect Four between a human and a bot. Each player should be allowed to add one disc to the grid at a time until a winner is declared by having 4 discs in a row. The game should flow as follows: 1. Human starts the game by picking a disc 2. Human then selects a column by entering 3. The human's disc color (a single letter 4. The human and bot will alternate turns 5. Game ends when either the human or bot 6. If board has no more open spaces and ne Guidelines: A grid with seven columns and six rows is required The grid should be initialized with characters Black discs should be represented by 'B' and Red discs 'R Discs should replace the next empty cell in the column chosen. A column should not be allowed to be selected when the top cell (and all the cells beneath) are no longer empty The grid should be displayed after every turn. Game should allow for restart after a winner is declared. Board should be reset if restart is selected Bot's moves should be random

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_2

Step: 3

blur-text-image_step3

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

Genetic Databases

Authors: Martin J. Bishop

1st Edition

ISBN: 0121016250, 978-0121016258

More Books

Students also viewed these Databases questions

Question

Interact with others without being asked what country you are from?

Answered: 1 week ago