Family edition
Football Play Lab: The Route Tree, Procedures with Parameters
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
- A computer or Chromebook with a current browser.
- The link: mytekdev.com/try/footballplaylab?lesson=the-route-tree-procedures-with-parameters&ref=fam-footballplaylab-3. No account, no email and nothing to install.
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.
- 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.
- 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.
- 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.
- 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.
- 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.
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
- 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.
- 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.
- 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.
- 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.
- 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:
- What does the 10 in me.out(10) change, and what stays the same?
- Why is out(15) knocked away when out(12) gains 14?
- Why does the post fail against Cover 1?
- The out by hand gains 12.4 yards. Why does the level refuse it?
- What is the parameter in your own procedure, and what did you test it at?
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
- Write def double_move(depth): run depth yards, cut out, run 2, cut up, run 10. Call double_move(8) on the Practice field against Cover 1 and record the gain.
- Give your procedure a second parameter, such as how far it runs after the cut, and test two values of each.
- Write a procedure for the quarterback: def throw_after(seconds, who), and call it from Q's program.
Bring it into other subjects
- Math: graph gain against depth for the out route: 8, 10, 12, 15. Where does the line stop?
- Physical education: run three routes from the tree at two depths each. Which is hardest to cover?
- Careers: look up how a playbook is organized, and compare it with a library of procedures.
- Computer science: write the route tree as a list of names, and a loop that tries each one at depth 10.
For your records
Ready to copy into an hour log, a portfolio or a transcript.
| Lesson | Football Play Lab: The Route Tree, Procedures with Parameters |
|---|---|
| Subjects | Computer science |
| Time | 45 minutes |
| What we did | Wrote 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 practiced | Procedures 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? ________________________
- Vocabulary. Procedure, parameter, argument, route tree, Cover 1, def: write each in your own words.
- My route table. Gain, or what went wrong. curl(8): ______ curl(10): ______ curl(12): ______ out(8): ______ out(12): ______ out(15): ______ slant(3): ______ post(10): ______
- By hand. The out written with run, cut and run gained ______ yards, and the level said ______.
- 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
| Question | Answer | Why |
|---|---|---|
| 1 | B | The procedure is curl; 10 is the value its depth parameter gets. |
| 2 | B | The cut comes later, the ball arrives later, and the cornerback has caught up. |
| 3 | Open answer | A 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.