How to Design Worlds

Similar documents
~~~***~~~ A Book For Young Programmers On Scratch. ~~~***~~~

Finch Robot: snap level 4

Scratch Lesson Plan. Part One: Structure. Part Two: Movement

Sketch Out the Design

An Esterel Virtual Machine (EVM) Aruchunan Vaseekaran

Step by step lead work training

Workbook. Version 3. Created by G. Mullin and D. Carty

MIND TO MIND the Art and Science of Training

Catapult Activity. Catapult Buy From Art.com

Point of Care Diagnostics: the Client vs. Veterinary Perspective Andrew J Rosenfeld, DVM ABVP

Retold by Sue Arengo Illustrated by Kate Aldous OXFORD

Finch Robot: snap levels 1-3

Flea Jump page 1.01 RR Lew

Scratch Programming Lesson One: Create an Scratch Animation

Walking Your Dog on a Loose Leash

288 Seymour River Place North Vancouver, BC V7H 1W6

How can a guide dog change a life?

Using Physics for Motion Retargeting

5 State of the Turtles

Homeostasis and Behavior

Modeling and Control of Trawl Systems

The City School. Learn Create Program

Is my puppy all of a sudden being aggressive??

ANIMAL WORLD. Teacher's Notes

FPGA-based Emotional Behavior Design for Pet Robot

2. FINISH - Indicates the end of the course - timing stops. 1. START - Indicates the beginning of the course.

KOOTENAI / SHOSHONE 4-H DOG PROGRAM AGILITY TRAINING RESOURCE GUIDE & EXHIBITION RULES

Recall: The Earliest Thoughts about Flying Took place before the days of science.

RALLY-O Sign Commands

Step by step recall training

Scratch. Copyright. All rights reserved.

It Is Raining Cats. Margaret Kwok St #: Biology 438

Obedience Guidelines

Our K9 LLC 616 Corporate Way Valley Cottage New York GARNET STATIC SHOCK BARK COLLAR USERS GUIDE

CS108L Computer Science for All Module 7: Algorithms

TEETH WHITENING June 26,

Training with the Electronic Collar - "Electronic Check Cording"

Radio-Controlled Millenium Falcon

Puppy Agility Games, Part 1 By Anne Stocum, photos by Dianne Spring

Texel Sheep Society. Basco Interface Guide. Contents

THINKING ABOUT THE E-COLLAR A Discussion with Maurice Lindley By Martha H. Greenlee

AKC Novice Obedience Articles

THE EFFECT OF DISTRACTERS ON STUDENT PERFORMANCE ON THE FORCE CONCEPT INVENTORY

RALLY SIGNS AND DESCRIPTIONS. The principal parts of the exercises are boldface and underlined.

C-Wags Rally. ss # Canine-Work And Games LLC - 2 -

THE WINDSOCK S P O O K Y

Be Doggone Smart at Work

Mechanics 2. Impulse and Momentum MEI, 17/06/05 1/10. Chapter Assessment

GARNET STATIC SHOCK BARK COLLAR

Subscribe Share Past Issues Translate RSS

R U S T Y D O G N I T I O N R E P O R T - A P R I L 1 2,

Lab 7. Evolution Lab. Name: General Introduction:

By Aliki Text Type: Fiction: Narrative Wordless Picture Book

Coding with Scratch Popping balloons

Written by Deb Colgan of Riley s Place published on October 24, 2008

GARNET STATIC SHOCK BARK COLLAR

1.1 Brutus Bites Back A Develop Understanding Task

Biol 160: Lab 7. Modeling Evolution

IX. Who Owns the Zebra?

Entertainment Robot aibo Announced

KENNEL UNION OF SOUTHERN AFRICA. BASIC WORKING/BEHAVIOUR TEST (BH) (Begleithund) EFFECTIVE

PET CARE AGREEMENT FOR DOG WALKING/IN-HOME PET VISITS. Client Name: Address: City, State, Zip: Out of town phone number (if applicable):

Comparative Physiology 2007 Second Midterm Exam. 1) 8 pts. 2) 14 pts. 3) 12 pts. 4) 17 pts. 5) 10 pts. 6) 8 pts. 7) 12 pts. 8) 10 pts. 9) 9 pts.

B U S T E R D O G N I T I O N R E P O R T - A P R I L 1 2,

Lab 10: Color Sort Turtles not yet sorted by color

Teaching Assessment Lessons

Koko's Kitten (Reading Rainbow Books) Download Free (EPUB, PDF)

RALLY SIGNS Descriptions and Symbols for Rally Signs Exercises that may be used in Novice, Advanced and Excellent Classes

Transition to Cold Blinds

No. She does have some stiffness in her left shoulder when she lays for long periods of time. A

AMPS Volunteer Manual

PYTHON FOR KIDS A Pl ayfu l I ntrodu ctio n to Prog r am m i ng J a s o n R. B r i g g s

Rally Signs & Descriptions

We recommend you cite the published version. The publisher s URL is

Half-Lives of Antibiotics

Hello Scratch! by Gabriel Ford, Sadie Ford, and Melissa Ford. Sample Chapter 3. Copyright 2018 Manning Publications

March 22, Thomas Kroll, Park Manager and Arboretum Director Saint John s University New Science Center 108 Collegeville, MN

Reference Guide Playful Invention Company

At the proper age they must be spayed or neutered. Discuss with WagsInn

Pet Information Form. Owner Mobile.* Owner * Owner 2 Home Phone Work Phone. Owner 2 Name First..* Last * Title..*

