St. Perpetua Computer Science
Link to this page: bit.ly/db-spjh
Classroom Tools
Resources
- Sonic Pi Web Site
- Interview with creator Dr. Sam Aaron
- Music Educator Jared O’Leary’s Sonic Pi Resources
Optional Supplemental Material
- Edabit lets you work problems in JavaScript, Python, and other languages, and get XP
- Harvard CS50 Lecture 0: Computational Thinking and Scratch
2021-01-22
Grades 6–8
Create a p5.js program on repl.it demonstrating that you’ve met the objectives from 2021-01-08. Provide a link to your program in response to today’s assignment in Google Classroom.
2021-01-08
Grades 6–8
p5.js, Continued from 2020-11-20
Exercise: Create something with 2D primitives
Log in to repl.it
Go to repl.it. Log in with a Google or other account.
Reference
- Drawing other 2D primitives: rectangles, ellipses, and triangles.
Objectives
- Become comfortable with the 2D (x, y) coordinate system and positioning shapes in it
- Understand stroke and fill
- Be able to place objects where you want them
- Use
width
andheight
so that the result scales correctly when the canvas size is changed - Be able to use the p5.js reference to learn about p5.js
2020-12-18
Grades 6–8
Holiday-Themed Tinkercad Codeblocks Creations
One on One
Mr. B. will call on students to check on their progress.
2020-12-11
Grades 6–8
One on One
Mr. B. will call students in random order to work one on one with any of:
- Python
- Blender
- Tinkercad
- Codeblocks
- p5.js on repl.it
- A problem from
The rest of the class can watch or create something of their own.
2020-12-04
Grades 6–8
Advent of Code
Day 1 Puzzle
This Python code will get us started.
What we’ll learn while solving this problem:
- reading data from a file into a list
- looping over the contents of a list
- a loop within a loop
- adding numbers and comparing the sum to a number
- multiplying numbers
2020-11-20
Grades 6–8
p5.js
Last week we practiced using JavaScript by itself, without p5.js. We now return to using JavaScript with p5.js.
Exercise: Create something with 2D primitives
Log in to repl.it
Go to repl.it. Log in with a Google or other account.
Reference
- Drawing other 2D primitives: rectangles, ellipses, and triangles.
Objectives
- Become comfortable with the 2D (x, y) coordinate system and positioning shapes in it
- Understand stroke and fill
- Be able to place objects where you want them
- Use
width
andheight
so that the result scales correctly when the canvas size is changed - Be able to use the p5.js reference to learn about p5.js
Ideas
- A house
- A lake with cabins surrounding it
- A robot
- A musical instrument
- A person
- Birds in the sky
2020-11-16
Grade 5
Tinkercad Codeblocks
Loops
We’ll create a row of several objects (pyramids, perhaps) by repeating a sequence of blocks. Then we’ll shorten the code by using a loop.
2020-11-13
Grades 6–8
JavaScript Basics, in Coding Rooms
You don’t need to create an account. Please provide your real name instead of “anonymous something”.
- “Printing” to the console
- Creating variables
- Printing numbers, expressions, and variables
- Loops
- Random numbers
2020-11-06
Grades 6–8, Short Schedule
p5.js
See description in 2020-11-20, where we continue.
Exercise: Create something with 2D primitives
If You Already Know All This
If you don’t need this lesson, please explore your own p5.js ideas and projects, or make something with Python, Blender or Tinkercad Codeblocks.
Progress
Grade 6: Technical problems, perhaps due to not using headphones. Little progress.
Grade 7: Got through the corners problem solution, and started on the exercise. Needed to turn off the camera of the person speaking in order hear that person without garbling.
Grade 8: Good discussion in show and tell/ask a CS question. Need to repeat the
corners explanation.
2020-10-30
Grades 6–8
Show and Tell
Ask Your Computer Science Questions
p5.js
Grade 5
No meeting today
2020-10-16
Grades 5–8
Show and Tell
Ask Your Computer Science Questions
p5.js
Review/Introduction
Our p5.js page:
If You Don’t Need the Review
If you don’t need the review, please explore your own p5.js ideas and projects, or make something with Python, Blender or Tinkercad Codeblocks. Maybe you’d like to show something you make.
Rainbow colors program:
let hue = 0
function setup() {
createCanvas(700, 450)
background('black')
colorMode(HSB)
}
function draw() {
noStroke()
fill(hue, 100, 100)
ellipse(mouseX, mouseY, 200, 30)
++hue
if (hue > 360)
hue = 0
}
2020-10-09
Grades 5–8
Mr. B’s Show and Tell
Ask Your Computer Science Questions
One on One, Continued
2020-10-06
Grade 5
See 2020-10-02, Grades 6–8
2020-10-02
Grades 6–8
Mr. B’s Show and Tell
One on One
Mr. B. will call students in random order to work one on one with any of:
- Python
- Blender
- Tinkercad
- Codeblocks
The rest of the class can watch or create something of their own. Ideas (from past lessons):
- Continue the silly sentences program
- Use Python with Blender to create various objects in a scene
- Use Codeblocks with Tinkercad to make something
2020-09-18
Grades 5–8
Mr. B’s Show and Tell
Dice throwing Unity program
Python
- Random numbers
- Loops
- (Grade 5 got to here, but haven’t finished)
Codeblocks
- Random numbers
- Loops
Python in Blender
- Creating multiple objects at random locations
- (Grade 6 got as far as creating a single object)
2020-09-15
Grade 5
Mr. B’s Show and Tell
Something in Blender
- a cube
- subdividing into 27 smaller cubes
- extruding faces to make new parts
- moving a face
- coloring with materials
Python
Python Exercises
- print string literals
- print arithmetic expressions
- almost got to create a loop with
for
Python
Python and Blender
A cube of monkeys
import bpy
s = 7
for x in range(s):
for y in range(s):
for z in range(s):
bpy.ops.mesh.primitive_monkey_add(location=(x * 3, y * 3, z * 3))
2020-09-11
Grades 6–8
Mr. B’s Show and Tell
Something in Blender
Installing Blender
Problems? It’s free.
Tinkercad Alternative
If you aren’t able to run Blender, please make something with Tinkercad Codeblocks during class today.
Python
Python and Blender
Switch to the Scripting workspace (the tab at the top). Click New in the large window that appears to create a space where you can write Python code.
A cube
import bpy
bpy.ops.mesh.primitive_cube_add()
A row of cubes
import bpy
s = 7
for x in range(s):
bpy.ops.mesh.primitive_cube_add(location=(x * 3, 0, 0))
A cube of cubes
import bpy
s = 7
for x in range(s):
for y in range(s):
for z in range(s):
bpy.ops.mesh.primitive_cube_add(location=(x * 3, y * 3, z * 3))
Grade 5
Mr. B’s Show and Tell
Something in Blender
Installing Blender
Problems? It’s free.
Tinkercad
Let’s look at some of your Tinkercad creations.
Python
Let’s do some Python programming together.
from random import choice
nouns = ['girl', 'farmer', 'bicycle']
verbs = ['runs', 'cooks', 'swims']
print(choice(nouns), choice(verbs))
2020-09-04
Grades 6–8
Mr. B’s Show and Tell
Latest Unity project
Tinkercad
Let’s look at some of your Tinkercad creations.
Python
Let’s do some Python programming together.
from random import choice
nouns = ['girl', 'farmer', 'bicycle']
verbs = ['runs', 'cooks', 'swims']
print(choice(nouns), choice(verbs))
2020-08-28
All Grades
- Join your Google Classroom
- Mr. B’s latest fun projects
- Tinkercad
- We can make 3D models and use them in games we create
- Log in
- Using a Google account may be easiest
- Go through tutorials to learn the basics
- Make something (house, animal, vehicle, whatever you like)
- Codeblocks
- Let’s make something together
- You make something else on your own
May 27, 2020
Grade 5
- Experimenting with physics with a Unity program
- Jointly developing a p5.js program
Grades 6 and 7
- Experimenting with physics with a Unity program
- Learning some C♯ on Edabit.com
May 20
Mr. Briccetti’s Unity Learning Progress
Demo of falling balls project
Writing Text with p5.js
This simple example displays a centered message.
Greeting or “Thank You” Card with p5.js
Using this example if you like, make a greeting or “thank you” card with p5.js, or use any other programming language or environment, such as MakeCode Arcade, Python, Phaser, Scratch, or Snap! to make a card.
Remember that when you use web-based environments, your programs may be visible to the public, so don’t write anything that should be private.
Classes over the Summer and Beyond
Have your parents get in touch if you’re interested in continuing to learn with me.
May 13
Processing Community Hangout
Unity Game Development Platform
Silly Sentences Program in Python
May 6
Conway’s Game of Life
Mr. Briccetti’s Implementation
Apr 29
MakeCode Arcade
Head to MakeCode Arcade and I’ll guide you through making a project, or if you prefer, you can follow tutorials there.
Apr 22
MakeCode Arcade
Head to MakeCode Arcade and I’ll guide you through making a project, or if you prefer, you can follow tutorials there.
Apr 8
p5.js Collaborative Work and Edabit Problems, or Independent Work
I’ll give the link to the shared p5.js program in the videoconference. Here is Edabit. Please answer the question in Google Classroom. Answering the question will also show that you attended today.
Apr 1
Edabit Problems or Independent Work
Let’s do some Edabit problems. Please answer the question in Google Classroom. Answering the question will also show that you attended today.
Mar 25
p5.js Review or Independent Work
Let’s review making p5.js sketches. If you don’t need the review, please work independently on something harder, and prepare to show the class your accomplishments.
Mar 24
Office Hours
Please see “Office Hours” in Google Classroom.
Mar 11
User Interface Controls in p5.js
Notice that the snake game now has sliders you can move. Let’s learn how to create them.
Things you might control with sliders:
- red, green, and blue color amounts
- translations
- rotations
- numbers of objects
- speed of movement
Use one or more sliders and describe what you did in a class comment in Google Classroom.
Mar 4
Health Note
Wash your hands often. We have hand sanitizer. Shared computer keyboards and mice might have germs. Avoid touching your face when someone else’s germs may be on your hands.
Grades 6 and 8
- Circuit Playground Express review and practice
- Our CPX page
- Free programming time
- Circuit Playground Express, p5.js, Python, Phaser, etc.
- Describe your accomplishments in Google Classroom
Grade 5 Guests
- Introduction to MakeCode and Circuit Playground Express
- Our CPX page
Feb 26
Larry Tessler
Play the 3D Snake Game and design a new feature
Free programming time
Feb 19
p5.js Camera movement
Feb 12
p5.js 3D transformations
- Landing on a planet (a sphere)
sphere
- transformations
translate
push
,pop
- using a variable for the z argument to
translate
Feb 05
Grade 6: Continue p5.js Introduction
Grades 7–8: Continue to develop 3D Snake Game
- Play with my work in progress
Jan 29
Grade 6: Continue p5.js Introduction
Grades 7–8: Continue to develop 3D Snake Game
- Demo of my work in progress
- Quiz on keyboard processing
- Continue with 2D version
Jan 22
Sonic Pi Quiz
Grades 7–8: p5.js keyboard input
Jan 15
Sonic Pi Quiz
Sonic Pi Lesson
- Shaping the volume of notes with Attack, Decay, Sustain, Release (ADSR) envelopes
Lab
- Experiment with ADSR envelopes
- Sonic Pi Tutorial Learn something new from Dr. Sam Aaron’s Sonic Pi Tutorial, and apply it to one of your own creative ideas. Describe what you did in today’s Google Classroom assignment, in the class comments.
Jan 8
Smart Thermostat
Sonic Pi Quiz
Sonic Pi Lessons
Lab: Sonic Pi Tutorial
Learn something new from Dr. Sam Aaron’s Sonic Pi Tutorial, and apply it to one of your own creative ideas. Describe what you did in today’s Google Classroom assignment, in the class comments.
Dec 18
Sonic Pi Quiz
Sonic Pi Lecture
- Panning sounds within a stereo field
Dec 11
Holiday Toy Hack
Sonic Pi Quiz
Sonic Pi Lecture
- Reverberation effect
- Repeating with
times
Multiple Activities
You choose what to work on today, out of anything we’ve studied this school year and last.
Write what you accomplished in today’s Google Classroom assignment.
Dec 4
Holiday Toy Hack
Sonic Pi Lectures
- A reminder about play_pattern_timed, and explanation of arrays
- Simulating making a phone call with Sonic Pi
- The Slicer Effect in Sonic Pi
Multiple Activities
You choose what to work on today, out of anything we’ve studied this school year and last.
Write what you accomplished in today’s Google Classroom assignment.
Nov 20
Multiple Activities
You choose what to work on today, out of anything we’ve studied this school year and last. Consider:
- Sonic Pi
- Circuit Playground Express
- MakeCode
- CircuitPython
- Servo Motors
- Subjects from Last Year
How to Get Help or Help Others
- Ask another student
- Use RoomHelper 3000 to ask for help
- If you can help others, please write your name on the board under the subjects you can help with
Nov 13
Continuing with Sonic Pi
Nov 6
Introduction to Sonic Pi
Oct 30
Quiz and Review
- What is the range of motion, in degrees, of the servo motor we’re using?
- What is the name of the inefficient sorting algorithm we learned?
CPX Lesson
Oct 23
Quiz and Review
- What is the name of the code that lets us represent letters and symbols as numbers?
- How are color pictures represented in a computer?
- What language did we introduce for Circuit Playground Express last week?
CPX Lesson
Oct 16
Quiz and Review
- Python Hello, World and other simple programs
- Bubble sort visualization that student Joaquin and I made
Online Problem Solving Programming with Edabit
- Let’s work an Edabit problem or two
- Log in with a Google account
- Choose very easy and Python
CPX Lesson
Oct 9
Quiz and Review
- the bubble sort activity from last week
- how information is represented in computers in binary
Python
Soon we will be programming the Circuit Playground Express with Python (instead of MakeCode blocks). Let’s review (or learn for the first time) Python.
- In a new browser tab, open
- repl.it
- Log in with the Google icon
- Skip the questionnaire
- Push the New Repl button
- Choose Python (not Python 2 or Turtle)
- Push Create Repl
-
Getting Started with Python (class Python web page #2)
- Copy and paste Hello, World and other code fragments from here to repl.it and try them out. Experiment. Make changes.
- repl.it
Free Programming Lab Time
Practice Python, or program the CPX.
Oct 2
Binary Numbers Quiz in RoomHelper 3000
Algorithms
Hungarian Bubble Sort Dance
Ten Students Perform Bubble Sort
CPX Lesson
September 25
Students as Binary Digits
Seven students will come to the front of the class and represent the powers of 2: 1, 2, 4, 8, 16, 32, 64, and 128. One or more students will be calculators, and will stand at the whiteboard. I will give them a message to encode, letter by letter. They will display the binary representation of the letter’s ASCII code with 0s and 1s held in front of them. The class will decode each letter, and type it into RoomHelper 3000.
Here are the ASCII codes, in decimal (base 10) for the letters of the alphabet:
a: 97 h: 104 o: 111 v: 118
b: 98 i: 105 p: 112 w: 119
c: 99 j: 106 q: 113 x: 120
d: 100 k: 107 r: 114 y: 121
e: 101 l: 108 s: 115 z: 122
f: 102 m: 109 t: 116
g: 103 n: 110 u: 117
Multiplayer Finger Drawing with Computer Vision
I’ll have a video camera at the front of the room. Three students will come up at a time to draw with their fingers. Each student will have a small colored piece of paper taped to a fingertip. They will hold it to the camera in the middle of the scene so we can calibrate the color recognition. Then they can draw.
CPX Lesson
September 18
CPX Lesson: Musical Instrument using the Accelerometer
September 11
Reminder of last week’s binary representation and decoding lesson
There are two options today: a computer vision exercise with OpenCV and Python, and an easier exercise with CPX. Do one or both.
Computer Vision
After having you manually decode the secret message from changing patterns of bits on the CPX, I had the thought, “Why not write a computer program to see and decode the message, and make it really fast”. Here’s the result:
Here’s an explanation:
If you want to really get into it, here’s the whole playlist.
OpenCV and Python
Extract parts of an image by hue
CPX Lesson: Represent What the CPX is Sensing with Lights or Sounds
September 4
How Many Bits per Pixel in Steganography?
CPX lesson and play
August 28
- A quick lesson on Steganography based on this project
- CPX lesson and play
August 21, 2019
Welcome back. Introducing the Adafruit Circuit Playground Express.
2018–2019
- Animated Graphics Programming with JavaScript and p5.js Aug 29, 2018
- Introduction to Python Nov 7, 2018
- Python Turtle Graphics Jan 23, 2019
- Graphics and Animation Using Scala Apr 3, 2019
- Graphical Web Game with JavaScript and Phaser Apr 10, 2019