Skip to content

emgord/Scrabble

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 

Repository files navigation

Scrabble

Use TDD to create classes that would be used to build a scrabble game. Don't actually build an interactive game (yet)!

Project Expectations

From the project root, you should be able to execute all of your specs by just running rspec. All of your classes should be in their own files in lib/, and the entire project should be namespaced in a module called Scrabble.

Your spec descriptions should be meaningful and organized into context blocks that reflect your intent on how to use the code.

Do not move onto a new tier of requirements until the minimum requirements of the previous tier are complete and your specs are green across the board. Use TDD to drive your development and document your edge cases.

Baseline Setup

  1. You'll be working with an assigned pair.
  2. Choose one person to clone the project master repo and create a new branch with your team's initials.
  3. Push your branch so it will show in the list of branches on the project master.
  4. Choose one person to fork and clone the repo.
  5. Add the second individual as a collaborator to the forked repo.
  6. Both individuals will clone the forked repo: $ git clone [YOUR FORKED REPO URL]
  7. Both individuals cd into the dir create:d $ cd scrabble
  8. Both individuals install needed tools via Terminal:
  • $ gem install rspec
  • $ gem install simplecov
  1. We will cover rspec more in depth later, but for now, take a moment to add color output to rspec: $ echo --color >> ~/.rspec

Baseline Requirements

First, come up with a "plan of action" for how you want to work as a pair. Second, review the requirements and come up with a "plan of action" for how you want to approach this problem.

Create a project structure which contains:

  • A Scrabble class which contains some sort of data structure to store the individual letter scores listed below.
  • A Spec file which corresponds to your Scrabble class. This spec should contain one "red" test as a starting point. (This test can be modified as your get further through the requirements)

Score chart

Letter Value
A, E, I, O, U, L, N, R, S, T 1
D, G 2
B, C, M, P 3
F, H, V, W, Y 4
K 5
J, X 8
Q, Z 10

Wave 1

Primary Requirements

Create a Scrabble class with a minimum of 8 specs. The class should have the following class methods:

  • self.score(word): returns the total score value for the given word. The word is input as a string (case insensitive). The chart below shows the point value for a given letter.
  • self.highest_score_from(array_of_words): returns the word in the array with the highest score.
    • Note that it’s better to use fewer tiles, so if the top score is tied between multiple words, pick the one with the fewest letters.
    • Note that there is a bonus (50 points) for using all seven letters. If the top score is tied between multiple words and one used all seven letters, choose the one with seven letters over the one with fewer tiles.
    • If the there are multiple words that are the same score and same length, pick the first one in supplied list.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published