What happens is with this program I am making, when I click the green flag, the outside of 1 script out of 2 scripts become red instead of white or transparent. What does that mean? Does it mean that the script can not be read or something? Or does it not make sense? Or is the scratch program having a glitch telling me that Scratch is a horrible program? What is the problem? Oh and here is the script:
Light's script
When green flag is clicked
Forever
Set x to variable "saber's direction" divided by variable "saber's x"
Set y to variable "saber's x" plus 60
Point in direction variable "Saber's direction"
End.
(This is the red outlined script)
Saber's script
When green flag clicked:
Forever:
Point towards mouse-pointer
If key up arrow pressed?
Change y by 2
End.
If key down arrow pressed?
Change y by -2
End.
If key right arrow pressed?
Change x by 2
End.
If key left arrow pressed?
Change x by -2
End.
If Space pressed?
Set x to 0
Set y to 0
End.
Set variable "Saber's direction" to direction
Set variable "Saber's y" to y position
Set variable "Saber's x" to x position
End.
Variables:
Saber's x
Saber's y
Saber's direction
So that is the script so . . .what is the problem?And I am in 4th grade so I may not understand something.
Offline
saber's x is probably zero and the divide-by-zero error causes the script to be outlined in red.
Offline
kevin_karplus wrote:
saber's x is probably zero and the divide-by-zero error causes the script to be outlined in red.
Yea, it's easy to trick a computer by making it divide any number by zero(0).
[blocks]
<( (( any number </> 0 )) <=> ? )>
[/blocks]
Offline
Well than I do understand. It is basically that the script does not make sence.
Offline
Lucario621 wrote:
Well than I do understand. It is basically that the script does not make sence.
It's impossible to create a script that wouldn't make sence in Scratch. It might not make sence for a human, but the computer doesn't care. The computer just does what it is told.
Last edited by MyRedNeptune (2007-11-11 07:44:33)
Offline
Lucario621 is right, asking the computer to divide by zero does not make sense to the computer, so it outlines the script in red.
Offline
Yeah, even in Windows Calculator, when you divide a number by zero it says 'can not divide by zero'
Offline