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

#1 2011-02-27 09:35:57

cwn_hat5487
Scratcher
Registered: 2010-02-21
Posts: 1

Repeat Until...

I have a repeat until... block in my script and was wondering why it doesn't work. Here's what it looks like:

http://nourse.co.cc/capture.jpg

EDIT: the size block works, but the time doesn't. What I mean by "doesn't" is the time just keeps going after 10.

Last edited by cwn_hat5487 (2011-02-28 07:41:04)

Offline

 

#2 2011-02-27 09:42:36

mathematics
Scratcher
Registered: 2009-03-01
Posts: 1000+

Re: Repeat Until...

Um... what do you mean by "doesn't work"?

Last edited by mathematics (2011-02-27 09:42:49)

Offline

 

#3 2011-02-27 09:57:39

OldWheezerGeezer
Scratcher
Registered: 2010-06-04
Posts: 500+

Re: Repeat Until...

Huh. That should work. Maybe just try changing it around, like change the format of it. Try it another way, like maybe with multiple scripts instead of just one. Sometimes that happens in Scratch, where a script doesn't work but it does in a different fashion  smile

Offline

 

#4 2011-02-27 10:11:12

scimonster
Community Moderator
Registered: 2010-06-13
Posts: 1000+

Re: Repeat Until...

I don't know what's wrong, but I do know that this goes in AAS.

Offline

 

#5 2011-02-27 10:41:00

Paddle2See
Scratch Team
Registered: 2007-10-27
Posts: 1000+

Re: Repeat Until...

One thing to be careful of is testing for exact matches, such as where you have Size = 100.  That kind of testing can fail, even when it looks like it should work, because of the way the computer stores numbers and the way it does calculations. 

A much safer method would be to say, instead, Size > 99.   Give that a try and see if it cures your problem.

By the way, computer languages that have typed data which is clearly integer, don't have this problem.   Scratch, however, doesn't have strongly typed data.


http://i39.tinypic.com/2nav6o7.gif

Offline

 

#6 2011-02-27 15:12:13

lemonpretzel
Scratcher
Registered: 2008-10-23
Posts: 100+

Re: Repeat Until...

The online player could "approximate" 0 to .001. Then when you change size by 1, you soon get 99.001, and then 100 is skipped to 100.001. Use Paddle2See's idea. It's probably the same with time.

Last edited by lemonpretzel (2011-02-27 15:12:34)

Offline

 

#7 2011-02-27 15:14:22

Harakou
Community Moderator
Registered: 2009-10-11
Posts: 1000+

Re: Repeat Until...

Paddle2See is correct. Scratch is very finicky in checking for exact values. Try using less than or greater than instead. (For example, <size > 99> rather than <size = 100>)


http://www.blocks.scratchr.org/API.php?action=random&amp;return=image&amp;link1=http://i.imgur.com/OZn2RD3.png&amp;link2=http://i.imgur.com/duzaGTB.png&amp;link3=http://i.imgur.com/CrDGvvZ.png&amp;link4=http://i.imgur.com/POEpQyZ.png&amp;link5=http://i.imgur.com/ZKJF8ac.png

Offline

 

#8 2011-03-01 07:44:55

mathematics
Scratcher
Registered: 2009-03-01
Posts: 1000+

Re: Repeat Until...

You're right! It doesn't work for me either!

EDIT: Try what Paddle2See said.

Last edited by mathematics (2011-03-01 07:47:29)

Offline

 

Board footer