Unit II: Scratch Programming

CS 1150 Programming Environments for Elementary Education—Spring 2016

Day 4: Scratch intro

Logistics

Where are We?

We're starting to work on the first Scratch assignment. Let's check on how you're doing. Any questions or wonderings? Are you ready?   Are you working alone or with a partner?   Have you picked a story?   Any questions about the Scratch environment?   Any questions about the Scratch Language?   Anything else?

Starting a New Program in Scratch

I want to briefly discuss some code that we/I recommend be in every one of your programs (even if it is not in all of mine :-)  This idea is discussed in the coding suggestions document that we are building.

Your Next Task/Program

Do you have a questions about the program task?   Do you feel you understand the expectations?

Next Time:

Day 5: Story Experiences; Initials

Logistics

Today we will be sharing our experience with the Scratch story telling. Any general discussing/sharing before we start on topics I had in mind?

Anything you like to see added to our coding suggestions/templates? Any questions/comments/wonderings?

Next: Initials

Next we are going to draw our initials. The task will be to draw one's initials. I have an old program that draws my initials. We'll look at it and the you can think about what you might do to draw your initials and how you can improve on what I did. Let's look at my program (via sharing/shared_material.html).

How to do initials

Logo was the first programming language that included drawing commands (that I'm aware of). It was used with children and they were told to pretend they were the computer when trying to figure out how to get the computer to do what you needed. You might keep that in mind? So, what would the computer need to do to draw you initials?

Let's look at the task/assignment description and see what you might have questions about at this time. (Be sure to look at the specifications. Note that some are required and some not.)

Next Time

Questions? Comments? Wonderings?   —   See you Thursday.

Day 6: Work on Initials Task

Logistics

Class Time for Programming

Any questions, comments, or wonderings before we start? . . . Okay, work, work, work!

Next Time

Questions? Comments? Wonderings?   —   See you Tuesday.

Day 7: Initials program discussion; Next task (initials 2)

Logistics

Today we will be sharing our experience with the simple initials program. Any general discussing/sharing before we start on topics I had in mind?

Anything you'd like to see added to our coding suggestions/templates? Any questions/comments/wonderings?

Here is a list of some of the things I think you should be able to use relatively fluently by now.

Next: Initials2

Hopefully, you've seen (and read) the next programming task. Do you have any questions or wonderings?

letter sizing demo

When drawing your initials you might have been able to do your planning while you were coding. Certainly you could probably have completed the activity with guess-and-check programming. It is likely you cannot do that on this assignment. >Additionally, while some math concepts were used in the previous programming task, I suspect the level of math used will/can substantially increase in this assignment. I suggest we start off by doing some thinking about letters and how they are drawn.

Note the figure at the right. It shows all the capital letters in a particular font. Showing the same character side-by-side also shows how much space is often placed between certain letters. Some have essentially no space around them, while others have a little. The numbers beside the letters are my guess as to a relative width for the letters. I used the 1 as the base width for the most commonly occurring width and eye-balled values for the other widths. Your eye might suggest something different. I just realized I screwed up on the "J". It's width is probably 0.4 rather than 1. Sorry.

You may or may not wish to take the width values into consideration as you draw your initials in the next program. There are, however, two values you will likely want to take into consideration.

If you were also using lower case letters, you would also want to consider the "height" of the descenders (e.g., on g, j, p, q). I suspect the value there is a bit less than 0.5

Parameters for Initial Drawing

The programming task description suggests at least one of three (sets of) parameters be used: size, position, or orientation? Do you have any questions or wonderings about them?

You may also have a question about how you incorporate parameters into your drawing. It is fairly straightforward. When you create a block, you give the block a name, then click on the options and you can add as many parameters as you wish. Note that you can also edit the definition of a block (right click on the block in the toolbox and select edit. You can then add more parameters or delete existing ones.

Example Planning

If you wish, we can do an example planning for a letter. Anyone want to work through theirs?

Next Time

Questions? Comments? Wonderings?   —   See you Thursday.

Day 8: Work on Initials #2 Task

Logistics

Class Time for Programming

Any questions, comments, or wonderings before we start? . . . Okay, work, work, work!

Next Time

Questions? Comments? Wonderings?   —   See you Tuesday.

Day 9: Initials 2 sharing; Regular Polygons

Logistics

Initials 2 Sharing

Any general discussing/sharing before we start on topics I had in mind?

Drawing (regular) Polygons

Today we will examine using turtle graphics blocks to draw polygons, actually regular polygons. What is a "regular" polygon? How do you draw one (with Scratch)? Let's try that out. What regular polygon shall we draw?

Polygon Demonstration

A "Flower" (or tree)

Now we'll try to do something with the polygons. We'll do a flower (sort of). Remember spirographs? How might you do that with Scratch?

Demo drawing a flower (or tree)

What would a flower look like? [A long green stem, perhaps bigger at the ground. Some colored (or multicolored) flower. Perhaps some green leaves.] Can you do that in scratch? How?

Perhaps as follows.

Now draw two flowers, different sizes with some space between them. Then add a sidewalk (series of squares) between them.

What will you draw?

What can you think of to draw with polygons? I think of a house — building, roof, windows (with panes). Might have to do a rectangle for the door.

Go draw something (see the Scratch IV learning activity.

Next Time

Day 10: Work on Scratch IV Task (drawing with regular polygons)

Logistics

Class Time for Programming

Any questions, comments, or wonderings before we start? . . . Okay, work, work, work!

Next Time

Questions? Comments? Wonderings?   —   See you Tuesday.

Day 11: Drawing with polygons sharing; User input & if

Logistics

Before we start, I want to show off again. Hopefully you will find this useful or interesting. The sharing folder has a program titled recursiveTree.sb2, let's look at it. Not that uses recursion, i.e., a new block (instruction/function) produces its result by calling itself. If you play with it be sure to keep the if >depth > 0< block and to not use depth more than about 10 or so. Comments/wonderings?

Scratch IV Sharing

Any general discussing/sharing before we start on topics I had in mind?

User Input & Conditional Execution

Your next task will be to plan and implement a Scratch program that involves getting and using user input in a way that involves conditional execution (using one of the if blocks. Any wonderings before we start?

A Demonstration

We are going to look at an unfinished program. It should be in the sharing directory. It is called Stories_variables.sb2. Elements of that program that I want to point out (after running it) are:

Next Time

Day 12: Pause for checkup;   User input & if

Logistics

Today was supposed to be a workday for Scratch IV task?. But, ... when looking at the Scratch-III TARRs I saw that several of you were having difficulty. So, ... Are you? Is there anything you'd like to discuss about Scratch or the second initials problem or ...

Next Time

Day 13: Work on Scratch V Task (input & if)

Logistics

Class Time for Programming

Any questions, comments, or wonderings before we start? . . . Okay, work, work, work!

Next Time

Questions? Comments? Wonderings?   —   See you Tuesday.

Day 14: Sharing Scratch V (user input & if) experience;   Introduce lists

Logistics

Scratch V Sharing

Any general discussing/sharing before we start on topics I had in mind?

Lists

Your next task will be to plan and implement a Scratch program that involves lists. A list is a collection of data all in one variable. Some examples are lists of:

Creating (& populating) your list(s)

You create a list like you create a variable. As with "simple" variables, when you create the list you get a bunch of blocks that allow you to use the list and do things to it (add an item, delete an item, etc.) You should look them over carefully and decide what you might be able to accomplish with them or use them for. Some particular hints about using lists are:

Demonstrate creating a list and uploading a file to it. (trivia questions)

Parallel lists

Often you will want parallel lists. Parallel lists contain related data, e.g., a list of names and a list of addresses, a list of states and a list of capitals, a list of trivia questions and a list of multiple choice items and a list of answers.

Demonstrate creating a second, parallel list and uploading a file to it. (trivia choices)

The lists we have here are parallel in that question 1 (item 1) is related to items 1-4 in the choices list; question 2 is related to items 5-8 in choices; 3: 9-12; 4 13-16; etc. We can figure out the mathematical relationship between them and use variables and operators to access the questions and the choices.

We have to be careful to access our lists in a parallel manner.

Random selection (in parallel lists)

discuss how it can be done

Next Time

Day 15: Work on Scratch VI Task (lists)

Logistics

Class Time for Programming

Any questions, comments, or wonderings before we start? . . . Okay, work, work, work!

Next Time

Questions? Comments? Wonderings?   —   See you Tuesday.

Day 16: Sharing Scratch VI (user input & if) experience;   Discuss Scratch VII issues

Logistics

Task VI (lists)

After a while you should have some time to work on scratch task VI (lists) if you are not done. Before that I want to show you some stuff about animation (the next task). And before that (i.e., right now) I want to address any difficulties or wonderings you might you might have with scratch task VI. So, ... Do you have any difficulties or wonderings?

Animation

Your next task will be to plan and implement a Scratch program that involves more advanced uses of animation. What Scratch blocks/instructions/capabilities can you think of to cause animation?

Some I have thought of are:

Continuous motion

Our next task asks you to have a sprite in continuous motion that also, when the user indicates, does some additional or motion. Do you have any ideas of what that might be?

Some I have thought of are:

So, ... How can we do continuous animation?

Some ways I have thought of are:

Next Time

Day 17: Share Scratch VI (lists) experience;   Work on Scratch VII

Logistics

Scratch VI Sharing

Any general discussing/sharing before we start on topics I had in mind?

Scratch VII (more advanced animation)

This last learning task (there will be a project, you'll probably choose Scratch to do it in) deals with animation. Hopefully you've identified something interesting to work on. I want to provide a chance for questions, then you'll have time to work.

Next Time

Questions? Comments? Wonderings?   —   See you Thursday.

Day 18: Share Scratch VII (animation) experience;   Project discussion; Introduce NetLogo

Logistics

Scratch VII (more advanced animation) Sharing

Any general discussing/sharing before we start on topics I had in mind?

Project Discussion

I think we are pretty close to done with Scratch other than doing a project. Your project could be done in Scratch (or in NetLogo if you get excited about that). It will be due the last week of classes. Let's look it over and see if there are any questions (or communication issues). It is located at http://www.cs.uni.edu/~east/teaching/peee/current/project.html".

NetLogo Introduction

See the discussion in the next set of notes.

Next Time

Questions? Comments? Wonderings?   —   See you Thursday.