From 54f40f6cb863f00fbcaa77ebdb930d8d7fc6988d Mon Sep 17 00:00:00 2001 From: Olivier Gayot Date: Thu, 28 Dec 2017 21:30:20 +0100 Subject: Imported the code into Git Signed-off-by: Olivier Gayot --- src/flag.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 src/flag.c (limited to 'src/flag.c') 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 +** +** 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; +} -- cgit v1.2.3