Room 112: Software Development
  • Software Development Curriculum
  • CS In Entertainment
    • Fireworks
    • Historical Animation
    • Stop Motion
      • Original Stop Motion Video Instructions
    • Straight Ahead Animation
      • Comparing
      • Step 2: Adding Realism
        • Program Along With Video
    • How To Share Scratch project
    • Stick Figure Animation
      • Walking Stick Figures
      • Original Stick Figure Scene
        • How Will This be Graded?
    • Crowd Animation
      • Group Project
        • How will this be graded?
    • Fashion
      • Explainer Video / VĂ­deo Explicativo
        • Self Scoring Checklist
          • Complete the Student Self Grading Checklist When you are Done
      • Pattern Design
        • Notebook response
        • Program your Own Pattern
          • Pick at least TWO of these Extensions
      • Gees Bend Quilt Collage
        • Pattern Designer + Gees Bend
    • First Down Marker
      • Get Started With Code
      • Explain
    • Hispanic Heritage Activities
      • Sugar Skulls Research
      • Making Our Own program
      • Day of the Dead Mask Program
      • Coloring Pages
      • Ofrenda
        • Programming an Ofrenda
          • Ofrenda Scoring Checklist
    • Exploring Pen Tools
      • Straight Lines
      • Shapes
      • Snowflakes
    • Goal Line Technology
  • CS in Gaming
    • Make Code Arcade
    • What is a Game?
    • Flowcharting a Game
      • But What Game?
    • Try a Tutorial
    • Adding Animations
      • After You Complete the Tutorial
    • Games with a Message?
      • Before you code
    • Trivia Game: Grace Hopper
      • Keep Going
      • Keeping Score
  • Your Voice Is Power
  • HTML
    • My 1st Webpage
      • Title Tag
      • Body
      • Comments
      • What to Turn in
    • Color
      • Font Color
      • HTML Color Codes
      • Body Color
      • Headings
    • Images
      • One Line ASCII Art
      • Picture Files
    • Font Attributes
    • Links
    • Lists
    • WebPage #1: Hobby or Interest
    • WebPage #2: Vintage Computing
  • CSS
    • CSS Intro & File Set Up
    • Referencing External Style Sheet
    • CSS Declaration Examples
      • Testing Declaration Examples
      • Practice Before we Move Forward
      • CSS Image Examples
      • Formatting Hyperlinks
      • IFrame
      • Lists
    • CSS: Assignment #1
  • Text Based Programming
    • Pencil Code Intro
      • Basic Drawing
      • Pen Colors
      • Drawing with Circles
    • Dots & Fill
    • 1st Assignment: Adding Traits
    • Named Variable
    • Random & Repetition: Good Clean Fun
    • Getting Better at Repeating
    • Assignment #2: Orange Square Purple Circle
    • Symmetry
    • Fractals with Removal
      • Triangle
      • Fractal Programming
      • Assignment #3
      • Extension: More than 1 Turtle
    • Race Track
      • Custom Race Track
        • Two Turtles?
    • Hatch?
    • Pixel Challenges
  • Micro:Bit Programming
    • LED Screen
      • Light Levels
      • Animation
      • Sinking Boat
        • Boats 2- 6
        • Final Code
      • Unique Animation
        • Now Program Your Own
    • Radio
      • Micro:Bit Beacon Hunter
    • Activity and Motion
      • Network Notebook
        • Reading Code
      • Build Step Counter
    • Bag Alarm System
      • Planning:
      • Count Down Timer
      • Physical Design Scoring
      • Prototype Scoring
      • Prototype Demonstration Video
      • 2nd Block Groups
      • 3rd Block Groups
    • Fireflies Assignment
      • Native American Spirit Animal
      • Building a FireFly
        • What to turn in at this stage?
        • Review of Programming
      • UN Global Goal 15
      • Group Message & Video
      • Individual Assessment
        • How will this be graded?
      • Individual Write - Up
      • What to Turn In
    • Lighthouse Project
      • Light Sensor Lesson
      • Lighthouse Basic Signal
      • Attaching an LED
      • Designing your Lighthouse Signal
      • Attaching a Push Button Lesson
      • Attaching a Piezo Buzzer
        • I am going to regret this
      • Basic Lighthouse Design
        • Make a Plan
        • Program your Lighthouse
        • What to Turn in
    • 1st Design Project
      • Description of Problem
      • What should I do?
      • Make an Initial Physical Design
      • Write your Code
      • Client Communication
      • Build your Design
      • Install your Device
      • What to Turn In?
    • Strobe Lights
      • X & Y Coordinates increment
      • Nesting
      • Assignment & Extensions
    • Compass
      • Program a Compass
      • 8 Point Compass
      • 16 Point Compass
      • Navigation using Directions
        • Time
        • d= rt
        • What to Turn in
        • Bonus
    • Temperature Gauge
      • Temperature Alarm
      • What is a Breakboard with Headers
    • Collecting Data
      • Remote Control Data Collection
      • Try it with Gravity?
      • Population Trait Counter
        • Population Trait Counter Extensions
          • Step Counter
    • Micro:Pets
      • Happy
      • Mood Chance
      • Becoming Unhappy
      • Feeding & Playing
      • Building your Digital Pet
      • Customization and Extensions
      • What to Turn in
    • Practice Final Project
      • New Discovery
      • Thinking Like a Programmer
      • Creating the Boat "Sprite"
      • Moving the Boat Down
      • Programming a Move Procedure
      • How do we Get back up?
      • Now onto the fun part
    • Servo
      • Calibrate
      • Keep Exploring
    • Final Project
      • Make your Project
      • Project Board
  • Tech Writing
    • Rubric for Grading Tech Writing
    • Paper Craft Pumpkins
      • What to Turn in?
    • Paper Craft Flowers
      • What to Turn in?
    • Pod Production: Snowflake Paper Chains
      • Individual Snowflake Chain
      • Group Snowflake Chain
    • Smart Traffic Lights
    • Croc-Spotting Drones
    • Fujitsu Gymnastics
      • Written Responses
    • Program and Write
  • Computer Exploration
    • Basic Computer Skills
    • Excel Pixel Art
    • Tesselations
    • Super Heros
      • Hour of Code Activities
      • What to turn in??
      • Extensions
    • Nasa Moon 2 Mars
    • Emojis
    • Doodle for Google
    • Valentines E Card
    • PSWD: Solve by Acting Out
    • Wolf Sheep Predation
    • E-Pass
      • The Actual PASS
      • Design a Home Screen & Screen Navigation
      • Who Said Anything About a Video
        • DHS Logo Files
    • Truchet Tiles
      • Can you make them move on their own?
      • Can we make more interesting shapes?
  • ProblemSolving
    • Problem 1
    • Problem 2
    • Problem 3
    • Problem 4
    • Problem 5
    • Problem 6
    • Problem 7
    • Problem 8
    • Problem 9
    • Problem 10
    • Problem 11
    • Problem 12
      • Problem 12A
Powered by GitBook
On this page
  1. Text Based Programming

Random & Repetition: Good Clean Fun

PreviousNamed VariableNextGetting Better at Repeating

Last updated 5 years ago

So far all the code you have written has been sequential, one line of code for each action. But sometimes we want the computer to repeat an action and for that we will use a for loop

Random Walk (I love this program but it has zero actual uses)

for number in [1..20]     this means count from 1 to 20 and each time do
    fd 10                 make sure this is INDENTED
    rt random(91)
    dot limegreen, 6

How many dots will this program draw? Now change the program to make 50 dots

Each time, the program is selecting a random number between 1 and 91 as the angle of the right turn

Now modify your program so that it picks a random color each time.Make sure to include this code BEFORE you tell the computer to draw the dot.

aColor = random [red,blue,yellow,green]
dot aColor, 6

TIP: Spaces matter here

for line in [1..40]
    pen  random [red, black, blue, yellow]
    fd random 70
    rt 120

In Network Notebook: explain in english the steps that the computer is taking for each line.

Now modify the code so that the lines can be longer and modify the angle so that your drawing is based on a pentagon

20th century art movement where perspective was replaced with an emphasis on geometric shapes