BOARD OF SUPERVISORS BUSINESS MEETING ACTION ITEM

Puppy Agility Games, Part 2 By Anne Stocum, photos by Dianne Spring

CAVALIER KING CHARLES SPANIEL CLUB, U.S.A., INC. APPLICATION FOR PERFORMANCE JUDGE PROGRAM

Virtual Lab: Sex-Linked Traits Worksheet. 1. Please make sure you have read through all of the information in the

extroversion: (med.) a turning inside out, as of an organ In Extroversion, Susanne Themlitz's current exhibition, the artist shows recent works at Ver

Nova Scotia Service Dog Assessment

Judging Beef. Parts of the Beef Animal. The objective of this unit is to:

Probe-Tip Clean On Demand

UC Davis/BARTA, California, October 2017 BARTA Vets in the Community. Promote Safer Rescue, Improve Welfare and Protect Livelihoods

MY STORY: THE GREAT PLAGUE: A LONDON GIRL'S DIARY, BY PAMELA OLDFIELD

Massachusetts State Search & Rescue Dog Federation Basic Human Remains Detection Canine Evaluation Form

Sponsored by: First Steps Toward a Cat Friendly Practice

Getting Started with Java Using Alice. 1 Copyright 2013, Oracle and/or its affiliates. All rights reserved.

Temperature Gradient in the Egg-Laying Activities of the Queen Bee

Interrater Reliability: Justifications for Ratings

Vibrating Balls Of Bees

Welcome to my e-book How I Feed My Cat Sophie

Proposed New Brighton Park Shoreline Habitat Restoration Project

You can reset your Hatchimal to Baby any time after hatching by pressing the small reset button on the bottom of your Hatchimal with a paperclip.

Handler Interaction. Motivation Dos and Don ts

Transcription:

How to Design Worlds CS 5010 Program Design Paradigms Bootcamp Lesson 3.2 Mitchell Wand, 2012-2014 This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License. 1

Introduction In this lesson, we will show to how to decide whether information should be represented as part of the world state, or whether it should be kept as a constant in the program By the end of this lesson, you should be able to analyze information to determine whether it should be constant or part of the world state. 2

Review: the 2htdp/universe module Provides a way of creating and running an interactive machine. Machine will have some state. Machine can respond to inputs. Response to input is described as a function. Machine can show its state as a scene. We will use this to create interactive animations. 3

What's in the state? The state consists of the information that changes in response to a stimulus. Other things are constants. 4

Traffic Light Example Number of ticks until next change: this changes on every tick. So: this goes in the state Current Color changes when countdown timer runs out So: this goes in the state How often each color lasts before changing doesn t change So: this will be a constant, not part of the state 5

Information Analysis for falling-cat dimensions of canvas x pos of cat y pos of cat current speed of cat image/size of cat acceleration of gravity g which of these belong in the world? which should be constants? which need not be represented? 6

Information Analysis for falling-cat dimensions of canvas x pos of cat y pos of cat current speed of cat image/size of cat acceleration of gravity g These vary from frame to frame in the animation, so they are part of the animation's state (the world) 7

Information Analysis for falling-cat dimensions of canvas x pos of cat y pos of cat current speed of cat image/size of cat acceleration of gravity g These do NOT vary from frame to frame in the animation, so they are NOT part of the animation's state (the world). We will represent them as constants in our program This is not used in our program, so we don't need to represent it at all 8

The information analysis depends on the application The choice of information to represent depends on what our application does. Here are four variations of falling-cat: falling-cat-0: like falling-cat, but doesn't respond to space key falling-cat: our pausable falling cat draggable-cat: like falling-cat, but the cat can be dragged with the mouse model gravity: like falling-cat or draggable-cat, but the cat accelerates with simulated gravity. Let's see how the information analysis differs as we change the application. 9

Info analysis falling-cat-1 falling-cat-2 (pausable) either CATSPEED or 0; represented by paused? drag w/ mouse model gravity dimensions of canvas constant constant constant constant x pos of cat constant constant world world if draggable y pos of cat world world world world current speed of cat constant world world world image/size of cat constant constant constant constant acceleration not represented not represented not represented constant Fieldsneeded: y-pos y-pos, paused? x-pos,y-pos, paused? x-pos,y-pos, current-speed, paused? 10

Gravity and Speed When there is no gravity, the cat's speed is either 0 or CATSPEED, so we can represent this with one bit (paused?). When there is gravity, the cat accelerates, so we need to keep track of its current speed. When the cat resumes motion, it should resume its previous speed. So we need to keep track of both its paused? state and its previous velocity. The problem should specify what happens when the cat resumes falling. Here we've assumed that the cat resumes falling at the same speed it was moving when it paused. If we specified that the cat starts falling again with speed 0, how would that change the representation? 11

Recipe for Designing a World Here are the steps in designing a world. These are the same steps we followed in falling-cat. How to Design Universe Programs 1. Information Analysis What events should the world respond to? What information changes in response to an event? What information doesn't change in response to an event? 2. From your information analysis, write out the constant definitions and data definitions. 3. From your list of events, write a wishlistof functions to be designed 4. Design the functions on your wishlist(use the design recipe!) 12

Summary Information that can change after an event goes into the world state Info that doesn't change is represented by constants Manage your project with a wishlist Wishlistmust include contracts and purpose statements for each function 13

Next steps If you have questions about this lesson, post them on the Discussion Board Do the Guided Practice for this Lesson Go on to the next lesson. 14