Intro to CS Monday, August 29

Slides:



Advertisements
Similar presentations
Summer Computing Workshop. Introduction to Variables Variables are used in every aspect of programming. They are used to store data the programmer needs.
Advertisements

Mrs. Chapman. Tabs (Block Categories) Commands Available to use Script Area where you type your code Sprite Stage All sprites in this project.
Digital Art in Scratch part 1 Barb Ericson Georgia Tech Oct 2010.
Mr. Wortzman. Tabs (Block Categories) Available Blocks Script Area Sprite Stage All sprites in this project.
Scratch the Cat. Object Oriented Programing Writing computer programs Based on Objects Instead of Actions Based on Data Instead of Logic.
Programming with Alice Computing Institute for K-12 Teachers Summer 2011 Workshop.
2015 CSE/EGR Summer Camps 1 Computer Science Concepts 1. What is an algorithm? 2. Binary information coding 3. Programming concepts via Scratch Designed.
Digital Art in Scratch part 1 Barb Ericson Georgia Tech May 2011.
Fish Chomp. The screen where you can see what happens when you play your game is called the STAGE. The SCRIPT BANK is where the types of instructions.
Summer Computing Workshop. Session 3 Conditional Branching  Conditional branching is used to alter the normal flow of execution depending on the value.
Scratch Another computer programming language Developed by MIT in 2003
Introduction to Computer Programming - Project 2 Intro to Digital Technology.
1 CSC 221: Computer Programming I Fall 2009 Introduction to programming in Scratch  animation sprites  motion, control & sensing  costume changes 
Microsoft® Small Basic Conditions and Loops Estimated time to complete this lesson: 2 hours.
DAY 4. MAKING SOMETHING ‘JUMP’ Simple! Move it a certain amount ‘up’ Glide back to your original spot.
Functions / Blocks.
Review for Final June 13, 2016.
Scratch Programming Cards
Module 1: Investigation 1 Moving, Turning and Stamping
August ECS.
August 25 Intro to CS.
Intro CS – Screens and Variables
Broadcasting (Adding a new level)
August 31 Intro to CS.
Scratch for Interactivity
Interacting Sprites Module 3: Investigation 1
Exploring Mathematical Relationships Module 5: Investigation 3
Building with Numbers Module 4: Investigation 3
Scratch Unit Overview We are going to look at computer programming and how to create your very own computer game The piece of software we will be using.
What is SCRATCH? Learning Objectives: to explore the Scratch website
Intro to CS Sept 22/23, 2015.
Understanding the Geometric Shape Code
ECS 9/7/17.
August 30 Intro to CS.
Intro to CS Monday, August 24
Scratch – Simple Programming
Scratch for Interactivity
Pen Cards Pen Cards Back and Forth Draw a Line Special Effects
Pen Cards Pen Cards Back and Forth Draw a Line Special Effects
Introduction to Object-Oriented Programming
Scratch Programming Intro
Dance Cards Dance Cards
Getting Started with Scratch
Dance Cards Dance Cards
Scratch – Simple Programming
Dance Cards Dance Cards
Dance Cards Dance Cards
Dance Cards Dance Cards
Pen Cards Pen Cards Back and Forth Draw a Line Special Effects
Dance Cards Dance Cards
Dance Cards Dance Cards
Unit 3: Intro to Programming Snap! Introduction
Getting Started with Scratch
Introduction to Snap Programming
Dance Cards Dance Cards
Pen Cards Pen Cards Back and Forth Draw a Line Special Effects
Dance Cards Dance Cards
Dance Cards Dance Cards
creating a ecosystems model in net logo
Pen Cards Pen Cards Back and Forth Draw a Line Special Effects
What is SCRATCH? Learning Objectives: to explore the Scratch website
Pen Cards Pen Cards Back and Forth Draw a Line Special Effects
Creating a Simple Game in Scratch
Pen Cards Pen Cards Back and Forth Draw a Line Special Effects
CSC 221: Introduction to Programming Fall 2018
Pen Cards Pen Cards Back and Forth Draw a Line Special Effects
Dance Cards Dance Cards
Pen Cards Pen Cards Back and Forth Draw a Line Special Effects
Dance Cards Dance Cards
Presentation transcript:

Intro to CS Monday, August 29

Today’s Objectives Review SNAP! one more time Explore More Blocks If/Else Repeat Forever Broadcast Ask/Answer Boolean (and, or, not) Global and Local

SNAP! User’s Manual http://snap.berkeley.edu/SnapManual.pdf Ch 1. Blocks, Scripts, Sprites Ch 2. Saving and Loading projects Ch 3. Building a Block Ch 4. First Class Lists Ch 5. Typed Inputs Ch 6. Procedures as Data Ch 7. Object Oriented Programming Ch 8. The Outside World Ch 9. Continuations Ch 10. User Interface Elements Index

The Actors in the “Play” The Stage Actor 1 (Sprite 1) Actor 2 (Sprite 2) Actor 3 (Sprite 3) Scenery Script 2 Script 3 Script 1 Costume 1

Customizing a Costume

Example: Find a Mario costume First, find one you like. One way is to search for “mario” in Google Images. Then drag the one you like to your desktop.

Example: Find a Mario costume Then, import it as a costume for one of your Sprites by dragging it from your desktop.

Exercise 1: Add, remove and reposition sprites Find an image that you would like for your Sprite Add it to your workspace as a Sprite “costume” Replace existing costume with your new one Repeat this process – but only this time draw a STICKMAN Sprite with one leg longer than the other using the graphical editor.

What worked? What was difficult? Lab Exercise 1 Recap: Discussion What worked? What was difficult?

Lab Exercise 2: Rotation Create this simple script, then run it. Pick your stickfigure figure Sprite with one leg purposely longer than the other TIMING: 4 mins (total 8Mins) ACTUAL: 4 min (10 total), Today, let’s do a deeper dive into the Pen block set. Who can tell me what these do: - Pen Up - Pen Down - Clear - Set Pen Color? - Set Pen Shade - Stamp Who can tell me what the following block does?

Lab Exercise 2: Rotation Did any of you get this? Why? Click each of the three buttons and try it again. What was different? What happens with “rotate 180 degrees?” TIMING: 4 mins (total 8Mins) ACTUAL: 4 min (10 total), Today, let’s do a deeper dive into the Pen block set. Who can tell me what these do: - Pen Up - Pen Down - Clear - Set Pen Color? - Set Pen Shade - Stamp Who can tell me what the following block does?

Did any of you get this? Why? Lab Exercise 2: Recap Did any of you get this? Why? TIMING: 4 mins (total 8Mins) ACTUAL: 4 min (10 total), Today, let’s do a deeper dive into the Pen block set. Who can tell me what these do: - Pen Up - Pen Down - Clear - Set Pen Color? - Set Pen Shade - Stamp Who can tell me what the following block does? can rotate only face left/right can’t rotate

What worked? What was difficult? Lab Exercise 2 Recap: Discussion What worked? What was difficult?

Exploring More Blocks: Variables What is a GLOBAL VARIABLE? When would you use a GLOBAL variable instead of a SCRIPT variable?

Exploring More Blocks: Broadcast What does this do? It puts the scripted value into “message”

Exploring More Blocks: Ask and Answer What does this do? It puts the value typed by the keyboard into “answer”

Question? What are the differences between When would you use each?

Example of all 3 at once

Lab Exercise 3: Variables There is a problem with this script. Can you find it? Write your own script that fixes it.

What worked? What was difficult? Lab Exercise 3 Recap: Discussion What worked? What was difficult?

Exploring More Blocks: Sensing

Exploring More Blocks: Control These CONTROL blocks control the operation of the SCRIPT. (As opposed to SENSING blocks that control the SPRITE.) What do they do?

Exploring More Blocks: Operators What is a BOOLEAN OPERATOR? How do these work? Conditions that when evaluated result in the answer of “true” or “false.”

Exploring More Blocks: Boolean Operators If BOTH Condition “A” and Condition “B” are true, then TRUE If EITHER Condition “A” or Condition “B” is true, then TRUE If NOT Condition “A” then TRUE When you NEST boolean operators, solve inside out

AND (both have to be true) Battery Switch A Switch B Switch A closed Switch B closed? Lightbulb ON No Yes YES!

OR (either one has to be true) Battery Switch A Switch B Switch A closed Switch B closed? Lightbulb ON No Yes YES!

OR (either one has to be true) Battery Switch A Switch B Switch A closed Switch B closed? Lightbulb ON NOT Switch B closed? (Switch B NOT closed) Lightbulb On? No Yes YES! Yes No YES! No

Lab Exercise 4: If/Else & Boolean Start with your Lab 3 script. Add a variable that counts the number of times your Sprite has hit an edge. Call it “# WALL HITS.” If the Sprite hits the wall AND the # wall hits is less than 3, change directions and keep going. If the Sprite hits the wall, and the # wall hits is 3 or more, then say Game Over and stop.

What worked? What was difficult? Lab Exercise 4 Recap: Discussion What worked? What was difficult?

Review: Today Reviewing the SNAP! IDE Costumes More Blocks Stage, Palette, Blocks, Scripting area, Toolbar Costumes Import, Draw, Rotation More Blocks Control: forever, repeat, if, if/else, wait Sensing: ask/answer; broadcast/message Variable: global, script Operators: and, or, not

Reminders Read Chapter 2 before the start of class on Wednesday, September 2nd Quiz – Sept 6nd Test on Friday, Sept9 on computer parts and SNAP!