https://github.com/maheshkumar-novice/connect-four
A command line game written in Ruby (Test Driven Development)
https://github.com/maheshkumar-novice/connect-four
connect-four rspec ruby tdd
Last synced: 3 months ago
JSON representation
A command line game written in Ruby (Test Driven Development)
- Host: GitHub
- URL: https://github.com/maheshkumar-novice/connect-four
- Owner: Maheshkumar-novice
- Created: 2021-12-08T15:53:16.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2022-03-02T11:04:16.000Z (over 4 years ago)
- Last Synced: 2025-03-26T22:15:19.552Z (over 1 year ago)
- Topics: connect-four, rspec, ruby, tdd
- Language: Ruby
- Homepage: https://replit.com/@MaheshkumarP/Connect-Four
- Size: 379 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# [Connect-Four](https://en.wikipedia.org/wiki/Connect_Four)
This project is part of the [The Odin Project](https://www.theodinproject.com/paths/full-stack-ruby-on-rails/courses/ruby-programming/lessons/hangman)'s Ruby curriculum.
Table Of Contents
## 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.
## Demo

## Built With
* Ruby
* RSpec
## Play Online
[Replit - Connect Four](https://replit.com/@MaheshkumarP/Connect-Four)
## Play Local
### Prerequisites
- Ruby (>= 2.5) - [Install](https://www.theodinproject.com/paths/full-stack-ruby-on-rails/courses/ruby-programming/lessons/installing-ruby-ruby-programming)
- RSpec - [Install](https://www.theodinproject.com/paths/full-stack-ruby-on-rails/courses/ruby-programming/lessons/introduction-to-rspec)
### Installation
```sh
git clone git@github.com:Maheshkumar-novice/connect-four.git
```
```sh
cd connect-four
```
```sh
ruby lib/main.rb
```
To run the tests,
```sh
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
- Played with color texts in Terminal
## Acknowledgements
* [The Odin Project](https://theodinproject.com)
* [Replit](https://replit.com)
* [TOIlet](http://caca.zoy.org/wiki/toilet)
[Move To Top](#connect-four)