Giter VIP home page Giter VIP logo

rps_rcav_solutions's Introduction

Rock Paper Scissors

We are going to build a simple game. Users are allowed to choose Rock, Paper, or Scissors by visiting one of the following URLs:

And we will tell them whether they won or lost. Your target, in the end, is this:

https://rps-rcav-target.herokuapp.com

Setup

  • First fork, and then clone.
  • cd to the root folder of the application.
  • bundle install (or just bundle for short).
  • rails server (or just rails s for short).
  • Once the server has booted up successfully, visit http://localhost:3000 in Chrome. If all went well, you should see the "Welcome Aboard" page.
  • Open up the entire folder of code in Sublime (on Windows, File โ†’ Open Folder...; on Mac, you can select a folder using the usual File โ†’ Open... dialog).

Part 1

This is currently a brand new Rails app, with absolutely no routes, controllers, etc.

Add support for each of our three URLs one at a time. For each one,

  1. Complete the RCAV and display "Hi!" to prove that you did so. Make up whatever names you want for the controller and action.
  2. Now step back into the action and write some logic to determine whether the player won or lost. Put the computer move and the outcome into instance variables.
  3. In the view template, display the instance variables. Format it a little with some markup and some copy.

Part 2

Once you have completed the above for all three URLs,

  1. On each page, add links to get to the other two pages (so that our users don't have to keep typing into the address bar).
  2. I dropped three images in the public/assets/images folder: rock.png, paper.png, and scissors.png. Therefore, they are available to use (e.g., as the src="" of <img>s) at http://localhost:3000/assets/images/rock.png, etc. Use the images on your pages as you see fit.
  3. I also dropped bootstrap.css in the public/assets/css folder. <link> to it in app/views/layouts/application.html.erb, and use Bootstrap styles to make everything look nicer.
  4. Add a root URL such that visiting the bare domain, http://localhost:3000, defaults to playing rock.

rps_rcav_solutions's People

Contributors

raghubetina avatar

Watchers

James Cloos 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.