Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <time.h>
- typedef unsigned char uint8;
- int main()
- {
- uint8 startBit,byte2,byte5,flag;
- time_t t;
- srand((unsigned) time(&t));
- byte2 = (rand()%255);
- byte2 = 9;
- byte5 = (rand()%255);
- byte5 = 58;
- startBit = 4;
- //9 is 1001 binary, used as a mask here
- if(byte2&9 == 9){
- //8 is 1000 binary,used as a mask here
- if((byte5&8) == 8){
- flag = 1;
- switch(byte5>>startBit){
- case 0:
- printf("HighlightBlue - Basic");
- break;
- case 1:
- printf("No Color - Advanced");
- break;
- case 2:
- printf("No Color - Sport");
- break;
- case 3:
- printf("HighlightYellow - Drift");
- break;
- }
- }else{
- flag = 0;
- switch(byte5>>startBit){
- case 0:
- printf("No Color - Basic");
- break;
- case 1:
- printf("No Color - Advanced");
- break;
- case 2:
- printf("No Color - Sport");
- break;
- case 3:
- printf("No Color - Drift");
- break;
- }
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement