Guest User

Untitled

a guest
Jan 12th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.63 KB | None | 0 0
  1. #include <stdbool.h>
  2. #include <stdint.h>
  3. #include <stdio.h>
  4. #include <stdlib.h>
  5.  
  6. #define MAX_COLORS 64
  7. #define FULL (~(pset_t) 0)
  8.  
  9. typedef uint64_t pset_t;
  10.  
  11. const char color_table[] = "123456789"
  12.   "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
  13.   "abcdefghijklmnopqrstuvwxyz"
  14.   "@&*";
  15.  
  16. void
  17. pset_print (pset_t pset)
  18. /*
  19.  * pset_print print a pset_t bit to bit, with the strongest on the left
  20.  */
  21. {
  22.   int i;
  23.   for (i = 0; i < 64; i++)
  24.     {
  25.       printf("%lld", (pset >> (63 - i)) & 1);
  26.     }
  27.   printf("\n");
  28. }
  29.  
  30.  
  31. int main(void)
  32. {
  33.   pset_t p = 1;
  34.   int i = 64;
  35.  
  36.   pset_print(p<<(i-1));
  37.   pset_print(p<<i);
  38.  
  39.   return 1;
  40. }
Add Comment
Please, Sign In to add comment