diff options
author | Olivier Gayot <duskcoder@gmail.com> | 2017-12-28 21:30:20 +0100 |
---|---|---|
committer | Olivier Gayot <duskcoder@gmail.com> | 2017-12-28 21:31:01 +0100 |
commit | 54f40f6cb863f00fbcaa77ebdb930d8d7fc6988d (patch) | |
tree | 0757b1da4f95b1096877fcbd101ef7edf923b4ce /src/flag.c |
Imported the code into Git
Signed-off-by: Olivier Gayot <duskcoder@gmail.com>
Diffstat (limited to 'src/flag.c')
-rw-r--r-- | src/flag.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/flag.c b/src/flag.c new file mode 100644 index 0000000..9201cac --- /dev/null +++ b/src/flag.c @@ -0,0 +1,26 @@ +/* +** flag.c for in /home/gayot_o/prog/minesweeper +** +** Made by olivier gayot +** Login <gayot_o@epitech.net> +** +** 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; +} |