Go to Post [Bring] programmers [to Championships], they may be small, quite and easy to miss while leaving for Atlanta but its hard to do anything robotic without them, I've tried. - Simon Strauss [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #14   Spotlight this post!  
Unread 10-12-2007, 12:14
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,078
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: Programming jokes

Quote:
Originally Posted by JesseK View Post
Maybe he lacked the proper people skills. Many a great idea go mutiliated or unknown because someone doesn't speak up enough or that someone lacks the insight into how to be pushy enough to make the idea become a success.

(Java-C-MPLab pseudo-goullash code)
Code:
int rand = Math.rand() * 127;
int pos_neg = Math.rand;
if(pos_neg > 0.5) 
pos_neg = 1;
else 
pos_neg = -1;

//Drive Motors
pwm_04=pwm_05=(rand + 127);
pwm_06=pwm_07=(rand * pos_neg + 127);

//Arm
pwm_08=255; //Arms up!
pwm_09=(rand/2*pos_neg + 127);  //Wavy hands
This isn't a joke; this will be our autonomous algorithm next year if our students don't come up with anything to do in autonomous. Students be warned!
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.
__________________
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

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


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
Jokes Branden Ghena Chit-Chat 42 14-05-2006 14:06
Arrrr!! It be robot pirate jokes!! superbeano2004 Games/Trivia 21 20-09-2005 09:06
Science jokes..... Adam Y. Chit-Chat 20 10-12-2004 11:55
Practical Jokes & Mr. M Jack Chit-Chat 1 21-04-2003 13:40
FIRST JOKES AntiCrombieDuck Chit-Chat 20 21-02-2002 15:09


All times are GMT -5. The time now is 10:27.

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


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