Skip to content

Instantly share code, notes, and snippets.

@kareemgrant
Last active August 29, 2015 14:17
Show Gist options
  • Save kareemgrant/e55e56fff71bcaeb273d to your computer and use it in GitHub Desktop.
Save kareemgrant/e55e56fff71bcaeb273d to your computer and use it in GitHub Desktop.

Goals

  1. Solidify your understanding of classes and objects

Assignment

  1. Create a program that takes a word and provides a Scrabble score associated with that word. A lookup hash that associates letters with scores can be found here

Bonus scenarios such as double word or triple letter scores should not be taken into account

Use all available resources - ruby documentation, stack overflow, etc.

Recommended Approach: Create a class called Scrabble that implements a method called score that accepts one word as a parameter and returns the scrabble score associated with that word:

  Scrabble.new.score("ruby")

  # => 9

Methods that you'll probably need:

.split

.each

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment