Schedule: CSC 112-001
Introduction to Computer Programming: Squeak Etoys

Introduction

This is a tentative schedule for the course and is likely to change without notice elsewhere. In addition, homework assignment details and links to your colleagues’ submissions may be posted for peer review, so please refer to the schedule frequently for assignment specifics, due dates, and comparative results.

 

Week of

Topic(s) and key dates

Activities and Projects

21 Aug

First class meeting 22 Aug

Introduction to Etoys

  • Creating a project
  • Resource bar
  • Painting tools
  • Programming with tiles
  • Using halo handles and the object viewer, delete, menu, rotator
  • Running, loading, publishing, and exiting a project
  • Examples:
    • Driving
    • Creating a steering wheel
    • Using a joystick
    • Dominoes
  • Getting the software

 

Download and install the USeIT Etoys package

Etoys\ObjectsOnTheFly.002.pr

Etoys\Disease Propagation.002.pr

Etoys/orbits.001.pr

26 Aug

Implementing objects and their behaviors

Object viewer panels for:

1.     basic properties,

·        x and y coordinates

·        heading

·        color

·        watching the value

·        assigning a value

2.     variables,

3.     motion,

4.     tests,

5.      pen use,

·        pen down

·        clear all pen trails

·        pen color, size, and style

  1. geometry,
  2. scripts,

·        creating one

·        firing

·        running

·        producing a button to fire

  1. scripting,
  2. sound,
  3. observation
  4. Watchers, data types, number precision

Example(s)

·       Creating an strip chart or medical monitor simulation

·        Animation using a Holder

Demonstrations of P1-P3 are due in class, 12 Sep

Problem 1 (P1):

Begin creating an analog clock. Produce a clock face. Create a second hand and place its center of rotation properly on the clock face. Cause the second hand to rotate once every minute around its center of rotation, advancing one step each second.

 

Refinements for PP1:

1.     Add a minute hand that advances to the next minute after every 60 seconds elapse.

  1. Add an hour hand that advances appropriately each time the second hand advances.

 

P2:

Create an Etoys version of the “Etch-a-Sketch” toy. The Etoys project should have:

1.     A drawing area (consider using a Playfield).

  1. Controls to:
    1. Raise the pen;

2.      Lower the pen;

3.      Erase the drawing; and

    1. Move the pen left, right, up or down.

 

Refinements for P2:

1.     Use an Etoys Joystick to control the pen motion.

  1. Use keyboard input to control the pen motion.
  2. Incorporate a second pen that tracks near the first.
  3. Enable the user to select the pen color.

 

P3:

Create a plotter and experiment by plotting several functions. For example, you might use your plotter to create a cell phone plan advisor given:

1.     Plan A has a base charge of $13.00 plus $0.45/ minute

2.      Plan B has a base charge of $28.00 plus $0.13/ minute

3.      Plan C has a base charge of $49.00 plus $0.035/ minute

Based on your usage patterns, which plan would you prefer?

2 Sep (Labor Day—no classes)

Exploring the Viewer (continued)

·       Pen trail options (dots, arrows, etc.)

·       Generating random values and calculating values of mathematical functions

 

Example(s)

·       Cell phone plan advisor (cell phone plan advisor project link)

·        Race of the ellipses (race of ellipses project link)

P4: Create and move one object whose motion is affected in an interesting way by another object.

Minimal Requirements:

1.     The moving object must be constructed using the Etoys paint tool (and any other useful objects from the object catalog).

2.     The motion of the object must be influenced by at least one object other than itself and its container (it is not enough to simply let an ellipse bounce off the walls of its container).

3.     Objects that influence the motion of the required moving object:

a.      may or may not move on their own

b.     can be control objects such as a joystick

4.     Peer review will determine whether the “interesting” criterion is met

5.      Other details or refinements to these may follow after class discussion

P4 demonstration due in class 20 September

9 Sep

Tests and repetitions

·       Using keyboard input (using keyboard input)

·       Nested testing

·       Clearing a variable before reuse

