Skip to content

a basic game where each player takes turns dropping pieces into the cage. Players win if they manage to get 4 of their pieces consecutively in a row, column, or along a diagonal

Notifications You must be signed in to change notification settings

i4pg/connect_four

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 

Repository files navigation

This project is part of the The Odin Project's Ruby curriculum.

Table Of Contents
  1. Description
  2. Built With
  3. Play Online
  4. Play Local
  5. What I Learned
  6. Acknowledgements

Description

Connect Four is a two-player game connection board game, in which the players choose a color and then take turns dropping colored discs into seven-column, six-row vertically suspended grid. The pieces fall straight down, occupying the lowest available space within the column. The objective of the game is to be the first to form a horizontal, vertical, or diagonal line of four of one's own discs. - Wikipedia.

Using Test Driven Development style, this game is developed with Ruby. RSpec is used for TDD. TDD is in simple terms, figuring out what needs to happen, writing a failing test for it, then writing the code to make that test pass and then refactoring the code.

Built With

  • Ruby
  • RSpec

Play Online

Replit - Connect Four

Play Local

Prerequisites

Installation

git clone git@github.com:xiyini/connect_four.git
cd connect_four
ruby lib/main.rb

To run the tests,

rspec

What I Learned

  • How to write tests with RSpec
  • How to do TDD with RSpec and Ruby
  • Different ways to test methods based on the inputs and outputs
  • Mocks and Stubs
  • Refactoring the Code
  • Splitting the problem into small steps
  • Planning the solution
  • Writing methods that do one thing

Acknowledgements

Move To Top

About

a basic game where each player takes turns dropping pieces into the cage. Players win if they manage to get 4 of their pieces consecutively in a row, column, or along a diagonal

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages