From 477b275886c63ed5826a9eec6ba81c8a209970ca Mon Sep 17 00:00:00 2001 From: girst Date: Thu, 29 Mar 2018 03:02:33 +0200 Subject: [PATCH] crude patch for >999 mines --- mines_2017.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mines_2017.c b/mines_2017.c index 1138aac..757c27c 100644 --- a/mines_2017.c +++ b/mines_2017.c @@ -666,6 +666,7 @@ void partial_show_minefield (int l, int c, int mode) { void show_minefield (int mode) { int dtime; + int n; /* determine size of variable width fields */ static char modechar[] = {'*', '!', '?'}; move (0,0); @@ -682,8 +683,8 @@ void show_minefield (int mode) { printf ("%s\r\n", op.scheme->border_top_r); /* second line */ print (op.scheme->border_status_l); - printf("[%03d]", f.m - f.f); //TODO: breaks layout if >999 mines - printm (f.w*op.scheme->cell_width/2-6, " "); + n = printf("[%03d]", f.m - f.f); //TODO: breaks layout if >999 mines + printm (f.w*op.scheme->cell_width/2-(n+1), " "); printf ("%s", mode==SHOWMINES?everything_opened()? EMOT(WON) : EMOT(DEAD) : EMOT(SMILE)); printm (f.w*op.scheme->cell_width/2-6-4, " "); -- 2.39.3