View unanswered posts | View active topics It is currently Sat May 26, 2018 7:54 pm

Reply to topic  [ 2 posts ] 
Robolab to ROBOTC Questions 
Author Message
Site Admin
Site Admin

Joined: Wed Apr 10, 2013 12:05 pm
Posts: 7
Post Robolab to ROBOTC Questions
A Robolab users would like to know ...

1. How do you get a random modifier (I believe the term is Parameter in ROBOTC)? I used to have my robot turn for a random amount of time (I think it was a random number between 1-5 seconds)
2. Does ROBOTC do jumps and lands?
3. Does ROBOTC do events?

Original Question posted on Facebook

Fri Jun 21, 2013 9:17 am
Site Admin
Site Admin

Joined: Tue May 15, 2007 9:02 am
Posts: 409
Post Re: Robolab to ROBOTC Questions
1) In ROBOTC, there is a "rand()" function that will return a random number, which you can use to control time, speed, or any number of other things that are controlled by a number. We have documentation here:

2) I think the closest thing to a jump and a land in Robolab is a "goto", which are generally frowned upon because it's not a good programming practice to use them. Control structures like while loops are the preferred way to repeat bodies of code in ROBOTC:

3) I'm a little fuzzy on exactly what an event is in Robolab, since I haven't used it for a few years. Check out if-else statements, which let you run code based on a certain condition, like a sensor reaching a certain value:

Hope that helps!

Jesse Flot
CMU Robotics Academy
ROBOTC Support

Fri Jun 21, 2013 9:43 am
Display posts from previous:  Sort by  
Reply to topic   [ 2 posts ] 

Who is online

Users browsing this forum: No registered users and 2 guests

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.