So basically
int num = rand(2); //random number from 0-2
int otherNum, otherOtherNum;
otherNum = implement this
otherOtherNum = implement this
For example, if num is 2, otherNum and otherOtherNum must be set to 0 and 1 (or 1 and 0).
How would you implement this? What's a fast way? Assume you can't use branching or look up tables.
Aucun commentaire:
Enregistrer un commentaire