Lab 5: Bumper Turtles

Similar documents
Lab 6: Energizer Turtles

Lab 7: Experimenting with Life and Death

CS108L Computer Science for All Module 7: Algorithms

Lab 10: Color Sort Turtles not yet sorted by color

GEOG 490/590 SPATIAL MODELING SPRING 2015 ASSIGNMENT 3: PATTERN-ORIENTED MODELING WITH AGENTS

COYOTES and FOXES. Final Report. - Chantilly Fulgham, - Gracie Sanchez,

Half-Lives of Antibiotics

5 State of the Turtles

StarLogo Complete Command List (Edited and reformatted by Nicholas Gessler, 6 June 2001.)

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

Reference Guide Playful Invention Company

In this project you will use loops to create a racing turtle game and draw a race track.

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

Sketch Out the Design

The City School. Learn Create Program

Jumpers Judges Guide

Grade: 8. Author: Hope Phillips

Virtual Dog Program in Scratch. By Phil code-it.co.uk

NATIONAL SPORT SCHOOL ST CLARE COLLEGE

Finch Robot: snap level 4

Chapter 16: Evolution Lizard Evolution Virtual Lab Honors Biology. Name: Block: Introduction

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

Fractal. Fractals. L- Systems 1/17/12

The Lost Treasures of Giza

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

Scratch Jigsaw Method Feelings and Variables

The Leader in Me Chari Distler

Life Under Your Feet: Field Research on Box Turtles

Econometric Analysis Dr. Sobel

Help the Scratch mascot avoid the space junk and return safely back to Earth! Start a new Scratch project. You can find the online Scratch editor at

Writing Simple Procedures Drawing a Pentagon Copying a Procedure Commanding PenUp and PenDown Drawing a Broken Line...

PNCC Dogs Online. Customer Transactions Manual

Biology Meets Math. Predator-Prey Relationships in Belowground Ecosystems. US Department of Homeland Security

PNCC Dogs Online. Customer Transactions Manual

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

b. vulnerablebreeds.csv Statistics on vulnerable breeds for the years 2003 through 2015 [1].

Q1. The photograph shows a bird called the korhaan. Korhaans live in South Africa.

Compliance Can Be Ruff A Dog s Approach

6.14(a) - How to Run CAT Reports Record Errors Report

USING FARMAX LITE. Upper navigation pane showing objects. Lower navigation pane showing tasks to be performed on objects

Mastitis Reports in Dairy Comp 305

Catapult Project (Quadratic Functions)

Lichens are indicators of the gas... (1) The chart shows how much pollution different lichens can tolerate.

Dear Judges Education Coordinator:

PIGEONETICS LAB PART 1

Level 1 Economics, 2012

Recursion with Turtles

Maze Game Maker Challenges. The Grid Coordinates

Webkinz Friend Requests

For ADAA users, you will see a page similar to the one shown below:

Good Health Records Setup Guide for DHI Plus Health Event Users

Who Wants to Live A Million Years? Objective: Students will learn about the process of natural selection through an online simulation.

HSU. Turning Point Cloud

Overview of Online Record Keeping

GCHS puppy needs heart surgery and your help

Comparing DNA Sequences to Understand Evolutionary Relationships with BLAST

Relationship Between Eye Color and Success in Anatomy. Sam Holladay IB Math Studies Mr. Saputo 4/3/15

Threatened & Endangered Species Tour Post Visit Activity Packet

FairEntry Glossary. FairEntry Setup

The trusted, student-friendly online reference tool. Name: Date: Cats

AP Lab Three: Comparing DNA Sequences to Understand Evolutionary Relationships with BLAST

Geometry from Scratch

I am a Veterinarian. Middle School Math Project

Coding with Scratch - First Steps

Cane toads and Australian snakes

Title: Sea Turtle Tracking

KB Record Errors Report

Walking Your Dog on a Loose Leash

Loose Leash Walking. Core Rules Applied:

DAYS TO CALVING IN HERDMASTER. Extracting BREEDPLAN Matings

Pennsylvania Premier Bred Heifer Program

STRATEGIES ACHIEVE READING SUCCESS

DISEASE MONITORING AND EXTENSION SYSTEM FOR THE SOUTH AFRICAN DAIRY INDUSTRY

PupDate. Lacey Rahmani UX

Name: Date: Algebra I - Unit 3, Lesson 4: Writing and Graphing Inequalities to Represent Constraints

Call of the Wild. Investigating Predator/Prey Relationships

The Agility Coach Notebooks

Dasher Web Service USER/DEVELOPER DOCUMENTATION June 2010 Version 1.1

Science Test Revision

Understanding the App. Instruction Manual

Turtle Ballet: Simulating Parallel Turtles in a Nonparallel LOGO Version. Erich Neuwirth

1 Turtle Graphics Concepts

Biology 164 Laboratory

Grade 4 Science Practice Test Answer Key

VIRTUAL AGILITY LEAGUE FREQUENTLY ASKED QUESTIONS

King Fahd University of Petroleum & Minerals College of Industrial Management

How Do Species Adapt to Different Environments?

Your web browser (Safari 7) is out of date. For more security, comfort and the best experience on this site: Update your browser Ignore

Energy Identification Codes FAQ

Lab Developed: 6/2007 Lab Revised: 2/2015. Crickthermometer

Fruit Fly Exercise 2 - Level 2

Grade 5 English Language Arts

Coding with Scratch Popping balloons

INFO 1103 Homework Project 2

Package TurtleGraphics

North Carolina Aquariums Education Section. You Make the Crawl. Created by the NC Aquarium at Fort Fisher Education Section

Muppet Genetics Lab. Due: Introduction

Scratch. To do this, you re going to need to have Scratch!

Dog Training Made Easy- A Step-by-Step Guide to Using the StarMark Clicker

Welcome to the case study for how I cured my dog s doorbell barking in just 21 days.

Transcription:

Lab 5: Bumper Turtles min-pxcor = -16, max-pxcor = 16, min-pycor = -16, max-pycor = 16 The Bumper Turtles model created in this lab requires the use of Boolean logic and conditional control flow. The basic rules are: 1) Each turtle starts in the middle of a patch. This could be any patch, but not part in one patch and part in another. 2) Each tick, each turtle looks ahead one patch in its current heading. a. If the patch ahead is black then the turtle makes a U-Turn. b. If the patch ahead is blue, then the turtle makes a 90 left turn. c. If the patch ahead is red, then the turtle makes a 90 right turn. d. If the patch ahead is beautiful green grass, then there are two cases to deal with: If there is another turtle in that patch, then the turtle makes a U-Turn, otherwise, the turtle runs one step forward in the turf. Note: the turtle should ONLY move when the patch ahead is green. This is because after the turtle turns, there might be another block in its new forward direction. -1 of 5-

Setup Button: Your program must have a setup button that when pressed must: 1) Clear the 2D world view. 2) Remove all the turtles (clear-all does both 1 and 2). 3) Set all patches to green. Then set specific, hardcoded patches to black, blue or red. You choose which specific patches to set black, blue or red such that the turtles you create in step (4) follow run around on a cool, creative, crisscrossing track. The screen capture on the first page shows an example of such a setup after the turtles have run around a bit. You may create more turtles and more interesting paths then that shown. Hint: Draw your pattern on graph paper before coding it. 4) Create at least 2 turtles each with a specific location and heading so that someplace along the path or that will enter the path created in step (3). The Netlogo command: Hint: Setting a Particular Patch to a Particular Color ask patch 2-4 set pcolor blue will set the color of the patch with coordinates (2, -4) Hint: Setting a Particular Turtle to a Location and Heading Each turtle in Netlogo has a unique identification number. The identification numbers always start with 0 and count up to one less than the total number of turtles. The NetLogo who command reports a turtle s identification number. These facts can be used to set properties of a particular turtle. For example: 1) create-turtles 2 2) 3) if (who = 0) 4) setxy -3 0 ;; Lines 4 & 5 only execute for the 5) set heading 180 ;; turtle with ID number = 0. 6) 7) if (who = 1) 8) setxy 4 0 ;; Lines 8 & 9 only execute for the 9) set heading 0 ;; turtle with ID number = 1. 10) 11) -2 of 5-

Hint: Getting the Color of the Patch Ahead See Bumper Turtles video for more details We have seen before that within a turtle context, pcolor is the color of the patch the turtle is on. In this lab, we need to look at the color of the patch one ahead of the current turtle location. This can be done with the patch-ahead function as shown below: ask turtles let colorofpatchahead green ask patch-ahead 1 ;;1 is the number of patches ahead to look set colorofpatchahead pcolor if (colorofpatchahead == blue) ;; In this code block, do what you want to happen when ;; the color or the patch ahead is blue. ;; also have an if statement for each of the other possible ;; colors -3 of 5-

Hint: Finding out Whether there is a Turtle Ahead See Bumper Turtles video for more details To detrmin whether there is another turtle on the patch ahead of the current turtle, we build a triple compound command :) Within a turtle context, patch-ahead 1, reports the patch that is one patch ahead of the turtle s current location. The Netlogo function, turtles-on patch, reports the set of all turtles that are on patch. The Netlogo function, any? agentset, reports true if agentset contains at least one agent. Otherwise, it reports false. Putting this all together, the statement: any? turtles-on patch-ahead 1 Reports true if and only if there is at least one turtle on the patch that is one ahead of the current turtle s current location. Since this function reports a Boolean (true or false) it can be used in an if or in an ifelse statement. -4 of 5-

Grading Rubric 20 points total: A: 1 points: Submit one documents to your instructor: Netlogo source code named: W5.firstname.lastname.nlogo. B: 1 points: The first few lines of your code tab are comments including your name, the date, your school, and the assignment name. C: 2 points: The code in the code tab of your program is appropriately documented with inline comments. D: 3 point: Your setup button creates at least 2 turtles. Each turtle must be in a unique location. Also, every time the setup button is pressed, the turtles you create are always created in the same set of unique locations. E: 4 point: When your go button is pressed after clicking setup every turtle moves along a path that sooner or later loops back to the same location and heading it has at earlier in its path. F: 3 points: In your turtle run, there are a total of at least 10 black, red and/or blue patches that affect the path of the turtles. G: 2 points: In your turtle run, whenever one of your turtles turns from its path to avoid another turtle, it later returns to its path. Hint: add a black patch to cause the turtle to turn back around. H: 2 point: In your turtle run, there is at least one patch where two different turtle paths cross. I: 2 point: Your turtle path is cool and original. NOTE: You cannot get any of these points unless you get ALL of the points from D, E, F and G. Extra credit 5 points: ALL of your turtle movement works as required AND you have at least 5 turtles AND your turtle paths cross each other in at least 5 places AND there are at least 25 black, red and/or blue patches that affect the path of the turtles. Extra credit 10 points: Do it in 3D! (see Bumper Turtles video for details). -5 of 5-