Advertisement
Guest User

Untitled

a guest
Jun 24th, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.03 KB | None | 0 0
  1. /*******************************************************************
  2. * Program Name:
  3. * Assignment: Homework #
  4. * Due Date: #/#/10
  5. *
  6. * Programmer: Kamar Galloway Student ID: 000918754
  7. * Course: CSC 230 - 002 Lecturer: Dr. Dulberg
  8. *
  9. * Program Description:
  10. *
  11. * Input:
  12. * Output:
  13. * Assumptions/Limitations:
  14. *
  15. *******************************************************************/
  16. #include <stdbool.h> /* C99 only */
  17. #include <stdio.h>
  18. #include <stdlib.h>
  19. #include <time.h>
  20.  
  21. #define DICE_ONE 6
  22. #define DICE_TWO 6
  23. #define SIZE 21
  24.  
  25. int main(void){
  26. int roll1[SIZE] = {1,1,1,1,1,1,2,2,2,2,2,3,3,3,3,4,4,4,5,5,6};
  27. int roll2[SIZE] = {1,2,3,4,5,6,2,3,4,5,6,3,4,5,6,4,5,6,5,6,6};
  28.  
  29. int i = 0, j = 0;
  30. int diceOne = -1;
  31. int diceTwo = -1;
  32.  
  33. for(j = 0; j < 10; j++){
  34. diceOne = rand() % 6 + 1;
  35. diceTwo = rand() % 6 + 1;
  36.  
  37. printf("%d %d\n", diceOne, diceTwo);
  38.  
  39. }
  40.  
  41.  
  42. printf("Roll\t\tE/N\t\tA/N\n");
  43. for(i = 0; i < SIZE; i++){
  44. printf("%d,%d\n",roll1[i],roll2[i]);
  45. }
  46.  
  47. return 0;
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement