Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/games/gomoku gomoku: highlight the last played move



details:   https://anonhg.NetBSD.org/src/rev/7aa3dccd4791
branches:  trunk
changeset: 366169:7aa3dccd4791
user:      rillig <rillig%NetBSD.org@localhost>
date:      Mon May 16 22:03:16 2022 +0000

description:
gomoku: highlight the last played move

diffstat:

 games/gomoku/bdisp.c |  11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diffs (32 lines):

diff -r 02b6038d65b2 -r 7aa3dccd4791 games/gomoku/bdisp.c
--- a/games/gomoku/bdisp.c      Mon May 16 21:53:41 2022 +0000
+++ b/games/gomoku/bdisp.c      Mon May 16 22:03:16 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bdisp.c,v 1.26 2022/05/16 21:48:45 rillig Exp $        */
+/*     $NetBSD: bdisp.c,v 1.27 2022/05/16 22:03:16 rillig Exp $        */
 
 /*
  * Copyright (c) 1994
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)bdisp.c    8.2 (Berkeley) 5/3/95";
 #else
-__RCSID("$NetBSD: bdisp.c,v 1.26 2022/05/16 21:48:45 rillig Exp $");
+__RCSID("$NetBSD: bdisp.c,v 1.27 2022/05/16 22:03:16 rillig Exp $");
 #endif
 #endif /* not lint */
 
@@ -178,7 +178,12 @@
                                        c = '.';
                        } else
                                c = pcolor[sp->s_occ];
-                       addch(c);
+                       if (movenum > 1 && movelog[movenum - 2] == PT(i, j)) {
+                               attron(A_BOLD);
+                               addch(c);
+                               attroff(A_BOLD);
+                       } else
+                               addch(c);
                }
        }
        refresh();



Home | Main Index | Thread Index | Old Index