Skip to content

appdevfall16/rps_rcav

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

  • Fork this repository.
  • Clone your Fork (Open in Desktop)
  • In Terminal, cd to the root folder of the application.
  • bundle install (or just bundle for short). This makes sure that your laptop has all the gems it needs for this project. You only need to bundle once per project.
  • rails server (or just rails s for short). This starts up the app server so you can visit localhost:3000 and see it running. Ctrl-C to shut it down when you're done working.
  • 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 Atom.

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. Connect the RCAV dots 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. In Rails, the <head> of our documents lives in app/views/layouts/application.html.erb. Add a <link> to /assets/css/bootstrap.css here, 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.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors