View Single Post
  #103   Spotlight this post!  
Unread 10-12-2007, 12:29
JesseK's Avatar
JesseK JesseK is offline
Expert Flybot Crasher
FRC #1885 (ILITE)
Team Role: Mentor
 
Join Date: Mar 2007
Rookie Year: 2005
Location: Reston, VA
Posts: 3,714
JesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond reputeJesseK has a reputation beyond repute
Re: Programming jokes

Quote:
Originally Posted by artdutra04 View Post
The only downside to this algorithm is that there is no rand() function of any kind on our controller.

The best way I've found to generate "random" numbers on Vex/FRC controllers is to start a timer at the beginning of your program, and whenever you need a random number get the modulus of the timer value when divided by a number of your choice.
Well, problem solved. The algorithm stands!
__________________

Drive Coach, 1885 (2007-present)
CAD Library Updated 5/1/16 - 2016 Curie/Carver Industrial Design Winner
GitHub