forked from hermanwongkm/CS1010
-
Notifications
You must be signed in to change notification settings - Fork 0
/
block.c
45 lines (36 loc) · 1005 Bytes
/
block.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
// CS1010 AY2016/7 Semester 1
// PE2 Ex2: block.c
// Name: Wong Kai Min Herman
// Matriculation number: A0139964M
// plab account-id: plab1279
// Discussion group: T13
// Description: This program pulls and push block if sequence is allowed
#include <stdio.h>
#define MAX_SIZE 10
#define MAX_NUM_INDEXES 20
void printGrid(int [][MAX_SIZE], int);
int main(void) {
int grid[MAX_SIZE][MAX_SIZE], size;
printf("Game completed.\n");
printf("Score: \n"); // Incomplete
printf("Number of blocks left: \n"); // Incomplete
printf("Unable to complete game.\n");
printf("Final state of the grid: \n");
printGrid(grid, size);
return 0;
}
// Print the grid
void printGrid(int grid[][MAX_SIZE], int size){
int i, j;
for (i = 0; i < size; i++){
for (j = 0; j< size; j++)
printf("%d ", grid[i][j]);
printf("\n");
}
}
/* Sample printf statements for readInputs()
printf("Enter size of grid: ");
printf("Enter grid: \n");
printf("Enter number of indexes: ");
printf("Enter indexes: ");
*/