For a teacher with a class? The classroom edition has the full plan, slides and standards.

Homeschooling PDF

Family edition

Football Play Lab: The Route Tree, Procedures with Parameters

Ages 13-16 ยท about 45 minutes, in one sitting

In Football Play Lab your child writes a flag football play in Python, where every route is a procedure with its depth as a parameter.

What you need

Before you start: try it once yourself

Open mytekdev.com/try/footballplaylab?lesson=the-route-tree-procedures-with-parameters&ref=fam-footballplaylab-3. A short guide opens over Level 7, The route tree, in the Python tab on X's program. The field fills the middle, seen from high behind the offense: the child's five players in team colors with flag belts, the five defenders in gray. Each player has a chip, C, Q, X, Y and Z, and each chip opens that player's own program in the Blocks and Python tabs. The box on the field says the level's goal and, after each play, what happened and why, with the seconds and the yards. The panel at the bottom right says the time since the snap, where the ball is, and how open the target receiver is.

  1. The starter. X: me.curl(8), run 8 yards and stop. Q: me.drop(3), me.wait(0.6), me.throw_to("X"). C, Y and Z run 20 yards straight. The defense is Cover 1. The pass is caught 9.7 yards past the line; the level wants 10.
  2. The route tree. Help, How it works, lists it: out(depth) runs depth yards, cuts out and runs 5; curl(depth) runs and stops; dig(depth) cuts in and runs 8; slant(depth) runs and cuts in at 45 degrees; post(depth) and corner(depth) break deep to the middle and to the sideline; go() runs straight.
  3. Card seven. Put these blocks in for me puts in out(10) with the same quarterback, in Blocks. The guide uses the Python tab instead; a child who presses the card can go back to Python with Start from my blocks.
  4. Speed. Each play runs in real time. Slower and Speed up, under the field, change the speed; the play button starts the level again from the beginning, with the programs as they are now. The play is the same on every run and every computer, so every child who makes the same change sees the same numbers.
  5. Numbers to expect. curl(8) 9.7, short of 10; curl(10) 11.8; curl(12) knocked away; out(8) 10.8; out(10) 12.4; out(12) 14.0; out(15) knocked away; dig(10) 10.8; slant(3) 10.3, only 1.6 yards clear; slant(5) knocked away; corner(8) 16.3; post(10) knocked away. The out by hand: 12.4 yards, refused as no route.
A child's own procedure can do well and still be refused. def double_move(depth): run depth, cut out, run 2, cut up, run 10, called as double_move(8), scores a touchdown on Level 7 and is refused as no route. That is the level's rule, not a fault in the procedure; the Practice field runs it with no rule about routes.

The ideas, in plain words

Football teams give every route a name and a number, so a whole play fits in a few words. A route tree is that list: each route is the same pattern run at different depths. In the app the routes are procedures, and the depth is the parameter. Nobody is ever hit: a defender who reaches the ball carrier pulls a flag from its belt, and the play is over there. The field and rules are modeled on the IFAF flag football rules for 5 on 5; the app is not affiliated with or endorsed by IFAF or any league.

Against Cover 1, each receiver is covered man to man and one safety plays deep in the middle. Routes that stop or break to the sideline get away from a defender who is running deep; routes that break to the middle, like the post, run toward the safety. Deeper routes give the defender more time to recover before the ball arrives, which is why a longer depth can fail.

Teams at every level study plays with video and data, and the people who do it include coaches, video coordinators, data analysts and the software engineers who build their tools.

Do it together

  1. Open mytekdev.com/try/footballplaylab?lesson=the-route-tree-procedures-with-parameters&ref=fam-footballplaylab-3 together. X's program is one line, me.curl(8). Press play.

    You'll know it worked when: Caught 9.7 yards past the line; the level wants 10.

  2. Open Python, change me.curl(8) to me.curl(10), go back to Simulator and press play.

    You'll know it worked when: Caught for 11.8 yards: Level 7 passes.

  3. Try me.out(8), me.out(12) and me.out(15), one at a time.

    If you get stuck: Change only the line in X's program, and keep me. in front.

    You'll know it worked when: out(8) gains 10.8, out(12) gains 14, out(15) is knocked away.

  4. Try me.slant(3), me.corner(8) and me.post(10).

    You'll know it worked when: slant(3) gains 10.3, corner(8) gains 16.3, post(10) is knocked away.

  5. Write the out by hand: me.run(10), me.cut("out"), me.run(5), each on its own line, and press play.

    You'll know it worked when: The same 12.4 yards as me.out(10), but the level says no route: it wants a route from the tree.

Talk about it

Ask these while you work together. A child who has understood it can answer them without help:

The fourth question is the one that matters. A child who says "the level checks which procedure was called, and the steps by hand are not a named route" understands what a procedure is. A child who says "it is a bug" has not seen the difference between the steps and the name.

For younger and older kids

Younger: For a younger child, stay with the curl and the out, and talk about what the number changes.

Older: For an older child, write a route of your own with def and try it on the Practice field, in the Levels menu.

Keep going

Bring it into other subjects

For your records

Ready to copy into an hour log, a portfolio or a transcript.

LessonFootball Play Lab: The Route Tree, Procedures with Parameters
SubjectsComputer science
Time45 minutes
What we didWrote a simulated flag football play in Python: called route procedures with a depth parameter, tested each at several values against a Cover 1 defense, and wrote a procedure of their own with def.
Skills practicedProcedures and parameters; Python; Testing a program

Football Play Lab: The Route Tree, Procedures with Parameters

Activity sheet (optional)

Name: ______________________________ Date: ______________

Open the app: scan the QR code, or go to mytekdev.com/try/footballplaylab?lesson=the-route-tree-procedures-with-parameters

Essential question: Why is a route a procedure, and what does its parameter change?

Warm-up: A recipe says bake for 20 minutes. You change it to 30. What changes, and what stays the same? ________________________

  1. Vocabulary. Procedure, parameter, argument, route tree, Cover 1, def: write each in your own words.
  2. My route table. Gain, or what went wrong. curl(8): ______ curl(10): ______ curl(12): ______ out(8): ______ out(12): ______ out(15): ______ slant(3): ______ post(10): ______
  3. By hand. The out written with run, cut and run gained ______ yards, and the level said ______.
  4. My procedure. def ____________(________): what it does: ________________. Called with ____ and ____: ________ and ________.

1. What does the argument in me.out(10) change, and what does it leave the same?

2. Why is a deeper route not always better against Cover 1?

Quick check

Name: ______________________________

1. In me.curl(10), the 10 is: (A) the procedure (B) the argument (C) the defense

2. out(12) gains 14 yards and out(15) is knocked away because: (A) the ball is slower (B) the later cut gives the defender time to recover (C) the level is broken

3. A friend copies the same five lines into every receiver's program. Use what you learned today to say what to write instead, and why.

Answers

QuestionAnswerWhy
1BThe procedure is curl; 10 is the value its depth parameter gets.
2BThe cut comes later, the ball arrives later, and the cornerback has caught up.
3Open answerA procedure with a parameter, written once with def and called with a different argument for each receiver, so a change is made in one place.

If your state or umbrella school asks, this lesson covers CSTA 2017 2-AP-14, CSTA 2017 2-AP-17, CSTA 2017 3A-AP-17.