Skip to content
This repository has been archived by the owner on Oct 4, 2023. It is now read-only.

tanhongit/rails-tic-tac-toe-project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

71 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Welcome to Rails Tic-Tac-Toe Project

This is the tic tac toe game with multiple modes: play with AI, two-player mode with lots of customization, invincible mode.

Demo

You can try it at https://railstictactoe.herokuapp.com

Support for me

Support this project 😜 πŸ™

PayPal buymeacoffee TanHongIT

1. Technology

  • Ruby on Rails

2. Configuration requirements

We are going to build the web application using:

  • Rails 6.0.3.2
  • Ruby 2.7.1

3. Modes

  • Play Rank with AI
  • Invincible mode
  • Two-player mode

4. Runing

4.1. Clone Repo

$ git clone https://github.com/TanHongIT/rails-tic-tac-toe-project
$ cd rails-tic-tac-toe-project

4.2. Bundle Install

$ bundle install

4.3. Yarn Install

$ yarn install

4.4. Create database with Postgresql

You must change the appropriate database configuration

Change configuration at "config/database.yml" with Postgresql.

default: &default
  adapter: postgresql
  pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
  timeout: 5000
  username: railstictactoe
  password: 1234
  host: localhost

# tutorial for ubuntu linux:
# sudo -u postgres psql
# create user "railstictactoe" with password '1234';  
# create database "railstictactoe" owner "railstictactoe"; 

development:
  <<: *default
  database: railstictactoe

# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test:
  <<: *default
  database: railstictactoe_test

production:
  <<: *default
  database: railstictactoe_production

You must change the username, password and database name accordingly!

4.5. run rails db:migrate

$ rails db:migrate

4.6. Run server

$ rails s

Now go to http://localhost:3000

5. Images demo

HomePage.

Image

Play Rank With AI.

Image

High Score Rank Screen.

Image

Two-player Mode.

Image

Two-player Mode customization.

Image

Invincible mode.

Image

Read more: Tic Tac Toe Invincible with Javascript, HTML, CSS : https://github.com/TanHongIT/JavaScript-Tic-Tac-Toe-Project