/* ** flag.c for in /home/gayot_o/prog/minesweeper ** ** Made by olivier gayot ** Login ** ** Started on Sun Apr 22 19:02:49 2012 olivier gayot ** Last update Sun Apr 22 19:02:49 2012 olivier gayot */ #include "minesweeper.h" int flag(map_t *map, int *selection) { case_t *case_ = &map->tab[*selection / BLOCK_W][*selection % BLOCK_W]; if (!case_->hidden) return 0; case_->flagged = (case_->flagged) ? false : true; if (case_->flagged) ++g_flags; else --g_flags; dsp_ribbon_flags(); show_map(map); return 0; }