AI Tutor
Imagine walking into a bedroom where clothes, toys, and books cover every inch of the floor. Staring at the whole mess makes you want to give up before you even start!
When a task feels way too huge, computer scientists use a special thinking skill called decomposition.
Decomposition means breaking a big problem into smaller, bite-sized parts that are easy to solve one by one.
How do programmers use this same trick to build giant video games?

Breaking Down a Video Game

Nobody builds a whole video game in one single step. If you tried to write the whole game at once, your brain would get super confused!
Instead, you break the game down into three simple jobs: draw the character, make the arrow keys move the character, and count the score.
What does this look like when we turn our small steps into actual computer code?

Small Steps in Real Code

In JavaScript, programmers create small helper blocks called functions for each tiny job.
Then, a main function simply calls each small step in order to finish the entire big job.