·       Setting a value for a variable versus incrementing/decrementing the value

  • Creating user defined variables

·        When?

·        Why?

·        How?

 

16 Sep

Examples

  • A bouncing ball project link
  • Tracking a mid-point project link (a simplified version of the SDIO, WTA problem)
    1. Create two randomly moving objects
    2. Use sliders to adjust the step size and turn angle of the moving objects
    3. Use Watchers to report the step size and turn angle ranges (use the “simple watcher” item on the Viewer menu)
    4. Employ text fields to label the sliders
    5. Determine the mid-point of the line segment that would join the two objects and script a third object so that it tracks the mid-point as the other two objects move
    6. Create scripts and buttons to start, and pause the simulation
    7. Create a Flap (remember to use the key sequence <shift><alt>w” to get the menu) and use a Scrolling Text Box (found in the Object Catalog) to document your project.
    8. Can you extend your project to track the center of the triangle determined by three randomly moving objects?
    9. Extend your simulation in order to demonstrate how the variability of the motion of the center of the triangles compares to that of the mid-point of the line segments.

P5: Use a Holder, the objects it contains, and its cursor to animate an action (sample project animating a mouse) such as:

  • A behavior of an animal other than a mouse foraging
  • An athlete in a competition
  • A flower bud opening
  • Lunar phases
  • A tree growing
  • A flag in the breeze

23 Sep

User defined variables (continued)

Develop a project using a slider as a gauge

·       Create an object whose motion is stopped when a “fuel” reserve is depleted.

  • Use a slider to display or control the fuel status
    • Use the slider’s maxval to set the fuel limit.

o   Use the slider’s numericalvalue to control the slider display setting and display fuel level.

    • Create a script to change the color of the slider to indicate three levels: ½ to full (green); ¼ to ½ (yellow); under ¼ full (red).
  • Create scripts to:
    • Start the object moving

o   Stop the object when fuel is consumed

    • Reset the simulation to a starting state
  • Extensions
    • Create a second container with objects and controls that function the same as the first (Hint: Put objects inside the Playfield and use the duplicate halo handle.)

o   Add a mpg factor to the move script to enable comparison of the effects of varying fuel efficiency on consecutive trials of the simulation

    • Duplicate the slider, object and controls to enable side-by-side comparison

P5: Demonstration due 24 Sep

30 Sep

Adding players via siblings or duplicates

Siblings and duplicates

·       Sharing code among objects

·       Data sharing among objects

·       Creating a copy by indirect reference

 

Test 1, 4 Oct 2013

P6: Ten-ellipse race

The project must:

  • Employ multiple siblings and allow the number of siblings to be altered
  • Start all racers concurrently along a starting line in different lanes (at least randomly distributed lanes)
  • Maintain and display the finish position (1st, 2nd, 3rd, …) for each racer. This value may be zero while the racer is racing.
  • Advance racers in randomly selected steps
  • Maintain and display a designation for the leader
  • Assign colors randomly to all racers and then display a flag with the winner’s color at the end of the race

7 Oct

 

Fall Break 10-11 Oct

Example

  • Disease propagation

P7: Trends and variations: Find and track the location of the mean position of a collection of randomly moving objects (possibly ellipses). You may mark the average (mean) location with another object. The averaging scripts must allow for siblings of the original objects to be added or deleted without disturbing the computations that locate the average location.

P5 requirements:

1.     A collection of siblings must move randomly in a Playfield.

2.     The variability of motion of the siblings must be subject to change in response to altering the setting of a slider.

3.     Create scripts to start, pause, and reset the motion of the objects in the Playfield.

4.     Introduce another object, an average location marker, possibly a star or a rectangle, set the marker’s dimensions and color to your convenience, and use the marker to track the average position of the other objects in the Playfield.

5.     Create a user-defined variables to store:

    1. the sum of the x values (sumX) of the siblings;
    2. the sum of the y values (sumY) of the siblings;
    3. the average of the x values (avgX) of the siblings;
    4. the average of the y values (avgY) of the siblings.

