This is just one of many possible solutions:
The Button Sprites
forward:
when this sprite clicked insert forward at last of source code
backward:
when this sprite clicked insert backward at last of source code
left:
when this sprite clicked insert turn left at last of source code
right:
when this sprite clicked insert turn right at last of source code
go:
when this sprite clicked broadcast go
home:
when this sprite clicked broadcast home
undo:
when this sprite clicked delete last of source code
spin:
when this sprite clicked insert spin at last of source code
clear:
when this sprite clicked delete all of source code
The Sprites
Mouse:
when clicked set size to 30 % go to x: pick random -1 to 4 * 50 y: pick random -3 to 3 * 50
Cat:
when I receive go set statement to 0 set source line to 1 repeat length of source code set statement to item source line of source code if statement = forward then if touching border ? then say Oh no! Missed it! Press "home" and then "clear" to try again. for 2 secs stop all else move 50 steps wait 0.5 secs else if statement = backward then if touching border ? then say Oh no! Missed it! Press "home" and then "clear" to try again. for 2 secs stop all else move -50 steps wait 0.5 secs else if statement = turn left then turn 90 degrees wait 0.5 secs else if statement = turn right then turn 90 degrees wait 0.5 secs else if statement = spin then repeat 20 turn 90 degrees change source line by 1 if touching Mouse ? then play sound meow say Gotcha! for 2 secs else say Oh no! Missed it! Press "home" and then "clear" to try again.
when clicked set size to 50 % go to x: 50 y: 0 point in direction 90 delete all of source code
when I receive home point in direction 90 go to x: 50 y: 0