Implement the connect four game

Assignment Help Other Subject
Reference no: EM131887543

Homework - Connect 4

Connect Four is an absorbing and challenging game of vertical strategy that's easy to learn and fun to play. Rules are simple. Each player tries to build a row of four playing pieces in the frame - horizontally, vertically, or diagonally - while trying to prevent his opponent from doing the same.

Game objective - Be the first player to get four of your checkers in a row - horizontally, vertically or diagonally.

Game Rules -

1. Choose who plays first.

2. Each player in his turn drops one of his checkers down any of the slots in the top of the grid.

3. The play alternates until one of the players gets four checkers of his colour in a row. The four in a row can be horizontal, vertical, or diagonal.

4. The first player to get four in a row wins.

5. If the board is filled with pieces and neither player has 4 in a row, then the game is a draw.

Your Task - Implement the connect 4 game. Two users would play the game;

Choose 'X' and 'O' instead of the black and red checkers

Ask the user to input the column on where he wants to insert his checker

  • Check if this move is valid?
  • If the move is valid check if this move can make the user win

Alternate between the two users.

Reference no: EM131887543

Questions Cloud

Compare and contrast induction and deduction : Compare and contrast induction and deduction. Describing how you understand the contribution of each to the scientific method. Provide examples of each
Explain the applicability and issues concerning the article : Use industry websites such as Hollywood Reporter, Forbes, Variety, Studio Daily and Wall Street Journal.
Emotional expressions of dogs : The expression of the emotions in man and animals. In it, Darwin meticulously described the emotional expressions of dogs and other animals.
Child ability to understand others : Could excessive screen time hurt a child's ability to understand others' emotional cues?
Implement the connect four game : Connect Four is an absorbing and challenging game of vertical strategy that's easy to learn and fun to play. Implement the connect 4 game
What are the challenges associated with apple decision : Please read the WSJ article posted and respond to the following questions.This assignment does not have a minimum word requirement.
Show the eventual conditioned behavior : Who was Ivan Pavlov and how did he "discover" what is now known as Classical Conditioning? As part of this answer, be sure to fully detail
Develop a banking application using the account hierarchy : Develop a polymorphic banking application using the Account hierarchy you created. Using a foreach loop, iterate over each account in the array.
Relationship between alcohol consumption and academic : Post a short scenario that represents a correlational study that seeks to investigate the relationship between alcohol consumption and academic performance.

Reviews

Write a Review

Other Subject Questions & Answers

  Cross-cultural opportunities and conflicts in canada

Short Paper on Cross-cultural Opportunities and Conflicts in Canada.

  Sociology theory questions

Sociology are very fundamental in nature. Role strain and role constraint speak about the duties and responsibilities of the roles of people in society or in a group. A short theory about Darwin and Moths is also answered.

  A book review on unfaithful angels

This review will help the reader understand the social work profession through different concepts giving the glimpse of why the social work profession might have drifted away from its original purpose of serving the poor.

  Disorder paper: schizophrenia

Schizophrenia does not really have just one single cause. It is a possibility that this disorder could be inherited but not all doctors are sure.

  Individual assignment: two models handout and rubric

Individual Assignment : Two Models Handout and Rubric,    This paper will allow you to understand and evaluate two vastly different organizational models and to effectively communicate their differences.

  Developing strategic intent for toyota

The following report includes the description about the organization, its strategies, industry analysis in which it operates and its position in the industry.

  Gasoline powered passenger vehicles

In this study, we examine how gasoline price volatility and income of the consumers impacts consumer's demand for gasoline.

  An aspect of poverty in canada

Economics thesis undergrad 4th year paper to write. it should be about 22 pages in length, literature review, economic analysis and then data or cost benefit analysis.

  Ngn customer satisfaction qos indicator for 3g services

The paper aims to highlight the global trends in countries and regions where 3G has already been introduced and propose an implementation plan to the telecom operators of developing countries.

  Prepare a power point presentation

Prepare the power point presentation for the case: Santa Fe Independent School District

  Information literacy is important in this environment

Information literacy is critically important in this contemporary environment

  Associative property of multiplication

Write a definition for associative property of multiplication.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd