Skip to content
Snippets Groups Projects
Select Git revision
  • 9874bef76800ddbb183108ee67ea67652c6bcf1c
  • main default
  • qlearn-4
  • qlearning5
  • qlearn5
  • render
  • qlearn
  • ball
  • fire
  • player
10 results

map.c

Blame
  • map.c 375 B
    #include "map.h"
    
    int map[MAPSIZE][MAPSIZE];
    
    void readMapFromFile(char * filename){
        FILE * fp;
        int i, j;
        fp = fopen(filename, "r");
        if(fp == NULL){
            printf("Error opening file\n");
            exit(1);
        }
        for(i = 0; i < MAPSIZE; i++){
            for(j = 0; j < MAPSIZE; j++){
                fscanf(fp, "%d", &map[i][j]);
            }
        }
        fclose(fp);
    }