Coder Social home page Coder Social logo

scrabbler's Introduction

Scrabble

Setup.

  1. Fork and clone (remember to clone YOUR fork).
  2. Run bundle install.
  3. Run rspec to see what code answers our specs. You will find that to be... not much. :)

###Prompt

  • Work in the lib/scrabble_word.rb file

  • If you've never played the game Scrabble before, you may want to ask your neighbor about the rules of the game and how words are scored.

  • Define a class named ScrabbleWord with an initialize method that takes one argument, word, and stores it in an instance variable @word.

  • Write a "getter" for this instance variable @word that returns the word as a lowercase string.

  1. Define a method .score that returns the scrabble score of the word.

  2. Define a method .multiplier_score that takes a multiplier as an argument and returns a multiplied value of the score. (Think double or triple word score.)

Here are the letter values. Think about how you might put this data in a usable format for your methods above.

  a : 1, b : 3, c : 3, d : 2, e : 1,
  f : 4, g : 2, h : 4, i : 1, j : 8,
  k : 5, l : 1, m : 3, n : 1, o : 1,
  p : 3, q : 10, r : 1, s : 1, t : 1,
  u : 1, v : 4, w : 4, x : 8, y : 4,
  z : 10

RSpec

  • Run RSpec to test your code. To run it, type rspec into your terminal in the current directory (the one where you can see the lib and spec folders)
  • Fix any errors that come up. Once you are seeing all green text, try to refactor your methods to make them clearer / more concise. Re-run rspec to make sure your code still works.

Deliverable

Submit a pull request with your current progress. Include your Completeness (1-5) and Comfort (1-5). We recommend you include your pseudo code, comments, and descriptions of areas where you add difficulty.

Bonus

  • Tinker around with the spec/scrabble_spec.rb file and try different test cases.

scrabbler's People

Contributors

jshawl avatar robertakarobin avatar

Watchers

James Cloos avatar Benjamin 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.