6.     Create a script to calculate sumX, sumY, avgX, and avgY.

7.     Create a script that places the marker at the average location.

8.     Create scripts to raise, lower, and clear pen trails for the marker.

9.     Use your model to explore how the movement of the average position is affected by:

    1. Greater or lesser variability of the siblings’ motion
    2. The total number of siblings
    3. The size of the Playfield

14 Oct

Simulating gravity

 

Work on your final modeling challenges P7, P8, and P9/10.

P6: Demonstration due 16 Oct

P7: Demonstration due 30 Oct

P8: Demonstration due 15 Nov

P8: Model influences of gravity (balance beam, load on two piers, buoyancy: hot air balloon or an object floating in a liquid)

This project demonstration must employ:

·       Appropriate user-defined variables such as gravity, density, or specific gravity;

·       Controls such as sliders to support experimentation by enabling a project user to vary simulation parameters;

·       Controls to start, stop, and reset the simulation

·        Watchers to observe values of salient parameters

21 Oct

Obtaining features of a group:

  • Nominal characteristics: use knowledge gained from the disease propagation model (project link) and classroom instruction to create an average tracker
  • Variability in the group

 

Discuss gravity simulation alternatives:

1.        Balance beam should:

·       Rotate/pivot about a center

·       Have simulated “weights” on either end whose areas or masses may change by adjusting sliders

·       Calculate total “mass” proportional to area

·       Rotate about the pivot point in the correct direction for the masses

2.        Load on piers simulation should:

·       Have at least two piers and a span between them (no overhang or cantilevering is required but it would make a nice extension)

·       Allow a simulated mass to be moved across the span

·       Calculate the simulated loads on the ends of the span (the total load should be on one of the piers when the mass is directly above it and then the load should decrease on it and increase on the other as the mass moves across the span)

3.        Buoyancy simulation:

·       Simulate two materials: one a solid object (possibly a rectangle) and the other a fluid.

·       Both the object and the fluid with simulated variable specific gravity

·       The object should be suspended, or not, according to the amount (simulated mass) of the fluid  it displaces

28 Oct

Test 2, 1 November 2013

P7: Demonstration due 30 October

 

4 Nov

Using a Collection to model schooling or herding

Supervised lab work

11 Nov

Using a Collection (continued)

P8: Demonstration due 18 Nov

P9-10: Student designed project (Flocking is one possibility)

The student project must:

·       Model the behavior of some process of interest

  • Enable the user to visualize and explore the effects upon the behavior of combinations of parameter settings
  • Use all of the following Etoys features to create and operate the model:
    1. Etoys and user-created objects

2.     User-defined variables as well as Etoys variables

3.     Computation that automates a simulated behavior

4.     Captions and watchers for parameters and controls

5.     Siblings

    1. At least one collection and its properties
  • Contain a flap that describes the project in detail including:
    1. Project title, date, and authorship

2.     A brief statement of purpose

3.     A complete description of the modeled process and its various parameters and objects

4.     Statement of known relationships among interacting objects

    1. Instructions for using the model including possible questions for exploration

Extensions for the model (for examples, this section could include additional behaviors to model, refinements planned for existing behaviors, new interactions among objects, additional object types)

18 Nov

Final project work and demonstrations

Project demonstrations will begin Wednesday, 20 November and continue through Wednesday, 4 December, as needed.

 

Possible probe demonstration: Programming with real time data

25 Nov

Final project work and demonstrations

Thanksgiving Break 27-29 November

The Monday class meeting will be an in-class, lab day for work on your final projects (P9/P10).

2 Dec

Final project work and demonstrations

Last class meetings

Project demonstrations (2, 4 Dec) and SPOTs (4 Dec)

Wednesday, 4 Dec

Last day of classes for the semester

Possible practice projects:

1.     Two pool balls and a cue stick; then extend to a full set

2.     A carom board game

3.     Pinball machine

4.      Single shooter game

5.      Finding extreme values

5 Dec

Reading Day

Wednesday, 11 Dec

Final Exam in class/lab

11:30 AM - 2:30 PM