Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Making circle pop up in random areas
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
besomebody




PostPosted: Sun Jan 11, 2009 4:07 pm   Post subject: Making circle pop up in random areas

Alright, Im making a game with a joystick with turing for my grade ten computer engineering class. Since I've never used turing before I had this class, and we only had a small portion of time to practice using turing, I'm not very knowledgable when using it. I want circles to appear on the screen randomly in 8 possible areas (north, east, south, west, northwest, etc), so that when it pops up, you need to copy the direction with the joystick. Is that possible? If so, I'd be greatly appreciated if you could explain what commands or structures I need to use. Thanks =)
Sponsor
Sponsor
Sponsor
sponsor
Tony




PostPosted: Sun Jan 11, 2009 4:12 pm   Post subject: RE:Making circle pop up in random areas

Rand.Int() will give you a random number.
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
besomebody




PostPosted: Sun Jan 11, 2009 4:21 pm   Post subject: RE:Making circle pop up in random areas

Yes, but the coordinates of the circle needs to be in one of eight possible areas, I cant use that because it will set the variable to any number. I want it to be randomized between the eight possible areas.
The_Bean




PostPosted: Sun Jan 11, 2009 4:29 pm   Post subject: Re: Making circle pop up in random areas

Make an array of the x,y positions of the 8 possible spots, then use Rand.Int to pick a random element from the array.
besomebody




PostPosted: Sun Jan 11, 2009 4:34 pm   Post subject: RE:Making circle pop up in random areas

Alright, thanks =)
And sorry my question was so lame. We literally only had a bit more than a week to practice using Turing.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 5 Posts ]
Jump to:   


Style:  
Search: