OCCRA
Go to Post The best place for acrylic is the trash can. - Cory [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Events   CD-Media   CD-Spy   FRC-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 09-16-2007, 09:03 AM
TexasFederation TexasFederation is offline
Registered User
no team
 
Join Date: Sep 2007
Location: Fort Worth, Tx.
Posts: 1
TexasFederation is an unknown quantity at this point
Random?

I have EasyC V2 and downloaded the trial version of easyC Pro. I don't find a random function in either program. Is there a reason for that or is there a workaround?
Reply With Quote
  #2   Spotlight this post!  
Unread 09-16-2007, 12:47 PM
artdutra04's Avatar
artdutra04 artdutra04 is offline
VEX Robotics Engineer
AKA: Arthur Dutra IV; NERD #18
FRC #0148 (Robowranglers)
Team Role: Engineer
 
Join Date: Mar 2005
Rookie Year: 2002
Location: Greenville, TX
Posts: 3,025
artdutra04 has a reputation beyond reputeartdutra04 has a reputation beyond reputeartdutra04 has a reputation beyond reputeartdutra04 has a reputation beyond reputeartdutra04 has a reputation beyond reputeartdutra04 has a reputation beyond reputeartdutra04 has a reputation beyond reputeartdutra04 has a reputation beyond reputeartdutra04 has a reputation beyond reputeartdutra04 has a reputation beyond reputeartdutra04 has a reputation beyond repute
Re: Random?

A "pure" random number generator does not exist in either. However, you can make a pseudo-random number generator that's a close enough approximation:

Start a timer before the program:
Each time through the loop, divide the timer value by a number like four or nine*, and store the modulus to a variable.
The modulus (the % operator) is now your "random" number.


* The size of your random number pool will depend on how high you set this. If you want a bigger range of random numbers, set this higher.
__________________
Art Dutra IV
Robotics Engineer, VEX Robotics, Inc., a subsidiary of Innovation First International (IFI)
Robowranglers Team 148 | GUS Robotics Team 228 (Alumni) | Rho Beta Epsilon (Alumni) | @arthurdutra

世上无难事,只怕有心人.
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
RAndom C++ Problem brennerator Programming 8 02-15-2007 02:04 PM
Random behavior RedBarons Programming 9 02-25-2006 10:03 PM
Random Thought Ricky Q. Chit-Chat 32 10-25-2002 12:26 PM
How random is random???? archiver 1999 0 06-23-2002 08:59 PM
Random Marc P. Chit-Chat 138 02-13-2002 02:11 PM


All times are GMT -5. The time now is 12:33 AM.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi