Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void game_restart(game g) {
- g->tab=g->const_tab;
- g->nb_moves_cur=0;
- }
- bool game_is_over(cgame g) {
- int s = game_nb_moves_max(g);
- bool same = true;
- int x = 0;
- while (same == true && x<s){
- for (int y = 0;y<s;y++){
- if (game_cell_current_color(g,0,0) != game_cell_current_color(g,x,y)){
- same = false;
- }
- }
- x++;
- }
- return same;
- }
- void game_delete(game g) {
- if(g->tab == NULL && g==NULL){
- printf("jeu deja vide");
- }
- else{
- free(g->tab);
- free(g->const_tab);
- free(g);
- g=NULL;
- g->tab=NULL;
- g->const_tab=NULL;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement