🐍
[PY] Intro to Computational Media 2.0
CS4All Resources
  • Curriculum Overview
  • How to Use this Curriculum
  • 📬Leave Us Feedback
  • Curriculum Extras
    • 🔮Curriculum Extras Overview
    • Imposter Syndrome (pt. 1)
      • Imposter Syndrome (pt. 2)
    • Timers in Processing.py
    • Time Functions: Crazy Clock Mini Project
    • Pathfinding Algorithms and Facial Scanning
    • Playing with Pixels
  • Unit 1: Draw & Draw With Functions
    • 🔮Unit 1 Overview
    • U1LA1.1: Processing.py Introduction & Deconstruction
    • U1LA1.2 Line Functions and Parameters
    • U1LA1.3: Rectangles, Ellipses, and Layering
    • U1LA1.4: Other Shapes & Styling
    • 🗃️U1LA1 Mini Project: Taijitu Symbol
    • U1LA2.1: Intro to Color with RGB and HSB
    • 🤓EXTRA: Color & Data Storage
    • 🤓EXTRA: Color Palette Practice
    • ✨U1LA3.1: Introducing Variables
    • ✨U1LA3.2: Creating Custom Variables
    • ✨U1LA4.1: What is Abstraction?
    • ✨U1LA4.2: Intro to Functions and Function Calls
    • U1LA4.3: Draw with Functions
    • U1LA4.4: Using the Random Function
    • 🗃️U1LA4 Mini Project: Custom Emoji
    • U1LA5.1: Your Custom Function Library
    • 🎨Unit 1 Final Project: Abstract Album Art
  • Unit 2: Respond and Draw On Canvas
    • 🔮Unit 2 Overview
    • ✨U2LA1.1: Conditionals and If Statements
    • ✨U2LA1.2: Conditionals and if, elif, and else statements
    • ✨U2LA1.3: Logical Operators And/Or
    • 🗃️U2LA1 Mini Project: Make a Traffic Light
    • U2LA2.1: Draw with Mouse
    • U2LA2.2: The Map Function
    • ✨U2LA3.1: Data Type Scavenger Hunt
    • ✨U2LA3.2: Functions that Return Values
    • 🤓U2LA3.3: Functions with Purpose
    • U2LA4.1: Collision Functions and Libraries
    • U2LA4.2: Mouse Clicks and Shapes as Buttons
    • 🗃️U2LA2 Mini Project: Light Switch Game
    • U2LA5.1: Key Presses and Nested Conditionals
    • 🎨Unit 2 Final Project: Interactive Drawing App
  • Unit 3: Loops, Arrays, Media
    • 🔮Unit 3 Overview
    • U3LA1.1: While Loops
    • U3LA1.2: For Loops Pt. 1
    • U3LA1.3: Nested For Loops (For Loops Pt 2)
    • 🗃️U3LA1 Mini Project: Wallpaper Design
    • U3LA2.1: Introduction to Lists
    • U3LA2.2: Random Values from Lists
    • 🗃️U3LA2 Mini Project 1: Fortune Teller
    • U3LA2.3: Loops and Lists
    • U3LA2.4: Updating and Deleting from Lists
    • 🗃️🤓 U3LA2 Mini Project 2: CodeWars List Challenges
    • U3LA3.1: Loading Images
    • 🗃️U3LA3 Mini Project: Vision Board
    • 🎨Unit 3 Final Project: Random Meme Generator
  • Unit 4: Motion, Objects, Transformation
    • 🔮Unit 4 Overview
    • U4LA1.1: Intro to Motion with Flipbooks
    • U4LA1.2: Move in All Directions and Make it Bounce
    • U4LA2.1: Introduction to Classes and Objects
    • U4LA2.2: Reading and Updating Object Properties
    • U4LA2.3: Methods Off Canvas
    • U4LA2.4: Objects on Canvas
    • 🗃️U4LA2 Mini Project: Build a Tamagotchi
    • U4LA3.1: Creating Many Objects
    • 🤓🗃 Optional U4LA3 Mini Project: Rebuild with Objects
    • U4LA4.1: Translation Battleship
    • U4LA4.2: Rotations
    • 🤓U4LA5.1: Sine and Oscillating Motion
    • 🤓U4LA5.2: Cosine and Circular Motion
    • 🎨Unit 4 Final Project: Animated Greeting Card or PSA
  • Unit 5: Final Project
    • 🔮Unit 5 Overview
    • 🎨Course Final Project Guide
Powered by GitBook
On this page
  • Teacher Notes
  • Prompt
  • Sample Output
  • Culturally Responsive Best Practices
  • Extensions
  1. Unit 3: Loops, Arrays, Media

U3LA2 Mini Project 1: Fortune Teller

How can lists help us simplify code?

PreviousU3LA2.2: Random Values from ListsNextU3LA2.3: Loops and Lists

Last updated 2 years ago

Teacher Notes

While this is marked as a mini-project, it is really a specific practice activity for working with lists using random() and int(). It can take as little or as long as you'd like, but generally, 2 class days (about 90 minutes) is the sweet spot for students to make something they are happy with that is fully functional.

If students are struggling to come up with interesting things to fill their arrays with, encourage them to Google - this is a coding task, not a creative writing one, and students feeling stumped should feel free to get inspiration where they can.

Students have not formally been taught to join strings, which is a part of this lesson. Many students can figure out that strings can be joined by looking at the text() function they use to display mouse coordinates - string + string creates a joined version. Students may need assistance remembering this, or reasoning out why they made need spaces in their strings to make sentences readable.

Students may benefit from pre-planning before they jump to coding. This specifically designed for this project is available for their use.

Prompt

Create a project that will generate a random string of text from three distinct lists when run by taking a random value from each list and joining them to create a sentence. In the case of the fortune teller, the three lists might be TIME, PREDICTION, and REASON, so it gives you something like "Tomorrow during the full moon" (for time), "you will meet a masked stranger" (for prediction), "because of the position of Venus" (for reason). It would then generate the full sentence: "Tomorrow during the full moon you will meet a masked stranger because of the position of Venus."

The time list would contain strings similar to the example that give different times - likewise for prediction and reason, and you should be able to pick one element from each list and get a complete sentence.

NOTE: You do NOT have to make a fortune teller, but you do need to have three lists that hold strings that can be combined to make any random sentence. If you were feeling crafty, maybe make a homework generator, or get creative with the other random things you could generate!

Requirements

Your project should:

  • Generate a sentence by sequentially combining random elements from three different arrays when run

  • Include a button that can be clicked or a key that can be pressed to generate a new sentence

  • Be designed/styled in a creative way (not just text on a plain background)

  • Utilize any and all skills from prior units that you see fit to use!

Sample Output

Culturally Responsive Best Practices

Once again, allow lots of room for student choice within this project. Not all students may resonate with the idea of 'fortunes,' but there are many ways to generate random sentences without creating a fortune. Brainstorm other options that might appeal to kids, and give them the freedom to create their own options as long as they meet the criteria of the project.

(Please recall that communities can refer to a lot of things, including just the culture of being a teen, a Minecraft player, or a KPop fan - be mindful that you are allowing students to explore choice in their creations in a way that is authentic to them!)

Extensions

For students who are ready for the next level, consider asking them to create a MadLib. This should be a story that will fill random verbs/nouns/adjectives from lists that they create to change the meaning of the story.

NB: If the fortune teller seems like it would just be too easy for your class, generally, you can always have them start with the mad lib option.

As many teachers over the age of 27 may be surprised to know, not all students know what mad libs are anymore. Students can to get ready for the extension!

🗃️
planning page
start exploring here
Fortuen Teller Exemplar