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

#1 2009-09-12 02:25:25

gustav165
Scratcher
Registered: 2009-07-08
Posts: 3

Wierd glitch

I have a variable that is for example representing 4 then using this script instead of getting lower it gets higher and if I use * instead scratch gets an error.
<forever>
<change{ Variable }by( (( <{ Variable }> </> 10 )) )
<end>

Offline

 

#2 2009-09-13 18:28:47

06dknibbs
Scratcher
Registered: 2008-01-29
Posts: 1000+

Re: Wierd glitch

You seem to be changing the variable.
This will cause it to go higher  smile

4/10 = 0.4

What scratch is doing is changing "variable" by 0.4 each time  smile


http://i404.photobucket.com/albums/pp129/06dknibbs/Untitled-3-6.jpg

Offline

 

#3 2009-09-13 18:30:17

06dknibbs
Scratcher
Registered: 2008-01-29
Posts: 1000+

Re: Wierd glitch

To make it go lower try using

Set variable to variable/10

This way scratch will make variable = 0.4, then 0.04 etc:


http://i404.photobucket.com/albums/pp129/06dknibbs/Untitled-3-6.jpg

Offline

 

#4 2010-01-31 11:54:10

Fyxen
Scratcher
Registered: 2009-06-24
Posts: 12

Re: Wierd glitch

Or, depending on what you want to do, change it by a negative amount like Variable/-10.  Read the Change block as equivalent to Set Variable to Variable + whatever.

Offline

 

#5 2010-02-01 17:48:59

billyedward
Scratcher
Registered: 2008-01-03
Posts: 500+

Re: Wierd glitch

The above comments are correct... However, one neat thing to do, is to add:
<pen down>
<go to x sad  (( <x position> <+> 1 )) )y sad  <{ Variable }> )>
[/blocks]
To your script, to plot a cool logarithmic curve.


"I'd love to change the world, but they haven't released the source code yet."
Check out the latest version of Streak --> http://billy.scienceontheweb.net/Streak

Offline

 

Board footer