Source-Changes-HG archive

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

[src/trunk]: src/games/cgram cgram: in hinting mode, show all correct charact...



details:   https://anonhg.NetBSD.org/src/rev/fe2299ff3273
branches:  trunk
changeset: 982863:fe2299ff3273
user:      rillig <rillig%NetBSD.org@localhost>
date:      Thu Apr 29 20:17:20 2021 +0000

description:
cgram: in hinting mode, show all correct characters in bold face

For almost solved cryptograms, this makes the punctuation stand out
less, helping to focus on the missing letters.

diffstat:

 games/cgram/cgram.6 |  6 +++---
 games/cgram/cgram.c |  7 +++----
 2 files changed, 6 insertions(+), 7 deletions(-)

diffs (55 lines):

diff -r e2dbc4669044 -r fe2299ff3273 games/cgram/cgram.6
--- a/games/cgram/cgram.6       Thu Apr 29 17:55:51 2021 +0000
+++ b/games/cgram/cgram.6       Thu Apr 29 20:17:20 2021 +0000
@@ -1,4 +1,4 @@
-.\" $NetBSD: cgram.6,v 1.3 2021/04/22 14:57:36 wiz Exp $
+.\" $NetBSD: cgram.6,v 1.4 2021/04/29 20:17:20 rillig Exp $
 .\"
 .\" Copyright (c) 2004, 2013 The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -27,7 +27,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd April 22, 2021
+.Dd April 29, 2021
 .Dt CGRAM 6
 .Os
 .Sh NAME
@@ -55,7 +55,7 @@
 to quit.
 Press asterisk
 .Pq *
-to enter an easier mode where correct letters are displayed in
+to enter an easier mode where correct characters are displayed in
 boldface.
 .Sh SEE ALSO
 .Xr caesar 6
diff -r e2dbc4669044 -r fe2299ff3273 games/cgram/cgram.c
--- a/games/cgram/cgram.c       Thu Apr 29 17:55:51 2021 +0000
+++ b/games/cgram/cgram.c       Thu Apr 29 20:17:20 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cgram.c,v 1.21 2021/04/25 20:38:03 rillig Exp $ */
+/* $NetBSD: cgram.c,v 1.22 2021/04/29 20:17:20 rillig Exp $ */
 
 /*-
  * Copyright (c) 2013, 2021 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include <sys/cdefs.h>
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: cgram.c,v 1.21 2021/04/25 20:38:03 rillig Exp $");
+__RCSID("$NetBSD: cgram.c,v 1.22 2021/04/29 20:17:20 rillig Exp $");
 #endif
 
 #include <assert.h>
@@ -348,8 +348,7 @@
                for (int x = 0; x < max_x; x++) {
                        char ch = line[offset_x + x];
                        bool bold = hinting &&
-                           ch == solline[offset_x + x] &&
-                           ch_isalpha(ch);
+                           (ch == solline[offset_x + x] || !ch_isalpha(ch));
 
                        if (bold)
                                attron(A_BOLD);



Home | Main Index | Thread Index | Old Index