Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*******************************************************************
- * Program Name:
- * Assignment: Homework #
- * Due Date: #/#/10
- *
- * Programmer: Kamar Galloway Student ID: 000918754
- * Course: CSC 230 - 002 Lecturer: Dr. Dulberg
- *
- * Program Description:
- *
- * Input:
- * Output:
- * Assumptions/Limitations:
- *
- *******************************************************************/
- #include <stdbool.h> /* C99 only */
- #include <stdio.h>
- #include <stdlib.h>
- #include <time.h>
- #define DICE_ONE 6
- #define DICE_TWO 6
- #define SIZE 21
- int main(void){
- int roll1[SIZE] = {1,1,1,1,1,1,2,2,2,2,2,3,3,3,3,4,4,4,5,5,6};
- int roll2[SIZE] = {1,2,3,4,5,6,2,3,4,5,6,3,4,5,6,4,5,6,5,6,6};
- int EN[SIZE] = {1000,2000,2000,2000,2000,2000,1000,2000,2000,2000,2000,1000,2000,2000,2000,1000,2000,2000,1000,2000,1000};
- int count[7][7];
- int i = 0, j = 0;
- int diceOne = -1;
- int diceTwo = -1;
- //INIT COUNTERS
- for(i = 0; i < 7; i++){
- for(j = 0; j < 7; j++){
- count[i][j] = 0;
- printf("[%d %d]: %d\n",i,j,count[i][j]);
- }
- }
- for(i = 0; i < 10; i++){
- diceOne = rand() % 6 + 1;
- diceTwo = rand() % 6 + 1;
- count[diceOne][diceTwo]++;
- printf("%d %d\n", diceOne, diceTwo);
- }
- printf("Roll\t\tE/N\t\tA/N\n");
- for(i = 0; i < SIZE; i++){
- printf("%d,%d\t\t%d\t\t%d\n",roll1[i],roll2[i],EN[i],count[roll1[i]][roll2[i]]);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement