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

#1 2009-02-19 01:57:10

Inkstand
Scratcher
Registered: 2008-12-16
Posts: 23

Random Direction

Hi,

I'm looking for an easy, effective way of choosing a RANDOM direction (90, -90, 180, or 0). I'm presuming you'd have to assign a random number to a variable, then set direction to the variable, but I'm not entirely sure how to assign random numbers out of four choices.

HELP ME!

Inkstand  smile


"To say of what is that it is not, or of what is not that it is, is false, while to sat of what is that it is, and of what is not that it is not, is true." - Aristotle
"I don't apologize. I'm sorry, but that's just the way I am."  - Homer Simpson

Offline

 

#2 2009-02-19 02:04:37

alexpja
Scratcher
Registered: 2008-06-12
Posts: 100+

Re: Random Direction

you can but you click the numbers and enter what ever u want

<point in direction( 56 or whatever

Last edited by alexpja (2009-02-19 02:04:56)


Sorry for never being on... I'm on Onverse now. So get inside, and Onverse yourself. Cya 'round.

Offline

 

#3 2009-02-19 02:09:20

Inkstand
Scratcher
Registered: 2008-12-16
Posts: 23

Re: Random Direction

By RANDOM, I mean 'So that I don't set it'.


"To say of what is that it is not, or of what is not that it is, is false, while to sat of what is that it is, and of what is not that it is not, is true." - Aristotle
"I don't apologize. I'm sorry, but that's just the way I am."  - Homer Simpson

Offline

 

#4 2009-02-19 02:49:33

alexpja
Scratcher
Registered: 2008-06-12
Posts: 100+

Re: Random Direction

oh.idk


Sorry for never being on... I'm on Onverse now. So get inside, and Onverse yourself. Cya 'round.

Offline

 

#5 2009-02-19 03:41:48

mrweston
Scratcher
Registered: 2007-12-13
Posts: 100+

Re: Random Direction

Here's one way to do it:

http://sixtyten.ca/misc/directions.jpg

Last edited by mrweston (2009-02-19 03:42:42)

Offline

 

#6 2009-02-19 04:12:20

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

Re: Random Direction

How about this?

[blocks]
<when green flag clicked>
<point in direction( (( <pick random( 0 )to( 3 <*> 90 ))
<move( 100 )steps>
[/blocks]

Remember that 3*90 = 270 is the same direction as -90.


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

Offline

 

#7 2009-02-19 06:33:23

yambanshee
Scratcher
Registered: 2007-11-06
Posts: 500+

Re: Random Direction

Paddle2See wrote:

How about this?

[blocks]
<when green flag clicked>
<point in direction( (( <pick random( 0 )to( 3 <*> 90 ))
<move( 100 )steps>
[/blocks]

Remember that 3*90 = 270 is the same direction as -90.

I was about to post that...

Offline

 

#8 2009-03-12 03:26:35

Inkstand
Scratcher
Registered: 2008-12-16
Posts: 23

Re: Random Direction

Genius... Thanks heaps  smile


"To say of what is that it is not, or of what is not that it is, is false, while to sat of what is that it is, and of what is not that it is not, is true." - Aristotle
"I don't apologize. I'm sorry, but that's just the way I am."  - Homer Simpson

Offline

 

#9 2009-03-13 18:46:25

Jello715
Scratcher
Registered: 2008-10-11
Posts: 95

Re: Random Direction

I thought of the list one, but the Point in random direction 0 - 3 * 90 was pretty good thinking  big_smile

Offline

 

Board footer