Contains the source code from the course work throughout my undergraduate Computer Engineering degree at Brigham Young University. There is a mixture of Go, Python, C, C++, Java, VHDL, Verilog, Matlab, Bash, Assembly, etc..
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ufo.h 4.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. #ifndef UFO_H_
  2. #define UFO_H_
  3. #define UFO_HEIGHT 16
  4. #define UFO_WIDTH 30
  5. #define UFOSCORE_HEIGHT 6
  6. #define UFOSCORE_WIDTH 6
  7. #define packWord6(b5,b4,b3,b2,b1,b0) \
  8. ((b5 << 5 ) | (b4 << 4 ) | (b3 << 3 ) | (b2 << 2 ) | (b1 << 1 ) | (b0 << 0 ))
  9. #define packWord30(b29,b28,b27,b26,b25,b24,b23,b22,b21,b20,b19,b18,b17,b16,b15,b14,b13,b12,b11,b10,b9,b8,b7,b6,b5,b4,b3,b2,b1,b0) \
  10. ((b29 << 29) | (b28 << 28) | (b27 << 27) | (b26 << 26) | (b25 << 25) | (b24 << 24) | \
  11. (b23 << 23) | (b22 << 22) | (b21 << 21) | (b20 << 20) | (b19 << 19) | (b18 << 18) | (b17 << 17) | (b16 << 16) | \
  12. (b15 << 15) | (b14 << 14) | (b13 << 13) | (b12 << 12) | (b11 << 11) | (b10 << 10) | (b9 << 9 ) | (b8 << 8 ) | \
  13. (b7 << 7 ) | (b6 << 6 ) | (b5 << 5 ) | (b4 << 4 ) | (b3 << 3 ) | (b2 << 2 ) | (b1 << 1 ) | (b0 << 0 ) )
  14. int ufo[UFO_HEIGHT] =
  15. {
  16. packWord30(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0),
  17. packWord30(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0),
  18. packWord30(0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0),
  19. packWord30(0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0),
  20. packWord30(0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0),
  21. packWord30(0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0),
  22. packWord30(0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0),
  23. packWord30(0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0),
  24. packWord30(0,0,0,1,1,1,0,0,1,1,1,0,0,1,1,1,0,0,1,1,1,0,0,1,1,1,1,0,0,0),
  25. packWord30(0,0,0,1,1,1,0,0,1,1,1,0,0,1,1,1,0,0,1,1,1,0,0,1,1,1,1,0,0,0),
  26. packWord30(0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0),
  27. packWord30(0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0),
  28. packWord30(0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,0,0),
  29. packWord30(0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,0,0),
  30. packWord30(0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0),
  31. packWord30(0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0),
  32. };
  33. int ufo_zero_block[UFOSCORE_HEIGHT] = // 0 block
  34. {
  35. packWord6(0,0,1,1,0,0),
  36. packWord6(0,0,1,1,0,0),
  37. packWord6(1,1,0,0,1,1),
  38. packWord6(1,1,0,0,1,1),
  39. packWord6(0,0,1,1,0,0),
  40. packWord6(0,0,1,1,0,0),
  41. };
  42. int ufo_one_block[UFOSCORE_HEIGHT] = // 1 block
  43. {
  44. packWord6(0,0,1,1,0,0),
  45. packWord6(0,0,1,1,0,0),
  46. packWord6(0,0,1,1,0,0),
  47. packWord6(0,0,1,1,0,0),
  48. packWord6(0,0,1,1,0,0),
  49. packWord6(0,0,1,1,0,0),
  50. };
  51. int ufo_two_block[UFOSCORE_HEIGHT] = // 2 block
  52. {
  53. packWord6(1,1,1,1,1,1),
  54. packWord6(0,0,0,0,0,1),
  55. packWord6(0,0,0,0,0,1),
  56. packWord6(1,1,1,1,1,1),
  57. packWord6(1,0,0,0,0,0),
  58. packWord6(1,1,1,1,1,1),
  59. };
  60. int ufo_three_block[UFOSCORE_HEIGHT] = // 3 block
  61. {
  62. packWord6(1,1,1,1,1,1),
  63. packWord6(0,0,0,0,1,0),
  64. packWord6(0,0,1,1,0,0),
  65. packWord6(0,0,0,0,1,0),
  66. packWord6(0,0,0,0,0,1),
  67. packWord6(1,1,1,1,1,0),
  68. };
  69. int ufo_four_block[UFOSCORE_HEIGHT] = // 4 block
  70. {
  71. packWord6(1,0,0,0,0,1),
  72. packWord6(1,0,0,0,0,1),
  73. packWord6(1,0,0,0,0,1),
  74. packWord6(1,1,1,1,1,1),
  75. packWord6(0,0,0,0,0,1),
  76. packWord6(0,0,0,0,0,1),
  77. };
  78. int ufo_five_block[UFOSCORE_HEIGHT] = // 5 block
  79. {
  80. packWord6(1,1,1,1,1,1),
  81. packWord6(1,0,0,0,0,0),
  82. packWord6(1,1,1,1,1,1),
  83. packWord6(0,0,0,0,0,1),
  84. packWord6(0,0,0,0,0,1),
  85. packWord6(1,1,1,1,1,1),
  86. };
  87. int ufo_six_block[UFOSCORE_HEIGHT] = // 6 block
  88. {
  89. packWord6(1,1,1,1,1,1),
  90. packWord6(1,0,0,0,0,0),
  91. packWord6(1,0,0,0,0,0),
  92. packWord6(1,1,1,1,1,1),
  93. packWord6(1,0,0,0,0,1),
  94. packWord6(1,1,1,1,1,1),
  95. };
  96. int ufo_seven_block[UFOSCORE_HEIGHT] = // 7 block
  97. {
  98. packWord6(1,1,1,1,1,1),
  99. packWord6(1,1,1,1,1,1),
  100. packWord6(0,0,0,0,1,1),
  101. packWord6(0,0,0,0,1,1),
  102. packWord6(0,0,0,0,1,1),
  103. packWord6(0,0,0,0,1,1),
  104. };
  105. int ufo_eight_block[UFOSCORE_HEIGHT] = // 8 block
  106. {
  107. packWord6(0,0,1,1,0,0),
  108. packWord6(1,1,0,0,1,1),
  109. packWord6(0,0,1,1,0,0),
  110. packWord6(1,1,0,0,1,1),
  111. packWord6(1,1,0,0,1,1),
  112. packWord6(0,0,1,1,0,0),
  113. };
  114. int ufo_nine_block[UFOSCORE_HEIGHT] = // 9 block
  115. {
  116. packWord6(0,0,1,1,0,0),
  117. packWord6(1,1,0,0,1,1),
  118. packWord6(1,1,0,0,1,1),
  119. packWord6(0,0,1,1,1,1),
  120. packWord6(0,0,0,0,1,1),
  121. packWord6(1,1,1,1,1,1),
  122. };
  123. #endif /* UFO_H_ */