ScratchData LogoScratchData
Back to Tutor-42's profile

The Tortoise and the Hare - Best Fix

TUTutor-42•Created August 17, 2019
The Tortoise and the Hare - Best Fix
0
0
18 views
View on Scratch

Instructions

This project is a good fix for the project "The Tortoise and the Hare" https://scratch.mit.edu/projects/324376904/ This project good structure! - It has just one Green Flag script with one "wait 1 second" block for both animals before the race starts. - Using "broadcast Move and wait" ensures both the Tortoise and Hare are moved together. - The code only checks if the Tortoise or Hare has reached the edge after both animals have moved. This makes it easier to write a script for a tie. * This project also uses a "run without screen refresh" custom block to move the Tortoise as fast as the Hare. With this custom block, the script to move the Tortoise does not yield and update the screen each time it reaches the end of the repeat loop after moving 1 step. As an extra fix, the costume of the Hare was edited so that its right side matches the right side of the Tortoise. In the original project, despite their centres being at the same x position, the Tortoise could touch the finish line first as its costume extended further to the right. Programming is an exacting business.

Description

This tutorial discusses "yield points" in Scratch, and the original The Tortoise and the Hare project: https://scratch.mit.edu/discuss/post/3680398/ The tutorial also covers "run without screen refresh" custom blocks, "broadcast ... and wait", and projects with one Green Flag script as in this fixed version. Original problem project The Tortoise and the Hare: https://scratch.mit.edu/projects/324376904/ Tortoise and Hare pictures from the wonderful project "The Hare and the Tortoise" by Guadalupe and Yakov: https://scratch.mit.edu/projects/380302/

Project Details

Project ID324480363
CreatedAugust 17, 2019
Last ModifiedNovember 29, 2019
SharedSeptember 12, 2019
Visibilityvisible
CommentsAllowed