summaryrefslogtreecommitdiffstats
path: root/atc
diff options
context:
space:
mode:
authorrillig <rillig@NetBSD.org>2021-02-21 20:33:42 +0000
committerCameron Katri <me@cameronkatri.com>2021-04-13 15:28:33 -0400
commit6535b2e014adf4ec8033eaf18a55e8476d124cda (patch)
tree0358a9a7bd9da6d6150fb2abe872d48b5effe236 /atc
parenteddba41ef6625aba9839b88ff828073e89008051 (diff)
downloadbsdgames-darwin-6535b2e014adf4ec8033eaf18a55e8476d124cda.tar.gz
bsdgames-darwin-6535b2e014adf4ec8033eaf18a55e8476d124cda.tar.zst
bsdgames-darwin-6535b2e014adf4ec8033eaf18a55e8476d124cda.zip
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.
Diffstat (limited to 'atc')
0 files changed, 0 insertions, 0 deletions