Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Google Applied CS - Day 1

Google Applied CS - Day 1

Day 1:

Anagram (HashSet, HashMap and ArrayList) and Scarne's dice

Harsh Vakharia

March 28, 2016
Tweet

More Decks by Harsh Vakharia

Other Decks in Education

Transcript

  1. WHAT IS AN ANAGRAM? An anagram is a word formed

    by rearranging the letters of another word. — Wikipedia
  2. MECHANICS 1. Provide user a word from the dictionary. 2.

    The user tries to create as many words as possible that contain all the letters of the given word plus one additional letter. 3. The user can give up and see the words that they did not guess.
  3. CATCH The addition of extra letter at the beginning or

    the end without reordering the other letters is not valid.
  4. MEANING If the game picks the word 'ore' as a

    starter, the user might guess 'rose' or 'zero' but not 'sore'. i.e. 1. rose ✅ 2. s(ore) ❌
  5. ANAGRAMDICTIONARY'S CONSTRUCTOR WHAT IS NEEDED? 1. Word validation 2. Random

    word selection 3. Get word's anagrams 4. Get words by length (ext)
  6. RULES 1. if they roll a 1, score no points

    and lose their turn 2. if they roll a 2 to 6: ▸ add the rolled value to their points ▸ choose to either reroll or keep their score and end their turn