Exercise Thursday

Goal: More practice utilizing Objects and Objects within objects. Get comfortable working through a project from start (specs, BDD) to finish (frontend and design). Remember, you're never expected to complete every single project listed in the classwork. Always make understanding—not speed—your goal. For Friday, you'll want to feel solid about testing and specs.

Code


Scrabble Score

Make a website that takes a word and returns the Scrabble score for that word. Make sure start with your specs, and that you include a README for this project and create a Git repository for it. Here are the values of letters in Scrabble:

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

If you get this far, you've done great! Don't worry about getting to the rest of the projects by the end of the day.

Weekday Finder

Make a Silex app that allows users to input a day of the year (like 7/11/2014) and then write a method to find out what day of the week it was, i.e. Monday, Tuesday, etc. Make sure you start with your specs and include a README for this project and create a Git repository for it.

Numbers to Words

Create a webpage that translates numbers in numeric form into written words. For example, it would translate 384 into "three hundred eighty four". Use multiple associative arrays to solve this.

Start small, and then get your code working for numbers up to 1 trillion.

Need I remind you to start with your specs and use BDD as you go? Make sure you include a README for this project and create a Git repository for it.

Peer Code Review


  • Did you regularly make commits with clear messages that finish the phrase "This commit will…"? You should be committing before and after each spec and after each major code change. Projects that do not document your workflow in this way will need to be redone completely from scratch.
  • Were English specs committed in a text file before any code?
  • Were passing, correctly-formatted tests in place for all behaviors before integrating Silex?
  • Do specs begin with the simplest case and progress in complexity? Do they cover enough different input values?
  • Does the application work as expected?