colloscope/main.c

62 lines
1.8 KiB
C

#include "algorithm.c"
// gcc -g -Wall -Wextra -Wpedantic main.c -lSDL2 -lSDL2_image -lm -o main
int main() {
printf("Starting\n");
srand(time(NULL));
if (SDL_Init(SDL_INIT_EVERYTHING) != 0) {
printf("error initializing SDL: %s\n", SDL_GetError());
}
SDL_Window* win = SDL_CreateWindow("a game", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, width, height, 0);
Uint32 render_flags = SDL_RENDERER_ACCELERATED;
SDL_Renderer* rend = SDL_CreateRenderer(win, -1, render_flags);
SDL_SetRenderDrawBlendMode(rend, SDL_BLENDMODE_BLEND);
creneau* edt = import_creneaux("file.txt", 64);
int len_creneau = 64;
colleur* dudes = import_colleurs("some_data.txt", 7, 64);
int n_colleurs = 7;
//printf("%d %d %d %d\n", edt[10].date.hour, edt[10].date.day, edt[10].date.month, edt[10].date.year);
//printf("%d\n", date_dist(d1, d1));
//printf("%d %d %d %d\n", edt[70].date.hour, edt[70].date.day, edt[70].date.month, edt[70].date.year);
//print_one_week(rend, edt, 112, d1);
/*
edt[9].group = 1;
edt[9].mat = INFO;
edt[9].name = "Rapin";
edt[20].group = 1;
edt[20].mat = PHYSICS;
edt[13].group = 1;
edt[13].mat = ENGLISH;
edt[13].name = "Rapin";
edt[21].group = 1;
edt[21].mat = MATH;
if(is_allowed_MP2I(edt,len_creneau, 1, d1)) {
printf("Score : %d\n", heuristique_MP2I(edt, 112, 1, d1));
}
*/
// {char* name; int namelen; topic mat; date* disp; int n_disp;} colleur;
generate_colles_v1(edt, len_creneau, dudes, n_colleurs, 7, 4);
//generate_colles_v1(edt, len_creneau, dudes, n_colleurs, 15, 4);
/*
date d1 = {19, 1, 3, 2024};
date d2 = {18, 1, 4, 2024};
printf("%d\n", date_dist(d1, d2));
*/
free(edt);
SDL_DestroyRenderer(rend);
SDL_DestroyWindow(win);
SDL_Quit();
return 0;
}