Presentation is loading. Please wait.

Presentation is loading. Please wait.

ECS 9/7/17.

Similar presentations


Presentation on theme: "ECS 9/7/17."— Presentation transcript:

1 ECS 9/7/17

2 Agenda Review SNAP Questions Review Guided Questions for Chapter 1
Sound RIP Lab

3 Boolean Operations What is a BOOLEAN OPERATOR?
Conditions that when evaluated result in the answer of “true” or “false.” You can create IF / Then situations using Boolean conditions You can COMBINE operations, and the result still will be either True or False.

4 “Truth” Tables Battery A B Condition A False / No / 0 / Off True / Yes / 1 / On Condition X Condition Y Condition Z 1 Condition A Condition B False True # combinations == # rows == 2^# conditions (ex. 2^1 = ^2 = ^3 = 8)

5 How do you use truth tables?
Start from the Boolean expression and work backwards. Step 1. Start with a Truth Table for the # of conditions (variables) – this truth never changes. 1 variable  2^1 = 2 combinations 2 variables  2^2 = 4 combinations 3 variables  2^3 = 8 combinations 4 variables  2^4 = 16 combinations etc Step 2. Add a column on the right with the expression you are solving. Step 3. Solve the expression for each row in the table.

6 Test Review SNAP! SNAP! Terminology
Sprite, Script, Stage, Scripting Area, Blocks, Tabs Layers Costumes Custom Blocks Loops: If, Else, Repeat SNAP! Broadcast/Message Ask/Answer Variables System Global Local Debugging

7 The SNAP! Environment Blocks 1 Sprite 3 Comments 6 Stage 4 Script 5
2 3 4 5 6 Script 5 Script area 2

8 Test Review

9 Test Review

10 Test Review

11 Two “Looks” commands – goto front , go back N layers
Front, -2 layers Front, -1 layer Front layer With these 2 commands, you can control where the scenery resides.

12 Customizing a Costume

13 Review: Make Block or Right click on empty space in Script Area
this dialog box will appear. or Press “Make Block” button in Variables and this dialog box will appear.

14 “Loops”: If/Else/Repeat
Notice how the bottom is flat? This script ends here and does not move on. The contents inside will repeat until the condition is met. Repeat the # of times in the box. Then moves to the next block Executes if evaluation of Boolean expression is True. If not, it moves to the next block. Executes if evaluation of Boolean expression is True. If not, it executes the contents of “else”.

15 Test Review SNAP! SNAP! Terminology
Sprite, Script, Stage, Scripting Area, Blocks, Tabs Layers Costumes Custom Blocks Loops: If, Else, Repeat SNAP! Broadcast/Message Ask/Answer Variables System Global Local Debugging

16 Hardware and software Hardware: Software: CPU Hard Disk (Memory) RAM
Monitor Input/Output Software: Operating System Applications

17 Review: SNAP! Broadcast
What does this do? It puts the scripted value into “message” system variable

18 Review: SNAP! Ask and Answer
What does this do? It puts the value typed by the keyboard into “answer” system variable

19 Exploring SNAP!’s Variables
GLOBAL VARIABLES are shared among all scripts and sprites SPRITE LOCAL variables are only valid in scripts attached to the variable’s sprite.

20 Exploring SNAP!’s Variables
SCRIPT LOCAL variables are only valid in the script where they are created

21 Exploring SNAP!’s Variables
A variable defined by the system (SNAP!)

22 Variables Debugging SYSTEM, SPRITE LOCAL, and GLOBAL variables all have a checkbox next to them to show the current value on the stage.

23 Debugging A methodical process of finding and reducing the number of defects (bugs) in a computer program, making it behave as expected. 

24 Exercise 1: Mary had a Little Lamb
TIMING 4 MINUTES (39 TOTAL) ACTUAL – ran out of time Now let’s take what we’ve learned and apply it to making a song Here’s an example with the start of Mary had A Little Lamb How can you execute a single program element? (double click) Individual notes can be played by double clicking on them. How can you execute a set of elements? You can tell what will execute together by them sticking together What white bar to know where you are inserting pull the bottom off to differentiate from ‘move’ You can predict what will fit where by shape. How do you delete an element? How do you reorder elements Notice the “Stop Script” block at the end. It’s always good programming practice to always have a “stop script” block and the end of any script so that you clearly indicate it’s the end. In BYOB, you don’t necessarily need to have it there, but if you learn other language it will be very important to always make sure you clearly indicate the end of scripts

25 Exercise 1: Advanced Mary
Make your own music Choose your Sprite or make your own Choose your instrument Play “Mary had a little lamb” or create your own song Want to do more? Move your Sprite to the approximate note positions Draw the bars on the Stage TIMING 5 MINUTES (44 TOTAL) ACTUAL – ran out of time

26 To import sound Drag mp3 file to sound tab


Download ppt "ECS 9/7/17."

Similar presentations


Ads by Google