Giter Club home page Giter Club logo

csharp-scrabble-challenge's Introduction

Scrabble Challenge

Welcome to the Scrabble challenge!

Learning Objectives

  • Build a simple program using functions, loops, and conditional statements
  • Use git & GitHub to commit work and open a Pull Request

Given a word, compute the scrabble score for that word.

Letter Values

You'll need these:

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

Example "cabbage" should be scored as worth 14 points:

  • 3 points for C
  • 1 point for A, twice
  • 3 points for B, twice
  • 2 points for G
  • 1 point for E

And to total:

3 + 2x1 + 2x3 + 2 + 1
= 3 + 2 + 6 + 3
= 14

Acceptance Criteria

Scrabble s = new Scrabble("");
s.score(); // should return 0

Scrabble s = new Scrabble(" \t\n");
s.score(); // should return 0

Scrabble s = new Scrabble("a");
s.score(); // should return 1

Scrabble s = new Scrabble("f");
s.score(); // should return 4

Scrabble s = new Scrabble("street");
s.score(); // should return 6

Scrabble s = new Scrabble("quirky");
s.score(); // should return 22

Scrabble s = new Scrabble("OXyPHEnBUTaZoNE");
s.score(); // should return 41

Extended Acceptance Criteria

For some of the extended criteria, you may need to look up functions and techniques you have not used before.

Double and Triple Letter

Your solution should support the ability to define specific letters as double and triple score. Letters that count as double are enclosed in a pair of curly brackets {} - for example, the letter o would be defined as a double letter in in the word dog like this: d{o}g. Triple letters are enclosed in a set of square brackets - for example: d[o]g. Your solution should detect these brackets and apply the correct score modifications. You should add tests for this functionality to the spec file.

Double or Triple Word

Similar to above, your solution should support the ability to define double and triple word scores. To indicate a double word score, the submitted word will be enclose in a pair of curly brackets (for example {dog}), and for triple word score a pair of square brackets ([dog]). Your solution should detect these brackets and apply the correct score modifications. You should add tests for this functionality to the spec file.

csharp-scrabble-challenge's People

Contributors

logi13 avatar uerbzr avatar valentinagal 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.