Lesson 1 of 11
The plan, in plain words
Show on a big screenOne program for a whole kite mela sounds huge. It is four small jobs. Each kite gets a word, steady or dancer. The word says how the kite flies. The check-in list is where each kite is written on arrival.
Step 1 of 5
- Four jobs wait in a row.
- Collect reads today's kites off the check-in list.
- Decide guesses each kite's word.
- Order lines them up, shortest tail first.
- Report prints the sheet and its tally.
The rule
Split a big task into small, named jobs. This project has four: collect, decide, order, report. Each job does one thing.
const kites = [];— collect keeps today's rows. The[]is an empty list.kiteCount(rows)returns how many rows the listrowsholds.rows.lengthis that count.
Seven rows are on the check-in list. So kiteCount should return 7. An empty list is a real list too. Its count is 0. Either way, KITE SHEET prints.
Write the missing line. Then the first job of the mela runs.
Loading lab…
The sheet prints even with the line missing. Run it once like that. Read what prints. Then write the line and run it again.
Try the lab to finish this lesson.