Rik's Treehouse > Babbling in Binary > NQC Scripts for Lego Mindstorms |
| tagger.nqc version 1.0 for NQC | |
Play tag with other bots. This program will cause a bot to chase any other bots it sees. Tags are not implemented and must be judged by a referree (ie. a real person). Use in conjunction with taggee.nqc. (Requires randomWalkLRFB.nqh and botDetect.nqh.) | ||
Freeware |
| taggee.nqc version 1.0 for NQC | |
Play tag with other bots. This program will cause a bot to run away from any other bots it sees. Tags are not implemented and must be judged by a referree (ie. a real person). Use in conjunction with tagger.nqc. (Requires randomWalkLRFB.nqh and botDetect.nqh.) | ||
Freeware |
| randomWalkLRFB.nqh version 1.0 for NQC | |
Performs a random walk for a bot with left/right (LR) outputs and front/back (FB) bumpers. (Requires motorP.nqh and randP.nqh. Required by tagger.nqc and taggee.nqc.) | ||
Freeware |
| botDetect.nqh version 1.0 for NQC | |
Detects the proximity of other bots which are also running botDetect. If another bot has recently been detected will set the global variable botDetected to a positive value, otherwise it will be negative (or zero). (Requires randP.nqh. Required by tagger.nqc and taggee.nqc.) | ||
Freeware |
| motorP.nqh version 1.0 for NQC | |
Redefines the output functions so they support priorities. This is an unsophisticated solution to the problem of controlling outputs in a multitasking environment. I've seen better solutions but this has the advantage of being conceptually simple. (Required by randomWalkLRFB.nqh.) | ||
Freeware |
| randP.nqh version 1.1 for NQC | |
A (fast) pseudo-random number generator with a genuine random seed. The built-in function Random() is unsuitable for multiple bots because it always begins with the same seed so each bot generates the same sequence of random numbers. (Required by botDetect.nqh and randomWalkLRFB.nqh.) | ||
What's new: No longer depends on bitshift.nqh. If using NQC v2.4+ then uses more efficient form of bitshifting with operators instead of function calls. | ||
Freeware |
| randG.nqh version 1.1 for NQC | |
A (slow) genuine random number generator. The built-in function Random() is unsuitable for multiple bots because it always begins with the same seed so each bot generates the same sequence of random numbers. | ||
What's new: No longer depends on bitshift.nqh. If using NQC v2.4+ then uses more efficient form of bitshifting with operators instead of function calls. | ||
Freeware |
| bitshift.nqh version 1.0 for NQC | |
Older versions of NQC (v2.3-) do not support bitshifting with variable operands, so the following two functions are defined to do the job: bitshiftLeft(in, bits, out); // out = in << bits bitshiftRight(in, bits, out); // out = in >> bits | ||
Freeware |
[Rik's Office Hours] [Contact Rik] Last updated: Sun Apr 3 2005, 4:47am |