summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Fix merge conflictsHEADtrunkCameron Katri2021-05-054-9/+9
|
* games: remove trailing whitespace in *.c and *.hrillig2021-05-05120-1799/+1799
|
* countmail: remove outdated commentsrillig2021-05-051-22/+3
| | | | | Using the shell builtin 'read' command was necessarily slow because it is specified to read a single byte at a time.
* fish: remove trailing whitespacerillig2021-05-051-6/+6
|
* fish: use arc4random_uniform for drawing random numbersrillig2021-05-051-25/+10
| | | | Thanks nia@ for the hint.
* fish: remove modulo bias from random number generationrillig2021-05-051-3/+8
| | | | | It probably doesn't matter in practice, but omitting this piece of code always looks like an oversight.
* cgram: rename local functionsrillig2021-05-051-7/+7
| | | | | | | The word 'cleanup' should have been named clean_up all along, but 'done' is even shorter. No functional change.
* caesar: WARNS=6, strict bool moderillig2021-05-051-6/+6
| | | | | The rotation is validated to be nonnegative, therefore use unsigned int for it.
* cgram: in hinting mode, show all correct characters in bold facerillig2021-05-052-7/+6
| | | | | For almost solved cryptograms, this makes the punctuation stand out less, helping to focus on the missing letters.
* Merge upstream (can't test, hopefully nothing broke)Cameron Katri2021-04-281-1/+1
|
* cgram: use ASCII-only implementation of <ctype.h> functionsrillig2021-04-281-19/+18
| | | | | | | 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.
* cgram: provide usage on incorrect invocationrillig2021-04-281-3/+15
|
* cgram: conform to lint's strict bool mode, KNFrillig2021-04-281-5/+7
|
* cgram: allow providing an input file instead of the random fortunewiz2021-04-282-19/+44
|
* Simplify syncing with upstreamCameron Katri2021-04-132-1/+16
|
* Fix warp compilationCameron Katri2021-04-131-4/+0
|
* avoid duplicating symbols in libterminfo.mrg2021-04-131-0/+4
|
* no longer need -Wno-error=implicit-fallthrough. don't provide common symbols ↵mrg2021-04-131-2/+6
| | | | that are in libterminfo now days.
* properly terminate after using strncpy().mrg2021-04-131-4/+5
|
* avoid leaving off the trailing nul in a literal string.mrg2021-04-131-3/+3
|
* cgram: don't beep if the window is resizedrillig2021-04-131-2/+4
|
* cgram: place the 'solved' marker nearer to the textrillig2021-04-131-4/+8
| | | | | | 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.
* cgram: make the 'solved' stand out morerillig2021-04-131-4/+8
| | | | | | Suggested by Weitian LI via [1]. [1] https://github.com/NetBSD/src/commit/efec6410b2b5a736
* cgram: fix assertion when substituting at the end of the longest linerillig2021-04-131-39/+30
| | | | | | | | | | | | | | | | | | | 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
* cgram: add advanced cursor movement with tab, shift+tab, returnrillig2021-04-131-49/+117
|
* cgram: properly handle input errorsrillig2021-04-131-3/+4
| | | | | | | | | 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.
* cgram: allow navigation with KEY_PPAGE and KEY_NPAGErillig2021-04-131-8/+12
|
* cgram: rewrite completely, fixing bugs and stylerillig2021-04-131-179/+286
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* cgram: WARNS=6, use int for all coordinatesrillig2021-04-131-47/+44
| | | | | | | Eliminate some frequently occurring subexpressions during substitution. No functional change, assuming that fortune(6) always spits out less than 2 gigacharacters of text.
* cgram: consistently use char for charactersrillig2021-04-131-12/+41
| | | | | | | | 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.
* cgram: fix undefined behavior when pressing function keysrillig2021-04-131-1/+1
| | | | | | 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.
* cgram: adjust style to survive lint's strict bool moderillig2021-04-131-16/+17
| | | | | | | The biggest change is the return type of substitute(). Before, 0 meant success, now false means failure. No functional change.
* cgram: sort includesrillig2021-04-131-5/+6
|
* cgram: indentrillig2021-04-131-262/+286
| | | | | | | | | | | | | | 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.
* cgram: fix Home key for cursor navigationrillig2021-04-131-1/+1
| | | | Reported by liweitianux via GitHub.
* Fix circle depCameron Katri2021-04-091-1/+1
|
* Fix darwin-amd64Cameron Katri2021-04-061-0/+1
|
* Use PREFIX nowCameron Katri2021-03-2887-222/+281
|
* Get all the games compiling for iOSCameron Katri2021-02-22152-107873/+237505
|
* - Don't allocate memory dynamically on the stack (for SSP)christos2021-01-081-44/+57
| | | | - Don't return errno as exit code - Fold long lines
* set the cursor to invisiblejmcneill2021-01-021-1/+2
|
* trailing whitespacejmcneill2021-01-021-17/+17
|
* Markup/typo fixes.wiz2021-01-021-4/+3
|
* Add testpat(6) to games.nat2021-01-024-2/+519
| | | Testpat displays a test pattern in curses(3).
* speed limit 80dholland2020-12-061-3/+8
|
* speed limit 80dholland2020-12-061-9/+24
|
* roundsleep(): Too many zeros; tv_nsec should be compared withrin2020-11-211-1/+1
| | | 500 msec, not 5000. Raised by clang for ILP32 archs.
* Avoid common symbols. Use __dead.joerg2020-11-125-7/+9
|
* Comment out debugging build (it still randomly crashes though) pointed outchristos2020-11-111-2/+2
| | | by wiz
* use strchr, strrchr, random, more lint removal, savefile in /var/games/warpchristos2020-11-1111-93/+36
| | | not /usr/share/games/warp...