Giter Club home page Giter Club logo

ruby-tic-tac-toe's Introduction

ruby-tic-tac-toe

The Game Tic-Tac-Toe in Ruby

Requirements

Running

Navigate to the tictactoe directory, then run rails server; the running app is available at http://localhost:3000

My Setup Process

  1. Install Ruby and Ruby on Rails
    1. Get intro to Ruby via Ruby in Twenty Minutes
    2. Start setting up Rails environment
      1. Initially installed this Bitnami bundle, but it did not appear to help
      2. Switched to RailsInstaller, but it came w/ the wrong version of Ruby ๐Ÿ™„
      3. Ended up on the RubyInstaller page, and got Ruby + Devkit 2.7.2
      4. Also installed Yarn, because Rails needs it
  2. Create new Rails app w/ CLI
    1. rails new tictactoe
  3. Boot Rails app w/ CLI
    1. cd tictactoe; rails server
  4. Generate first controller
    1. rails generate controller Welcome index
  5. This page helped with some of the Ruby syntax used in the template
  6. The initial Rails app structure is sufficient for this project, so I'm going to use the index page I just created to host the game. I've decided I'll use ERB and Ruby to help with templating, but for the actual page interaction, the app will use vanilla JavaScript (and the DOM).
  7. Generate a model to track game history - rails generate model GameHistory num_ties:numeric num_p0_wins:numeric num_p1_wins:numeric
  8. Run migration - rails db:migrate

ruby-tic-tac-toe's People

Contributors

wolven531 avatar

Watchers

James Cloos avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.