1.3 Modify a Bee-Bot

Scratch solution

View solution

This is just one of many possible solutions:

The Button Sprites

forward:

whenthisspriteclickedinsertforwardatlastofsource code

backward:

whenthisspriteclickedinsertbackwardatlastofsource code

left:

whenthisspriteclickedinsertturn leftatlastofsource code

right:

whenthisspriteclickedinsertturn rightatlastofsource code

go:

whenthisspriteclickedbroadcastgo

home:

whenthisspriteclickedbroadcasthome

undo:

whenthisspriteclickeddeletelastofsource code

spin:

whenthisspriteclickedinsertspinatlastofsource code

clear:

whenthisspriteclickeddeleteallofsource code

The Sprites

Mouse:

whenclickedsetsizeto30%gotox:pickrandom-1to4*50y:pickrandom-3to3*50

Cat:

whenIreceivegosetstatementto0setsource lineto1repeatlengthofsource codesetstatementtoitemsourcelineofsource codeifstatement=forwardtheniftouchingborder?thensayOh no! Missed it! Press "home" and then "clear" to try again.for2secsstopallelsemove50stepswait0.5secselseifstatement=backwardtheniftouchingborder?thensayOh no! Missed it! Press "home" and then "clear" to try again.for2secsstopallelsemove-50stepswait0.5secselseifstatement=turn leftthenturn90degreeswait0.5secselseifstatement=turn rightthenturn90degreeswait0.5secselseifstatement=spinthenrepeat20turn90degreeschangesource lineby1iftouchingMouse?thenplaysoundmeowsayGotcha!for2secselsesayOh no! Missed it! Press "home" and then "clear" to try again.
whenclickedsetsizeto50%gotox:50y:0pointindirection90deleteallofsource code
whenIreceivehomepointindirection90gotox:50y:0

Back to programming challenge