Skip to content

sf-wdi-25/wheel_of_fortune

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Wheel of Fortune - OO Ruby with Tests

In this lab you will be building a simplified Wheel of Fortune game using Ruby Classes and Rspec Tests.

Setup

First, make sure you've installed the rspec gem.

From the command line (inside the cloned repo directory) run:

gem install rspec # individually install the rspec gem
# or
bundle install # install all the gems listed in the Gemfile

Next, check that the rspec tests are working (they should be failing!):

rspec
# or
rspec spec/wheel_of_fortune_spec.rb

Building the Game

Take a look inside wheel_of_fortune.rb and you'll see some boilerplate code for our WheelOfFortune class.

Instance of WheelOfFortune will have three important methods:

  • making guesses ("Can I have a 'z'...?")
  • printing the game board ("Wh__l of Fortun_")
  • checking if the game is over (true/false)

Follow the tests to get started!

Tips

You can run your game from the command line by typing:

ruby wheel_of_fortune.rb

Hint: Take a look at the Drive Code at the bottom of the file!

You can also load your code into Pry to test your assumptions:

pry
> require 'wheel_of_fortune.rb'
> w = WheelOfFortune.new({...})
> w.to_s

Mega Bonus

It turns out Wheel of Fortune and Hangman have a lot in common! Can you take this lab even further, and build a hangman game?

      _______
 |/      |
 |      (_)
 |      \|/
 |       |
 |      / \
 |
_|___
h_ng m_n

About

Wheel of Fortune Lab -- OO Ruby w/ Tests

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages