Skip to content
Exit presentation

Programming + AI Capstone

The plan, in plain words

One 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.

Four jobs wait in a row.
Step 1 of 5
  1. Four jobs wait in a row.
  2. Collect reads today's kites off the check-in list.
  3. Decide guesses each kite's word.
  4. Order lines them up, shortest tail first.
  5. 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 list rows holds. rows.length is 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.

Jump to lesson

This track

  1. 0 Start here
  2. 1 The plan, in plain words
  3. 2 Collect the day
  4. 3 The distance between two
  5. 4 See the board
  6. 5 Write the classifier
  7. 6 When the nearest is wrong
  8. 7 Assemble and report
  9. 8 Who it gets wrong
  10. 9 The big picture
  11. 10 Track quiz

Other tracks