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

#1 2007-12-15 07:57:51

gosox5555
Scratcher
Registered: 2007-04-28
Posts: 22

To get multiples (see example)

[blocks]<when green flag clicked><forever if>[/blocks]  timer =  a multiple of 20
show sprite14


Can I do this (or something like it)?

Offline

 

#2 2007-12-15 09:02:19

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

Re: To get multiples (see example)

Do you mean
  if  timer mod 20 = 0

Offline

 

#3 2007-12-15 09:47:40

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

Re: To get multiples (see example)

What Kevin Karplus said in blocks:

<when green flag clicked>
<hide>
<wait until>(( <timer> <mod> 20 ))
<show>

Last edited by MyRedNeptune (2007-12-15 09:47:57)


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

 

#4 2007-12-16 12:33:08

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

Re: To get multiples (see example)

You will probably have to take something like
[blocks](( <round( <timer>)> <mod> 20 ))[/blocks]
as the timer returns a decimal value.

Last edited by Paddle2See (2007-12-16 12:41:22)


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

Offline

 

#5 2007-12-16 17:22:50

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

Re: To get multiples (see example)

Ah, right, so you definitely want
    round(timer) mod 20  = 0
since timer mod 20 would almost never end up as zero.

Offline

 

Board footer