Untitled
By: a guest | Mar 22nd, 2010 | Syntax:
C | Size: 0.83 KB | Hits: 55 | Expires: Never
#include <stdio.h>
#include <math.h>
/*print a clear board to start the game*/
main(int argc, const char* argv[]) {
/*Argument 1 is rules. Read this in in text mode.*/
FILE *rules;
int rows,cols;
if(argc >= 2){
rules = fopen(argv[1], "r");
if (rules == NULL)
{
fprintf(stderr, "There was an error opening the rules file.");
return 1;
}
}
while(!feof(rules)) {
fscanf(rules, "%d %d", &rows,&cols);
printf("%d %d", rows,cols);
}
/*Create our game board*/
int array[rows][cols];
fprintf(stderr,"***************************\n");
fprintf(stderr," NAVAL \n");
}
~