CVS commit: src/games/cgram
Module Name:src Committed By: dholland Date: Fri May 28 03:55:46 UTC 2021 Modified Files: src/games/cgram: cgram.c Log Message: I don't see any code I wrote left in here. To generate a diff of this commit: cvs rdiff -u -r1.24 -r1.25 src/games/cgram/cgram.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/games/cgram
Module Name:src Committed By: dholland Date: Fri May 28 03:55:08 UTC 2021 Modified Files: src/games/cgram: cgram.c Log Message: Restore return value of main, arbitrarily thrown away in -r1.4. To generate a diff of this commit: cvs rdiff -u -r1.23 -r1.24 src/games/cgram/cgram.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/games/cgram
Module Name:src Committed By: rillig Date: Sat May 1 20:29:23 UTC 2021 Modified Files: src/games/cgram: cgram.c Log Message: cgram: rename local functions The word 'cleanup' should have been named clean_up all along, but 'done' is even shorter. No functional change. To generate a diff of this commit: cvs rdiff -u -r1.22 -r1.23 src/games/cgram/cgram.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/games/cgram
Module Name:src Committed By: rillig Date: Thu Apr 29 20:17:20 UTC 2021 Modified Files: src/games/cgram: cgram.6 cgram.c Log Message: 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. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/games/cgram/cgram.6 cvs rdiff -u -r1.21 -r1.22 src/games/cgram/cgram.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/games/cgram
Module Name:src Committed By: rillig Date: Sun Apr 25 20:38:03 UTC 2021 Modified Files: src/games/cgram: cgram.c Log Message: cgram: use ASCII-only implementation of functions The function 'encode' already assumes that all letter characters are contiguous and that there are only 26 letters of each case. At the moment, cgram cannot handle UTF-8 anyway since it reads the input byte-wise, assuming that each byte is exacty one character. To generate a diff of this commit: cvs rdiff -u -r1.20 -r1.21 src/games/cgram/cgram.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/games/cgram
Module Name:src Committed By: rillig Date: Sun Apr 25 20:19:19 UTC 2021 Modified Files: src/games/cgram: cgram.c Log Message: cgram: provide usage on incorrect invocation To generate a diff of this commit: cvs rdiff -u -r1.19 -r1.20 src/games/cgram/cgram.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/games/cgram
Module Name:src Committed By: rillig Date: Sun Apr 25 20:14:29 UTC 2021 Modified Files: src/games/cgram: cgram.c Log Message: cgram: conform to lint's strict bool mode, KNF To generate a diff of this commit: cvs rdiff -u -r1.18 -r1.19 src/games/cgram/cgram.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/games/cgram
Module Name:src Committed By: wiz Date: Thu Apr 22 14:57:36 UTC 2021 Modified Files: src/games/cgram: cgram.6 cgram.c Log Message: cgram: allow providing an input file instead of the random fortune To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/games/cgram/cgram.6 cvs rdiff -u -r1.17 -r1.18 src/games/cgram/cgram.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/games/cgram
Module Name:src Committed By: rillig Date: Fri Feb 26 15:18:40 UTC 2021 Modified Files: src/games/cgram: cgram.c Log Message: cgram: don't beep if the window is resized To generate a diff of this commit: cvs rdiff -u -r1.16 -r1.17 src/games/cgram/cgram.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/games/cgram
Module Name:src Committed By: rillig Date: Fri Feb 26 15:15:34 UTC 2021 Modified Files: src/games/cgram: cgram.c Log Message: cgram: place the 'solved' marker nearer to the text This way, it cannot be overlooked as easily as before. It also doesn't change the position of the keyboard help text anymore. Only if there is not enough space, the 'solved' marker is put into the bottom line. To generate a diff of this commit: cvs rdiff -u -r1.15 -r1.16 src/games/cgram/cgram.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/games/cgram
Module Name:src Committed By: rillig Date: Fri Feb 26 14:55:37 UTC 2021 Modified Files: src/games/cgram: cgram.c Log Message: cgram: make the 'solved' stand out more Suggested by Weitian LI via [1]. [1] https://github.com/NetBSD/src/commit/efec6410b2b5a736 To generate a diff of this commit: cvs rdiff -u -r1.14 -r1.15 src/games/cgram/cgram.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/games/cgram
Module Name:src Committed By: rillig Date: Mon Feb 22 19:34:07 UTC 2021 Modified Files: src/games/cgram: cgram.c Log Message: cgram: fix assertion when substituting at the end of the longest line Reported by Weitian LI via GitHub. Contrary to the patch suggested in [1], still allow the cursor to be placed to the very right of the text in a line since that is the usual behavior of text editors. Split the function substitute() into two parts: one that handles the curses-specific part of checking whether a substitution is possible at the current cursor position, and one that performs the actual substitution. Only the latter is kept in the code section for the string manipulation functions, the other is moved to the section for curses code. Having all the curses code in one place reduces the places that call beep(). Previously, as well as now, there is a single beep per invalid key before, but that was not obvious from the previous code. [1]: https://github.com/DragonFlyBSD/DragonFlyBSD/commit/18d09f18cf4c To generate a diff of this commit: cvs rdiff -u -r1.13 -r1.14 src/games/cgram/cgram.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/games/cgram
Module Name:src Committed By: rillig Date: Mon Feb 22 17:36:42 UTC 2021 Modified Files: src/games/cgram: cgram.c Log Message: cgram: add advanced cursor movement with tab, shift+tab, return To generate a diff of this commit: cvs rdiff -u -r1.12 -r1.13 src/games/cgram/cgram.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/games/cgram
Module Name:src Committed By: rillig Date: Mon Feb 22 16:28:20 UTC 2021 Modified Files: src/games/cgram: cgram.c Log Message: cgram: properly handle input errors On both NetBSD and Cygwin, a missing /usr/bin/fortune would previously continue since popen does not return an error (as /bin/sh is found and can be executed), so the next chance to catch an error is pclose. At that point, the shell has already printed an informative error message about what happened (or what didn't happen), so that cgram does not need to print an error by itself. To generate a diff of this commit: cvs rdiff -u -r1.11 -r1.12 src/games/cgram/cgram.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/games/cgram
Module Name:src Committed By: rillig Date: Sun Feb 21 22:21:56 UTC 2021 Modified Files: src/games/cgram: cgram.c Log Message: cgram: allow navigation with KEY_PPAGE and KEY_NPAGE To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 src/games/cgram/cgram.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/games/cgram
Module Name:src Committed By: rillig Date: Sun Feb 21 20:33:43 UTC 2021 Modified Files: src/games/cgram: cgram.c Log Message: cgram: rewrite completely, fixing bugs and style Fixed bugs: Do not consider the puzzle solved if all letters in the visible area are substituted correctly. To be properly solved, the whole puzzle must be solved, even those parts that are currently off-screen. Never place the cursor at the very right edge of the screen since that does not work well with some terminals. The maximum valid x coordinate is COLS - 1. Add horizontal scrolling. Make all coordinate handling symmetric in regard to the horizontal and vertical axes. Previously, lines longer than 80 characters could not be seen on the screen. Improvements: Remove the arbitrary limit of 128 characters per line. Even if fortune(6) may never generate such long lines, the code is easy enough to adapt to other sources. Properly clean up the allocated memory. Previously, only the string arrays were freed but not the strings themselves. Stylistic: Add RCS ID. Fix ctype functions in lint's strict bool mode. Avoid excessive calls to strlen whenever the cursor moves. Given that the whole screen is redrawn every time a key is pressed, this is an unnecessary optimization, but the code smelled nevertheless. To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.10 src/games/cgram/cgram.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/games/cgram
Module Name:src Committed By: rillig Date: Sun Feb 21 17:16:00 UTC 2021 Modified Files: src/games/cgram: Makefile cgram.c Log Message: cgram: WARNS=6, use int for all coordinates Eliminate some frequently occurring subexpressions during substitution. No functional change, assuming that fortune(6) always spits out less than 2 gigacharacters of text. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/games/cgram/Makefile cvs rdiff -u -r1.8 -r1.9 src/games/cgram/cgram.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/games/cgram
Module Name:src Committed By: rillig Date: Sun Feb 21 16:50:58 UTC 2021 Modified Files: src/games/cgram: cgram.c Log Message: cgram: consistently use char for characters Having to convert back and forth between char, unsigned char and int is confusing. Just stay with char, until the support for wide characters is added. No functional change. To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 src/games/cgram/cgram.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/games/cgram
Module Name:src Committed By: rillig Date: Sun Feb 21 16:37:26 UTC 2021 Modified Files: src/games/cgram: cgram.c Log Message: cgram: fix undefined behavior when pressing function keys The key codes for function keys are outside of the "range representable by an unsigned char". This resulted in parts of the screen being cleaned. To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/games/cgram/cgram.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/games/cgram
Module Name:src Committed By: rillig Date: Sun Feb 21 16:05:44 UTC 2021 Modified Files: src/games/cgram: Makefile cgram.c Log Message: cgram: adjust style to survive lint's strict bool mode The biggest change is the return type of substitute(). Before, 0 meant success, now false means failure. No functional change. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/games/cgram/Makefile cvs rdiff -u -r1.5 -r1.6 src/games/cgram/cgram.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/games/cgram
Module Name:src Committed By: rillig Date: Sun Feb 21 15:42:21 UTC 2021 Modified Files: src/games/cgram: cgram.c Log Message: cgram: sort includes To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/games/cgram/cgram.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/games/cgram
Module Name:src Committed By: rillig Date: Sun Feb 21 15:41:04 UTC 2021 Modified Files: src/games/cgram: cgram.c Log Message: cgram: indent With manual corrections afterwards: - indent removes empty lines between statement and declaration. This had been a syntax error in C90, since C99 this is common style and should be accepted by indent. - indent didn't format the first line of main for whatever reason, did that manually. - indent removed the empty line above the '/' separators. It should have left these empty lines as-is. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/games/cgram/cgram.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/games/cgram
Module Name:src Committed By: rillig Date: Sun Feb 21 13:35:37 UTC 2021 Modified Files: src/games/cgram: cgram.c Log Message: cgram: fix Home key for cursor navigation Reported by liweitianux via GitHub. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/games/cgram/cgram.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/games/cgram
Module Name:src Committed By: rillig Date: Thu Jul 2 19:11:01 UTC 2020 Modified Files: src/games/cgram: cgram.c Log Message: cgram(6): use standard cursor keys, use standard shuffle algorithm The previous shuffle algorithm asked for 100 random numbers, on average. The new algorithm asks exactly for 26 random numbers. Curses predefines numeric constants for keys, and there is no apparent reason not to use these standard keys for cursor movement. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/games/cgram/cgram.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/games/cgram
Module Name:src Committed By: wiz Date: Sun Aug 4 07:55:09 UTC 2013 Modified Files: src/games/cgram: cgram.6 Log Message: Add RCS Id. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/games/cgram/cgram.6 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/games/cgram
Module Name:src Committed By: dholland Date: Sun Aug 4 05:42:47 UTC 2013 Added Files: src/games/cgram: Makefile cgram.6 cgram.c pathnames.h Log Message: Add a curses gizmo for solving Sunday-paper-type cryptograms based on substitution ciphers. It gets the cleartext from fortune. I wrote this some years ago for my own amusement; a couple people have suggested that I should import it. Approved only by groo, so I'm going to wait a couple days to hook it to the build in case anyone demands it be removed again... To generate a diff of this commit: cvs rdiff -u -r0 -r1.1 src/games/cgram/Makefile src/games/cgram/cgram.6 \ src/games/cgram/cgram.c src/games/cgram/pathnames.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.