Code Monkey home page Code Monkey logo

scrabble's Introduction

Scrabble

Use Test Driven Development (TDD) to create a collection of Ruby classes that would provide the foundation for creating a scrabble game. Don't actually build an interactive game (yet)!

Learning Goals

  • Use Test Driven Development (TDD) to write tests and code in parallel
  • Create class and instance methods according to requirements
  • Utilize Single Responsibility Principle to reduce code dependencies
  • Utilize composition between classes, where appropriate

Project Expectations

From the project root, you should be able to execute all of your specs by running rake. Each Ruby class should be in its own file in lib/, and the entire project should be in a module called Scrabble. You will need to use require, require_relative, include and/or extend to tell Ruby how to work with classes in multiple files.

Tests

We will use minitest for this project. This is the same test framework that we've used for the Weekend Warrior exercises. However, unlike Weekend Warrior, we will write our own tests using minitest specs format. Your spec descriptions should be meaningful and organized into describe 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.

Pair Programming

Utilize good pair programming practices. Refer to articles from the Agile Alliance and the Agile Institute if you need a refresher for some best practices. Switch driver and navigator roles often. When there is uncertainity or confusion, step away from the keyboard and discuss, plan, and document on paper or whiteboard before continuing.

Baseline

Setup

  1. You'll be working with an assigned pair. High-five your pair.
  2. Choose one person to fork the project repo.
  3. Add the other person in the pair to the forked repo as a collaborator.
  4. Add the second individual as a collaborator to the forked repo.
  5. Both individuals will clone the forked repo: $ git clone [YOUR FORKED REPO URL]
  6. Both individuals cd into the dir create:d $ cd scrabble
  7. Both individuals install needed tools via Terminal: $ gem install simplecov

Requirements

Pair Plan

First, come up with a "plan of action" for how you want to work as a pair. Discuss your learning style, how you prefer to recive feedback, and one team communication skill you want to improve with this experience. Second, review the requirements for Wave 1 and come up with a "plan of action" for your implementation.

Implementation

  • Create a Scrabble module at the project root.
  • Create a Scrabble::Scoring class which contains some sort of data structure to store the individual letter scores listed below.
  • Create a Spec file which corresponds to your Scrabble::Scoring class. This spec should contain one red test as a starting point (this test can be modified as your get further through the requirements).
  • Be able to execute your one test using rake from the project root.

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::Scoring 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 in the baseline requirements shows the point value for a given letter.
    • A seven letter word means that a player used all the tiles. Seven letter words receive a 50 point bonus.
  • self.highest_score_from(array_of_words): returns the word in the array with the highest score. In the case of tie, use these tiebreaking rules:
    • It’s better to use fewer tiles, in the case of a tie, prefer the work with the fewest letters.
    • There is a bonus for words that are 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 the supplied list.

scrabble's People

Contributors

bjhunnicutt avatar hamled avatar jchung722 avatar jnf avatar kariabancroft avatar

Watchers

 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.