Stars, Stripes and Sparkles! Try These 3 Coding Activities for July Fourth Fun
Posted 06/26/2023 by TI Staff
Here are three patriotic-themed activities you can try using Python programing on the TI‑Nspire™ CX II and the TI‑84 Plus CE Python graphing calculators.
Create star explosions in the sky!
This is a fun, experimental activity that lets you create stars in randomly generated colors. The final effect is an explosion of stars on the screen with lots of opportunity to customize your final display along the way.
Let’s take a peek at the math in the code to make a single star polygon.
What do you notice?
- n is an odd number between 5 and 11. This will be the number of vertices for the polygon.
- Int () is a python function that converts a number from the parenthesis to an integer.
- To make a simple polygon we use 360/n for the turning angle since the sum of the exterior angles of a polygon is 360 degrees.
- Notice this code multiplies the value r with 360/n — why does it do this?
But what about a star polygon? How can we make more or fewer points?
- r is the number of revolutions made to complete a star polygon.
- How many points on a star does the value r= int(n/2) create?
- What would happen if you made this value smaller? Would you get more or fewer points?
Next, change and customize your star display by playing with sizes, shapes and colors. This project is available in the Python modules section of TI Codes for the TI‑Nspire™ CX II and the TI‑84 Plus CE Python graphing calculator.
Go ahead, try this activity! Next steps:
- Download the Turtle module onto your graphing calculator.
- Follow the module online under Turtle Graphics, Mini Project 2 – Stars and Fireworks.
- Download the teacher notes for quick reference.
Celebrate by flying a flag!
Now that you know how to make some stars, let’s add some stripes! This U.S. flag is a modification of an activity that draws out the Texas flag. Using flags as an artwork template is a great opportunity to explore and experiment with your coding skills. Drawing the Texas flag activity can be found in the same Python modules section of TI Codes — this time under TI Draw > Mini Project 2 (MP2) section.
Let’s start with the Texas flag. What do we notice? There are three colored rectangles and one large star. For this program you can use the ti_draw functions for the rectangles and the Turtle module to make the star in the same program.
But, what would it take to make the U.S. flag? Take another look at the U.S. flag. Notice there are six columns with five stars each and four columns with five stars, for a total of 50 stars.
Now, let’s take a peek at the coding.
This section makes four columns of five stars at the proper positions in the blue field.
- What do we think the for loop does?
- What part of the code do we think defines the column?
- What do we think the function star() does?
This project is available in Python modules for the TI‑Nspire™ CX II graphing calculator.
Go ahead, try this activity! Next steps:
- Download the Turtle module onto your graphing calculator.
- Follow the module online under TI Draw, Mini Project 2 – Flags.
- Download the teacher notes for quick reference.
- Colors
- Parabola shapes
- A starting “rocket”
- Plus, this program was written with Python
- With your TI‑84 Plus CE graphing calculator, follow the TI-Basic module online under Basketball Game > Mini Project (MP8) The Trophy.
- Then, check out TI Codes Python modules to learn the Python language.
- Get creative!
Coding challenge: Make sparkles in the night sky!
Finally, let’s end with another style of firework display with this coding challenge. This design is modified from a completely different activity and is another great example of what a little bit of experimentation can do after learning basics from the TI Codes modules.
The original activity created explosions to celebrate the end of a game. It was originally written in TI‑Basic. This activity is part of the Beyond Basics section of TI‑Basic programming under Basketball Game > Mini Project (MP8) The Trophy.
Take a look at the original activity screen. What do we notice?
Now take a look at our modified animation again.
What differences do we notice that could be explored?
Let’s look at the translated code from the TI-Basic version to this adapted for the Python environment.
A close inspection of the code above reveals that the arcs of the blue and white fireworks display are each a different parabola emanating from the same point (80, 160).
Try adding a while loop and some random values into the program. What other variations could you create?
Want to try this coding challenge? Next steps:
Exploring Python coding with TI Codes
The TI Codes Python modules offer step-by-step instructions so users of any level can follow along and learn coding basics with TI technology. If you have an older TI-84 graphing calculator model that does not do Python, you can still learn and teach coding with our TI Codes Basic modules — similar projects, just in TI‑Basic!
You can use these modules to help lead a class together through exploration and discovery, assign modules as extra credit or even use for enrichment/after-school opportunities.
Adding coding opportunities to your classroom or summer camp gives students opportunities to flex their creative and critical thinking skills. Try an activity, and Happy Independence Day!
These activities were created by John Hanna. Hanna is a retired teacher splitting time between sailing in New Jersey and mountain biking in Florida (did he get that backwards?), still getting kicks out of working with TI to provide feedback on new products, and developing meaningful programming content for mathematics and science ... and still having fun with all the graphing calculators and the accompanying toys.
Tagcloud
Archive
- 2024
-
2023
- January (3)
- February (3)
- March (5)
- April (3)
- May (3)
- June (3)
- July (2)
-
August (6)
- 5 Ways to Spruce Up Your Classroom for Back to School
- Day of the Dog: Which Dog Is Roundest?
- Women Who Code: A TI Intern’s Fascinating STEM Journey
- 6 Sensational TI Resources to Jump-Start Your School Year
- 3 Back-to-School Math Activities to Reenergize Your Students
- A New School Year — A New You(Tube)!
- September (2)
- October (3)
- November (1)
- 2022
-
2021
- January (2)
- February (3)
- March (5)
-
April (7)
- Top Tips for Tackling the SAT® with the TI-84 Plus CE
- Monday Night Calculus With Steve Kokoska and Tom Dick
- Which TI Calculator for the SAT® and Why?
- Top Tips From a Math Teacher for Taking the Online AP® Exam
- Celebrate National Robotics Week With Supervised Teardowns
- How To Use the TI-84 Plus Family of Graphing Calculators To Succeed on the ACT®
- AP® Statistics: 6 Math Functions You Must Know for the TI-84 Plus
- May (1)
- June (3)
- July (2)
- August (5)
- September (2)
-
October (4)
- Transformation Graphing — the Families of Functions Modular Video Series to the Rescue!
- Top 3 Halloween-Themed Classroom Activities
- In Honor of National Chemistry Week, 5 “Organic” Ways to Incorporate TI Technology Into Chemistry Class
- 5 Spook-tacular Ways to Bring the Halloween “Spirits” Into Your Classroom
- November (4)
- December (1)
-
2020
- January (2)
- February (1)
- March (3)
- April (1)
- May (2)
- July (1)
- August (2)
- September (3)
-
October (7)
- Tips for Teachers in the time of COVID-19
- Top 10 Features of TI-84 Plus for Taking the ACT®
- TI Codes Contest Winners Revealed
- Best of Chemistry Activities for the Fall Semester
- Best of Biology Activities for the Fall Semester
- Best of Physics Activities for the Fall Semester
- Best of Middle Grades Science Activities
- November (1)
- December (2)
- 2019
-
2018
- January (1)
- February (5)
- March (4)
- April (5)
- May (4)
- June (4)
- July (4)
- August (4)
- September (5)
-
October (9)
- Art in Chemistry
- Which Texas Instruments (TI) Calculator for the ACT® and Why?
- Meet TI Teacher of the Month: Jessica Kohout
- Innovation in Biology
- Learning With Your Students
- A first-of-its-kind STEM strategy charts path to help educators
- #NCTMregionals Hartford 2018 Recap
- The Math Behind “Going Viral”
- Real-World Applications of Chemistry
-
November (8)
- Testing Tips: Using Calculators on Class Assessments
- Girls in STEM: A Personal Perspective
- 5 Teachers You Should Be Following on Instagram Right Now
- Meet TI Teacher of the Month: Katie England
- End-of-Marking Period Feedback Is a Two-Way Street
- #NCTMregionals Kansas City 2018 Recap
- Slope: It Shouldn’t Just Be a Formula
- Hit a high note exploring the math behind music
- December (5)
- 2017
- 2016
- 2015