Skip to content

suddenlyGiovanni/coding_challenge--connect_four

Repository files navigation

Connect Four

Let's make our own version of Connect Four - the vertical checkers game.

In this game players take turns dropping their pieces into one of seven columns that have six rows of slots. The first player to get their pieces into four slots that are vertically, horizontally, or diagonally contiguous wins the game.

Connect Four

Your game can look and work however you like but it must follow these basic rules.

  1. The board has six rows and seven columns

  2. Two players take turns selecting a column to drop their checker into

  3. When a player wins, a message appears to announce the victory

  4. After a player wins, the game should reset and begin again

  5. The gameplay should involve at least one animation (for example, the checkers could fall into their slot rather than just appear instantaneously)

Bonus features

Here are several ideas to make the game more interesting if you have the time

  1. After a player wins, visually indicate which four pieces on the board satisfied the victory condition

  2. Allow players to drag their pieces across the screen and drop them into their desired column using their mouse (or finger on touch screens)

  3. Allow players to play using only their keyboard

  4. Allow players at the beginning of the game to increase the number of columns on the board and the number of connected pieces that are required to win

  5. Allow a single player to play against the computer

Implementation (TODO)

Instead being played in a browser it will be played on a terminal with a CLI. The initial implementation will only allow two human player. Eventually it will allow the player to play against the machine. (the machine will consciously and not in any random manner)

Challenges

  1. how to model the Player Grid (2d array???)
  2. how to model a game loop (series of turns -> state machine???)
  3. how to create the view layer in a terminal env?? (ink?? )

About

(WIP) A custom design coding challenge based upon spiced_academy-connect_four 🎲

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published