Code Monkey home page Code Monkey logo

takehome_problems's Introduction

Description

We have built a very successful Scrobly game, which up until recently is only available in Canada. We have recently won a contract to distribute in Mexico, which means our English centric scoring system will not work in the new market.

Currently we use the scorer in the game this way:

Scoring.new.score_letter('C') # returns 3

This behavior should not change. However the engineers developing the TileService have communicated they intend to use the Scoring in the following way for the Mexico version:

language = :spanish
Scoring.new(language).score_letter('C') # returns 2

Scoring "Business Logic"

Canada

English-language sets sold within Canada use:

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

Mexico

Spanish-language sets sold within Mexico (known as Scrobly – Edición en Español) will use:

1 point: A, E, O, S, I, U, N, L, R, T
2 points: C, D, G
3 points: B, M, P
4 points: F, H, V, Y
6 points: J
8 points: K, LL, Ñ, Q, RR, W, X
10 points: Z

United States

We're not allowed to sell there because of something called "Scrabble."

What We're Testing For

  • You do not have to finish the code or reach a perfect solution.
  • You should be able to explain the choices you have made.
  • You should be able to demonstrate that you can:
    • read a method in Ruby
    • express business logic into new code
    • alter the behavior of existing code
  • You may (for added bonus):
    • take advantage of refactoring opportunities
    • write new tests
    • make performance improvements

References:

https://en.wikipedia.org/wiki/Scrabble_letter_distributions#Spanish

takehome_problems's People

Contributors

heybluguy avatar dbortz avatar

Watchers

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