This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2007-10-14 12:54:48

Lucario621
Community Moderator
Registered: 2007-10-03
Posts: 1000+

when green flag clicked, out side of script is red not white.

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.


http://i.imgur.com/WBkM2QQ.png

Offline

 

#2 2007-10-15 17:59:41

kevin_karplus
Scratcher
Registered: 2007-04-27
Posts: 1000+

Re: when green flag clicked, out side of script is red not white.

saber's x is probably zero and the divide-by-zero error causes the script to be outlined in red.

Offline

 

#3 2007-10-18 21:37:44

Scratchie
Scratcher
Registered: 2007-08-24
Posts: 29

Re: when green flag clicked, out side of script is red not white.

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

 

#4 2007-11-10 18:09:30

Lucario621
Community Moderator
Registered: 2007-10-03
Posts: 1000+

Re: when green flag clicked, out side of script is red not white.

Well than I do understand. It is basically that the script does not make sence.


http://i.imgur.com/WBkM2QQ.png

Offline

 

#5 2007-11-11 07:43:19

MyRedNeptune
Community Moderator
Registered: 2007-05-07
Posts: 1000+

Re: when green flag clicked, out side of script is red not white.

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.  smile

Last edited by MyRedNeptune (2007-11-11 07:44:33)


http://i52.tinypic.com/5es7t0.png I know what you're thinking! "Neptune! Get rid of those filthy advertisements and give us back the Zarathustra siggy, you horrible person!" Well, don't worry about it, the Zara siggy will be back soon, new and improved! ^^ Meanwhile, just do what the sig tells you to. >.>

Offline

 

#6 2007-11-11 12:27:41

kevin_karplus
Scratcher
Registered: 2007-04-27
Posts: 1000+

Re: when green flag clicked, out side of script is red not white.

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

 

#7 2007-11-11 17:37:09

relyt12101
Scratcher
Registered: 2007-05-19
Posts: 500+

Re: when green flag clicked, out side of script is red not white.

Yeah, even in Windows Calculator, when you divide a number by zero it says 'can not divide by zero'


http://img392.imageshack.us/img392/2860/pspbanneregg089deiy0.png

Offline

 

Board footer