SlideShare a Scribd company logo
GOOGLE'S
APPLIED CS
WITH ANDROIDDAY 1
ANAGRAMS
WHAT IS AN ANAGRAM?
An anagram is a word formed by rearranging the letters of another
word.
— Wikipedia
EXAMPLE
Cinema is an anagram of iceman.
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.
CATCHThe addition of extra letter at the beginning or the end without
reordering the other letters is not valid.
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) ❌
STARTER CODE
ANAGRAMDICTIONARY'S CONSTRUCTOR
WHAT IS NEEDED?
1. Word validation
2. Random word selection
3. Get word's anagrams
4. Get words by length (ext)
WORD VALIDATIONSet<String> wordSet = new HashSet<>();
ACCESS TIME: O(1)
RANDOM WORD SELECTION
ArrayList<String> wordList = new ArrayList<>();
RANDOM ACCESS TIME: O(1)
GET WORD'S ANAGRAMS
Map<String, ArrayList<String>> lettersToWord =
new HashMap<>();
ACCESS TIME: O(1)
GET WORDS BY LENGTH
Map<Integer, ArrayList<String>> sizeToWords =
new HashMap<>();
SCARNE'S DICE
RULES1. 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
STARTER CODE
THIS IS IT FOR TODAY
ANY DOUBTS?

More Related Content

PDF
Storytelling For The Web: Integrate Storytelling in your Design Process
PDF
Artificial Intelligence, Data and Competition – SCHREPEL – June 2024 OECD dis...
PDF
How to Leverage AI to Boost Employee Wellness - Lydia Di Francesco - SocialHR...
PDF
2024 Trend Updates: What Really Works In SEO & Content Marketing
PDF
Google Applied CS - Day 3
PDF
Google Applied CS - Introduction
PDF
V 10 7-20
PDF
Google Applied CS - Day 4
Storytelling For The Web: Integrate Storytelling in your Design Process
Artificial Intelligence, Data and Competition – SCHREPEL – June 2024 OECD dis...
How to Leverage AI to Boost Employee Wellness - Lydia Di Francesco - SocialHR...
2024 Trend Updates: What Really Works In SEO & Content Marketing
Google Applied CS - Day 3
Google Applied CS - Introduction
V 10 7-20
Google Applied CS - Day 4

Recently uploaded (20)

PDF
RMMM.pdf make it easy to upload and study
PDF
O7-L3 Supply Chain Operations - ICLT Program
PDF
Supply Chain Operations Speaking Notes -ICLT Program
PDF
Computing-Curriculum for Schools in Ghana
PPTX
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
PDF
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
PDF
Classroom Observation Tools for Teachers
PPTX
human mycosis Human fungal infections are called human mycosis..pptx
PDF
Microbial disease of the cardiovascular and lymphatic systems
PDF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PDF
STATICS OF THE RIGID BODIES Hibbelers.pdf
PPTX
master seminar digital applications in india
PDF
O5-L3 Freight Transport Ops (International) V1.pdf
PDF
2.FourierTransform-ShortQuestionswithAnswers.pdf
PDF
Complications of Minimal Access Surgery at WLH
PDF
FourierSeries-QuestionsWithAnswers(Part-A).pdf
PPTX
Lesson notes of climatology university.
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PDF
GENETICS IN BIOLOGY IN SECONDARY LEVEL FORM 3
PDF
VCE English Exam - Section C Student Revision Booklet
RMMM.pdf make it easy to upload and study
O7-L3 Supply Chain Operations - ICLT Program
Supply Chain Operations Speaking Notes -ICLT Program
Computing-Curriculum for Schools in Ghana
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
Classroom Observation Tools for Teachers
human mycosis Human fungal infections are called human mycosis..pptx
Microbial disease of the cardiovascular and lymphatic systems
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
STATICS OF THE RIGID BODIES Hibbelers.pdf
master seminar digital applications in india
O5-L3 Freight Transport Ops (International) V1.pdf
2.FourierTransform-ShortQuestionswithAnswers.pdf
Complications of Minimal Access Surgery at WLH
FourierSeries-QuestionsWithAnswers(Part-A).pdf
Lesson notes of climatology university.
Microbial diseases, their pathogenesis and prophylaxis
GENETICS IN BIOLOGY IN SECONDARY LEVEL FORM 3
VCE English Exam - Section C Student Revision Booklet
Ad
Ad

Google Applied CS - Day 1