summaryrefslogtreecommitdiff
path: root/games
AgeCommit message (Collapse)Author
2023-07-01tetris(6): Support the informal standard of allowing setting NO_COLORnia
in the environment to disable the use of color. (no-color.org)
2023-06-03bsd.own.mk: rename GCC_NO_* to CC_WNO_*lukem
Rename compiler-warning-disable variables from GCC_NO_warning to CC_WNO_warning where warning is the full warning name as used by the compiler. GCC_NO_IMPLICIT_FALLTHRU is CC_WNO_IMPLICIT_FALLTHROUGH Using the convention CC_compilerflag, where compilerflag is based on the full compiler flag name.
2023-06-01fix various typos in comments.andvar
2023-06-01add 2004's "@" definition.mrg
2023-05-28add a fortunedholland
2023-05-12When using -H, make the appearance of the worm head depend upon the bodykre
(more than it did before).
2023-05-10cgram: replace comments with coderillig
No binary change.
2023-05-09Handle OpenSSL-3.xchristos
2023-04-26Add a little optional colour, optionally distinguish worm heads,kre
and optionally randomise worm lengths. Just exit instead of continuing with a nonsense display if the window shrinks (and for consistency if it grows). Most of the ideas and code from RVP. Bugs and man page mangling from me.
2023-04-19Another err message typo! (found this one myself!!)kre
2023-04-19Typo in an error message (pointed out by RVP; Thanks)kre
2023-04-18Correct some unfortunate behaviour in extreme cases pointed out by RVP.kre
(Very long worms in a smallish window could result in the max number of worms being 0...) While here (also suggested by RVP) seed the random number generator, also add a -S option to set the seed (note: while this is documented in the updated man page, it does not appear in the usage message in case of an error ... not likely to be used often enough to include there). Also some minor improvements suggested by RVP: delete the prototype for main() exit curses mode before abort() (which should not happen, but...) no need to return (->exit) after abort() as modern abort() can never return. In addition, check for extraneous (ignored) (non-option) args. Check for absurdly small or big screens (the worm placement algorithm doesn't work well for lines of columns < 3, and the abort() mentioned above actually happens if one of those is == 1). More flavours of worms added. Some minor man page wording improvements.
2023-04-15When worms default delay was changed from 0, to 20ms (Oct 2020)kre
it lost the ability to run flat out (no sleeps) - which while not very useful for actually observing the behaviour of various Nematoda, can be useful when 'worms' is being used to generate cpu heat - it turns out to be a simple tool to make all of the app itself, the xterm it runs in (when running under X) and the X server, all more or less continuously busy - a trivial perpetual CPU load generator. Changing that was not a simple matter of just allowing -d 0..1000 rather than -d 1..1000 which had always been the limits on -d, as previously, simply by excluding 0, common error checking wasn't essential. -djunk would return 0 which was invalid, and so an error - that it was invalid because 0 < 1, rather than because "junk" is not a number wasn't material. Now we need some slightly more elaborate error checking code for the -d value, and if we're going to do that, may as well do the same for the -l and -n options, which also take numeric values. That is, it will no longer be possible to say: worms -n "5 worms" Just the number is allowed (but -d now allows a "ms" or "us" suffix). While here, place a reasonable upper limit (depending upon the screen size, and worm length) upon the number of worms, so they have somewhere to go, rather than just on top of each other. exit(1) from the errx() rather than 0, in the case that curses initscr() fails (doesn't seem right that it should appear as a successful run of worms, if it never managed to start). A couple more minor 80 column violations are handled, without further penalty, in this update (one simply vanishes, the other is wrapped). Note that this sounds like a lot, but it is really all just minor internal bookkeeping updates - the only real advertised user visible change is the ability to use -d0 which just restores that which was the default (though it could never be set via the option) until Oct 2020 - so really all that's happening is replacing minor functionality lost then, while leaving the change of the default delay that that change made, untouched. No man page update required (that never excluded -d0).
2023-04-1580 column police.kre
If this code were just a few chars over the limit, it might get let off with a warning, but 214 in an 80 zone is way beyond that. Six months loss of coding licence, and a 214000 character fine. NFCI. (I verified the the code was unchanged by joining the resulting lines back into one again, and then diff'ing that line against the original - it is identical).
2023-04-15Garbage collect "char *mp" - it used to point at memory malloc()'dkre
to hold the termcap entry, back when worms used termcap rather than curses, and termcap was termcap, rather that a terminfo wannabe. This should have been removed when worms was converted to curses in 1999, but wasn't, so worms has been doing a meaningless malloc(1024) and never using the result, ever since. While here, since the line needed changing anyway to remove mp, change a malloc() of a product into calloc() so it can deal with any possible (admittedly extremely unlikely here) integer overflows. NFCI
2023-01-22quiz: fix wrong usage of the <ctype.h> functionsrillig
2023-01-06Define yes as extern veriable to fix buildryoon
PR bin/57164 is insufficient.
2023-01-06PR/57164: Greywolf: Add -y to cribbage to keep playing without askingchristos
2022-10-25-h doesn't sort numerically, pointed out by variousnia
2022-10-25various tips/simplifications from UnitedBSDnia
2022-09-09fortunes: add somethingdholland
2022-08-26fortunes: add somethingdholland
2022-08-19ching(6): Fix formatting. .Pp is not .bruwe
The man returns to the proper path. Auspicious.
2022-08-07fix various typos in comments, documentation and messages.andvar
mainly s/paramater/parameter/ and s/reduntant/redundant/.
2022-06-28fix references in manual pages to the reference documentationrillig
2022-06-27fix various typos in comments.andvar
2022-06-27Enable FANCY mode for debugging purposes:christos
- To enable stand still mode (robot is not moving but waiting in place), specify a scorefile on the command line called <directory>/stand_still - To enable pattern roll mode (robot is changing which move to look first) specify a scorefile on the command line called <directory>/pattern_roll
2022-06-19gomoku: remove redundant parenthesesrillig
No binary change.
2022-06-19gomoku: reduce usage of magic numbers in the coderillig
No binary change.
2022-06-12cgram: allow cursor navigation with KEY_BEG as wellrillig
2022-05-31Elide vax breakagechristos
2022-05-29gomoku: clean up variable names, add empty linesrillig
No binary change.
2022-05-29gomoku: clean up color handling in 'pickmove'rillig
Instead of searching for the best black and white moves, search instead for our and their best moves. This makes the code simpler and more uniform, as the strategy is the same for Black and White. No functional change.
2022-05-29gomoku: clean up 'pickmove' stylisticallyrillig
No functional change.
2022-05-29gomoku: migrate remaining functions to type player_colorrillig
No functional change.
2022-05-29gomoku: make parsing of the debug command 'o' robustrillig
Previously, the (invalid) debug command 'o,' succeeded to parse and led to out-of-bounds memory access. Add proper parsing for the arguments of that debug command. Add a short usage for that debug command, as guessing the usage from the previous code was time-consuming due to the large amount of ad-hoc low-level parsing code. When leaving debug mode, clear the debug prompt.
2022-05-29gomoku: clean up overlap info in 'checkframes'rillig
In 2009, GCC had complained that the overlap_info might only be partially filled. All possible code paths are sane though, so that was probably a bug in GCC. Remove the comment and the unnecessary initialization, rename the variable since it doesn't match its behavior anymore. Sync nearby comments with reality; there is no array anywhere near. No functional change.
2022-05-29gomoku: do not scan the upper border for combosrillig
Adding the '+ 1' to the row coordinate added an offset of 20, while the intended offset was 1. No functional change, just a bit faster.
2022-05-29gomoku: refine the type of some functions and variablesrillig
Assisted by WARNS=6. At that level, there are several warnings about type conversion between small integer types that would only clutter the code, therefore stay at WARNS=5. Same for lint's -aa option. No functional change.
2022-05-29gomoku: when starting a new game, start in the middle of the boardrillig
Previously, when starting a new game, the user coordinate was kept at the previously selected spot. Since playing in the center is common sense, reset the coordinate.
2022-05-29gomoku: after accepting a spot via the mouse, clear current coordinaterillig
2022-05-29gomoku: add type player_colorrillig
No functional change.
2022-05-29gomoku: use unsigned integers for bit setsrillig
As all access to the bit sets happens through the unsigned spot_index type, drop the type casts in the macros. No functional change on 2s complement machines.
2022-05-29gomoku: provide a more gentle introduction to the coderillig
No binary change.
2022-05-29gomoku: don't use 'i' as special-purpose variable namerillig
No binary change.
2022-05-29gomoku: consistently name the offset of a spot in a frame 'off'rillig
Leave 'i' for general purpose loops. No functional change.
2022-05-29gomoku: add data type for one of the 4 directions of a framerillig
No functional change.
2022-05-29gomoku: clean up four_in_a_rowrillig
No functional change.
2022-05-29gomoku: extract quick_check from scanframesrillig
No functional change.
2022-05-29gomoku: use proper types when indexing 'board' and 'frames'rillig
No functional change.