History log of /netbsd-current/games/gomoku/bdisp.c
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 1.55 29-May-2022 rillig

gomoku: refine the type of some functions and variables

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.


# 1.54 29-May-2022 rillig

gomoku: when starting a new game, start in the middle of the board

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.


# 1.53 29-May-2022 rillig

gomoku: after accepting a spot via the mouse, clear current coordinate


# 1.52 29-May-2022 rillig

gomoku: don't use 'i' as special-purpose variable name

No binary change.


# 1.51 29-May-2022 rillig

gomoku: use consistent variable names

Previously, the name 's' was used for the index of a spot on the board,
as well as for the value of a combo, and for a few other purposes. Use
different names and mark the spot indexes using a custom type.

No binary change.


# 1.50 28-May-2022 rillig

gomoku: remove redundant parentheses, braces, newlines, clean up get_key

No functional change.


# 1.49 28-May-2022 rillig

gomoku: highlight the winning frame


# 1.48 28-May-2022 rillig

gomoku: group movelog and nmoves into a game struct

No functional change.


# 1.47 27-May-2022 rillig

gomoku: replace 1-based movenum with 0-based nmoves

No functional change, not even the TIE that is wrongly announced when
the very last spot on the board is yet to be filled by Black. Even
without this off-by-one error, it could be that filling the very last
spot completes a frame, so that code has been wrong all the time.

In practical terms, this situation only arises when the human player is
unconcentrated or the computer player has a bad strategy. The latter
may well be, as the computer moves in the (boring) endgame are not
directed towards winning -- they fill irrelevant spots before relevant
ones.


# 1.46 22-May-2022 rillig

gomoku: add mouse support

NetBSD 10 provides the mouse handling functions from <curses.h> but does
not actually implement the mouse handling. For the benefit of other
platforms, add mouse support; when linked with ncurses instead of
curses, it works.

Depending on the input device, mouse clicks are either reported as
"button 1 clicked" (mouse) or "button 1 pressed/released" (touchpad);
support both.

Be strict about the X coordinate when clicking. Since the coordinates
are integer numbers, getting the location between two spots is
ambiguous, as it could be just one pixel away or right in the middle of
the space between the spots.


# 1.45 22-May-2022 rillig

gomoku: clean up coordinate calculations in get_coord

No functional change.


# 1.44 22-May-2022 rillig

gomoku: make coordinates in get_coord 1-based

The rest of the game has 1-based coordinates as well.

No functional change.


# 1.43 22-May-2022 rillig

gomoku: extract save_game from main

No functional change.


# 1.42 21-May-2022 rillig

gomoku: right-align column header for move number


# 1.41 21-May-2022 rillig

gomoku: move comments closer to their corresponding entities

No binary change.


# 1.40 21-May-2022 rillig

gomoku: warn before overwriting a saved game file


# 1.39 21-May-2022 rillig

gomoku: do not accept overly long lines from the input

Typing beyond the screen and then pressing and holding backspace still
removes the prompt, just as before.


# 1.38 21-May-2022 rillig

gomoku: fix deleting a character when reading a line


# 1.37 21-May-2022 rillig

gomoku: make drawing the player's names simpler

No functional change.


# 1.36 19-May-2022 rillig

gomoku: use combined curses functions

To save some screen space in the source code and some bytes in the
generated binary.

No functional change.


# 1.35 19-May-2022 rillig

gomoku: clean up coordinate for the currently selected spot

There is no need to make this coordinate dependent on the board size.

No binary change.


# 1.34 19-May-2022 rillig

gomoku: clean up version control sections

Lint can handle these definitions, and the '#if 0' is redundant.

No functional change.


# 1.33 19-May-2022 rillig

gomoku: replace magic numbers with proper coordinate calculation


# 1.32 19-May-2022 rillig

gomoku: properly center the player's names


# 1.31 19-May-2022 rillig

gomoku: de-obfuscate screen coordinate calculation

Modern compilers optimize linear integer arithmetic, so there is no
reason to use strange or misleading formulas.

Replace several magic numbers with proper formulas.

No binary change.


# 1.30 19-May-2022 rillig

gomoku: fix error message for small screen

- gomoku: Screen too small (need 8018d)
+ gomoku: Screen too small (need 80x24)


# 1.29 19-May-2022 rillig

gomoku: fix type mismatch in call to curses function

Not yet detected by lint, as lint is more permissive for type mismatches
if the value is a constant 0. Being permissive doesn't make sense in
this case. Now the calls to 'keypad' and 'leaveok' are consistent.

No binary change.


# 1.28 18-May-2022 rillig

gomoku: reduce scope of 'for' loop variables

No binary change.


# 1.27 16-May-2022 rillig

gomoku: highlight the last played move


# 1.26 16-May-2022 rillig

gomoku: enable lint's strict bool mode

No functional change.


# 1.25 16-May-2022 rillig

gomoku: fix most lint warnings in -DDEBUG mode

No binary change.


# 1.24 16-May-2022 rillig

gomoku: prepare lint's strict bool mode

No binary change.


# 1.23 16-May-2022 rillig

gomoku: fix lint warnings

Most warnings were about implicit conversions from ptrdiff_t to int; add
explicit cast for them, as they are far from overflowing int.

The casts from one pointer type to 'struct combostr **' were indeed
suspicious. In these cases, a single region of memory is allocated to
store two objects of different type, without declaring a struct type for
their combination. The second object is an array of variable size.

No binary change.


# 1.22 15-May-2022 rillig

gomoku: inline macros BSZ1, BSZ2, BSZ3, BSZ4

These macro names didn't convey any meaning, so replace them with their
replacement text, to have fewer identifiers to worry about.

No binary change.


# 1.21 15-May-2022 rillig

gomoku: remove redundant parentheses around return values

No binary change.


# 1.20 15-May-2022 rillig

gomoku: apply some style fixes towards KNF

There are still parts of the code that use an indentation level of 4
instead of the usual 8. Fixing that right now would introduce more
unnatural line breaks, so defer that until later.

No binary change.


# 1.19 14-May-2022 rillig

gomoku: clean up unused code and lint warnings

No binary change.


Revision tags: cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base
# 1.18 02-May-2021 rillig

games: remove trailing whitespace in *.c and *.h


Revision tags: netbsd-9-2-RELEASE netbsd-9-1-RELEASE phil-wifi-20200421 phil-wifi-20200411 is-mlppp-base phil-wifi-20200406 netbsd-8-2-RELEASE netbsd-9-0-RELEASE netbsd-9-0-RC2 netbsd-9-0-RC1 phil-wifi-20191119 netbsd-9-base phil-wifi-20190609 netbsd-8-1-RELEASE netbsd-8-1-RC1 pgoyette-compat-merge-20190127 pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 netbsd-7-2-RELEASE pgoyette-compat-0728 netbsd-8-0-RELEASE phil-wifi-base pgoyette-compat-0625 netbsd-8-0-RC2 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 netbsd-8-0-RC1 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 netbsd-7-1-2-RELEASE pgoyette-compat-base netbsd-7-1-1-RELEASE matt-nb8-mediatek-base perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 pgoyette-localcount-20170320 netbsd-7-1-RELEASE netbsd-7-1-RC2 netbsd-7-nhusb-base-20170116 bouyer-socketcan-base pgoyette-localcount-20170107 netbsd-7-1-RC1 pgoyette-localcount-20161104 netbsd-7-0-2-RELEASE localcount-20160914 netbsd-7-nhusb-base pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base netbsd-7-0-1-RELEASE netbsd-7-0-RELEASE netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 tls-maxphys-base
# 1.17 22-Mar-2014 dholland

move extern decls to .h files


Revision tags: riastradh-drm2-base3 riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base agc-symver-base yamt-pagecache-base8 yamt-pagecache-base7 yamt-pagecache-base6 yamt-pagecache-base5 yamt-pagecache-base4
# 1.16 18-Feb-2012 matt

branches: 1.16.2;
Fix conflicting variable definitions


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-1-5-RELEASE netbsd-6-1-4-RELEASE netbsd-6-0-5-RELEASE netbsd-6-1-3-RELEASE netbsd-6-0-4-RELEASE netbsd-6-1-2-RELEASE netbsd-6-0-3-RELEASE netbsd-6-1-1-RELEASE netbsd-6-0-2-RELEASE netbsd-6-1-RELEASE netbsd-6-1-RC4 netbsd-6-1-RC3 netbsd-6-1-RC2 netbsd-6-1-RC1 netbsd-6-0-1-RELEASE matt-nb6-plus-nbase netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 netbsd-6-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base cherry-xenmp-base bouyer-quota2-nbase bouyer-quota2-base matt-mips64-premerge-20101231
# 1.15 29-Mar-2010 dholland

branches: 1.15.6;
Some improvements to the new UI.


# 1.14 29-Mar-2010 dholland

Better user interface. From OpenBSD, written by Paul Janzen quite a
long time ago. A few minor adjustments by yours truly.


# 1.13 29-Mar-2010 dholland

Don't exit(0) on failure. Use errx() instead of fprintf.


Revision tags: matt-premerge-20091211
# 1.12 13-Jul-2009 roy

Rename internal getline() function to get_line() so it does
conflict with the soon to be added getline(3) libc function.


# 1.11 04-Jun-2009 dholland

Increase spending on vowels. No object file diffs.


# 1.10 04-Jun-2009 dholland

ANSIfy function declarations.x


Revision tags: netbsd-5-2-3-RELEASE netbsd-5-1-5-RELEASE netbsd-5-2-2-RELEASE netbsd-5-1-4-RELEASE netbsd-5-2-1-RELEASE netbsd-5-1-3-RELEASE netbsd-5-2-RELEASE netbsd-5-2-RC1 netbsd-5-1-2-RELEASE netbsd-5-1-1-RELEASE matt-nb5-mips64-premerge-20101231 matt-nb5-pq3-base netbsd-5-1-RELEASE netbsd-5-1-RC4 matt-nb5-mips64-k15 netbsd-5-1-RC3 netbsd-5-1-RC2 netbsd-5-1-RC1 netbsd-5-0-2-RELEASE matt-nb5-mips64-premerge-20091211 matt-nb5-mips64-u2-k2-k4-k7-k8-k9 matt-nb4-mips64-k7-u2a-k9b matt-nb5-mips64-u1-k1-k5 netbsd-5-0-1-RELEASE jym-xensuspend-nbase netbsd-5-0-RELEASE netbsd-5-0-RC4 netbsd-5-0-RC3 netbsd-5-0-RC2 jym-xensuspend-base netbsd-5-0-RC1 netbsd-5-base matt-mips64-base2 wrstuden-revivesa-base-3 wrstuden-revivesa-base-2
# 1.9 08-Aug-2008 drochner

if initscr() fails, exit with a message rather than crash in the
next curses call


Revision tags: netbsd-4-0-1-RELEASE wrstuden-fixsa-newbase wrstuden-revivesa-base-1 yamt-pf42-base4 yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-baseX yamt-pf42-base2 wrstuden-revivesa-base yamt-pf42-base keiichi-mipv6-base matt-armv6-nbase matt-armv6-prevmlocking wrstuden-fixsa-base-1 netbsd-4-0-RELEASE cube-autoconf-base netbsd-4-0-RC5 netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 netbsd-4-0-RC1 matt-armv6-base matt-mips64-base hpcarm-cleanup-base netbsd-3-1-1-RELEASE netbsd-3-0-3-RELEASE wrstuden-fixsa-base abandoned-netbsd-4-base netbsd-3-1-RELEASE netbsd-3-0-2-RELEASE netbsd-3-1-RC4 netbsd-3-1-RC3 netbsd-3-1-RC2 netbsd-3-1-RC1 netbsd-4-base netbsd-3-0-1-RELEASE netbsd-3-0-RELEASE netbsd-3-0-RC6 netbsd-3-0-RC5 netbsd-3-0-RC4 netbsd-3-0-RC3 netbsd-3-0-RC2 netbsd-3-0-RC1 netbsd-2-0-3-RELEASE netbsd-2-1-RELEASE netbsd-2-1-RC6 netbsd-2-1-RC5 netbsd-2-1-RC4 netbsd-2-1-RC3 netbsd-2-1-RC2 netbsd-2-1-RC1 netbsd-2-0-2-RELEASE netbsd-3-base netbsd-2-0-1-RELEASE netbsd-2-base netbsd-2-0-RELEASE netbsd-2-0-RC5 netbsd-2-0-RC4 netbsd-2-0-RC3 netbsd-2-0-RC2 netbsd-2-0-RC1 netbsd-2-0-base
# 1.8 07-Aug-2003 agc

branches: 1.8.32;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22269, verified by myself.


Revision tags: netbsd-1-6-PATCH002-RELEASE netbsd-1-6-PATCH002 netbsd-1-6-PATCH002-RC4 netbsd-1-6-PATCH002-RC3 netbsd-1-6-PATCH002-RC2 netbsd-1-6-PATCH002-RC1 netbsd-1-6-PATCH001 netbsd-1-6-PATCH001-RELEASE netbsd-1-6-PATCH001-RC3 netbsd-1-6-PATCH001-RC2 netbsd-1-6-PATCH001-RC1 fvdl_fs64_base netbsd-1-6-RELEASE netbsd-1-6-RC3 netbsd-1-6-RC2 netbsd-1-6-RC1 netbsd-1-6-base
# 1.7 05-Feb-2001 christos

fix nested externs


Revision tags: netbsd-1-5-PATCH003 netbsd-1-5-PATCH002 netbsd-1-5-PATCH001 netbsd-1-5-RELEASE netbsd-1-5-BETA2 netbsd-1-5-BETA netbsd-1-5-ALPHA2 netbsd-1-5-base minoura-xpg4dl-base wrstuden-devbsize-19991221 wrstuden-devbsize-base comdex-fall-1999-base
# 1.6 08-Sep-1999 jsm

Add use of `const' where appropriate to the games.

This merges in all such remaining changes from the Linux port of the
NetBSD games, except in hunt (where substantial changes from OpenBSD
need to be looked at).

Some such changes were previously covered in PRs bin/6041, bin/6146,
bin/6148, bin/6150, bin/6151, bin/6580, bin/6660, bin/7993, bin/7994,
bin/8039, bin/8057 and bin/8093.


Revision tags: netbsd-1-4-PATCH003 netbsd-1-4-PATCH002 netbsd-1-4-PATCH001 netbsd-1-4-RELEASE netbsd-1-4-base netbsd-1-3-PATCH003 netbsd-1-3-PATCH003-CANDIDATE2 netbsd-1-3-PATCH003-CANDIDATE1 netbsd-1-3-PATCH003-CANDIDATE0 netbsd-1-3-PATCH002 netbsd-1-3-PATCH001 netbsd-1-3-RELEASE netbsd-1-3-BETA netbsd-1-3-base
# 1.5 10-Oct-1997 lukem

WARNSify


# 1.4 03-Jan-1997 cgd

fix NetBSD RCS ID headers


# 1.3 03-Jan-1997 cgd

include string.h and stdlib.h for prototypes, as appropriate


# 1.2 28-Dec-1996 tls

add gomoku game, from 4.4BSD-Lite2


# 1.1 28-Dec-1996 tls

branches: 1.1.1;
Initial revision


# 1.52 29-May-2022 rillig

gomoku: don't use 'i' as special-purpose variable name

No binary change.


# 1.51 29-May-2022 rillig

gomoku: use consistent variable names

Previously, the name 's' was used for the index of a spot on the board,
as well as for the value of a combo, and for a few other purposes. Use
different names and mark the spot indexes using a custom type.

No binary change.


# 1.50 28-May-2022 rillig

gomoku: remove redundant parentheses, braces, newlines, clean up get_key

No functional change.


# 1.49 28-May-2022 rillig

gomoku: highlight the winning frame


# 1.48 28-May-2022 rillig

gomoku: group movelog and nmoves into a game struct

No functional change.


# 1.47 27-May-2022 rillig

gomoku: replace 1-based movenum with 0-based nmoves

No functional change, not even the TIE that is wrongly announced when
the very last spot on the board is yet to be filled by Black. Even
without this off-by-one error, it could be that filling the very last
spot completes a frame, so that code has been wrong all the time.

In practical terms, this situation only arises when the human player is
unconcentrated or the computer player has a bad strategy. The latter
may well be, as the computer moves in the (boring) endgame are not
directed towards winning -- they fill irrelevant spots before relevant
ones.


# 1.46 22-May-2022 rillig

gomoku: add mouse support

NetBSD 10 provides the mouse handling functions from <curses.h> but does
not actually implement the mouse handling. For the benefit of other
platforms, add mouse support; when linked with ncurses instead of
curses, it works.

Depending on the input device, mouse clicks are either reported as
"button 1 clicked" (mouse) or "button 1 pressed/released" (touchpad);
support both.

Be strict about the X coordinate when clicking. Since the coordinates
are integer numbers, getting the location between two spots is
ambiguous, as it could be just one pixel away or right in the middle of
the space between the spots.


# 1.45 22-May-2022 rillig

gomoku: clean up coordinate calculations in get_coord

No functional change.


# 1.44 22-May-2022 rillig

gomoku: make coordinates in get_coord 1-based

The rest of the game has 1-based coordinates as well.

No functional change.


# 1.43 22-May-2022 rillig

gomoku: extract save_game from main

No functional change.


# 1.42 21-May-2022 rillig

gomoku: right-align column header for move number


# 1.41 21-May-2022 rillig

gomoku: move comments closer to their corresponding entities

No binary change.


# 1.40 21-May-2022 rillig

gomoku: warn before overwriting a saved game file


# 1.39 21-May-2022 rillig

gomoku: do not accept overly long lines from the input

Typing beyond the screen and then pressing and holding backspace still
removes the prompt, just as before.


# 1.38 21-May-2022 rillig

gomoku: fix deleting a character when reading a line


# 1.37 21-May-2022 rillig

gomoku: make drawing the player's names simpler

No functional change.


# 1.36 19-May-2022 rillig

gomoku: use combined curses functions

To save some screen space in the source code and some bytes in the
generated binary.

No functional change.


# 1.35 19-May-2022 rillig

gomoku: clean up coordinate for the currently selected spot

There is no need to make this coordinate dependent on the board size.

No binary change.


# 1.34 19-May-2022 rillig

gomoku: clean up version control sections

Lint can handle these definitions, and the '#if 0' is redundant.

No functional change.


# 1.33 19-May-2022 rillig

gomoku: replace magic numbers with proper coordinate calculation


# 1.32 19-May-2022 rillig

gomoku: properly center the player's names


# 1.31 19-May-2022 rillig

gomoku: de-obfuscate screen coordinate calculation

Modern compilers optimize linear integer arithmetic, so there is no
reason to use strange or misleading formulas.

Replace several magic numbers with proper formulas.

No binary change.


# 1.30 19-May-2022 rillig

gomoku: fix error message for small screen

- gomoku: Screen too small (need 8018d)
+ gomoku: Screen too small (need 80x24)


# 1.29 19-May-2022 rillig

gomoku: fix type mismatch in call to curses function

Not yet detected by lint, as lint is more permissive for type mismatches
if the value is a constant 0. Being permissive doesn't make sense in
this case. Now the calls to 'keypad' and 'leaveok' are consistent.

No binary change.


# 1.28 18-May-2022 rillig

gomoku: reduce scope of 'for' loop variables

No binary change.


# 1.27 16-May-2022 rillig

gomoku: highlight the last played move


# 1.26 16-May-2022 rillig

gomoku: enable lint's strict bool mode

No functional change.


# 1.25 16-May-2022 rillig

gomoku: fix most lint warnings in -DDEBUG mode

No binary change.


# 1.24 16-May-2022 rillig

gomoku: prepare lint's strict bool mode

No binary change.


# 1.23 16-May-2022 rillig

gomoku: fix lint warnings

Most warnings were about implicit conversions from ptrdiff_t to int; add
explicit cast for them, as they are far from overflowing int.

The casts from one pointer type to 'struct combostr **' were indeed
suspicious. In these cases, a single region of memory is allocated to
store two objects of different type, without declaring a struct type for
their combination. The second object is an array of variable size.

No binary change.


# 1.22 15-May-2022 rillig

gomoku: inline macros BSZ1, BSZ2, BSZ3, BSZ4

These macro names didn't convey any meaning, so replace them with their
replacement text, to have fewer identifiers to worry about.

No binary change.


# 1.21 15-May-2022 rillig

gomoku: remove redundant parentheses around return values

No binary change.


# 1.20 15-May-2022 rillig

gomoku: apply some style fixes towards KNF

There are still parts of the code that use an indentation level of 4
instead of the usual 8. Fixing that right now would introduce more
unnatural line breaks, so defer that until later.

No binary change.


# 1.19 14-May-2022 rillig

gomoku: clean up unused code and lint warnings

No binary change.


Revision tags: cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base
# 1.18 02-May-2021 rillig

games: remove trailing whitespace in *.c and *.h


Revision tags: netbsd-9-2-RELEASE netbsd-9-1-RELEASE phil-wifi-20200421 phil-wifi-20200411 is-mlppp-base phil-wifi-20200406 netbsd-8-2-RELEASE netbsd-9-0-RELEASE netbsd-9-0-RC2 netbsd-9-0-RC1 phil-wifi-20191119 netbsd-9-base phil-wifi-20190609 netbsd-8-1-RELEASE netbsd-8-1-RC1 pgoyette-compat-merge-20190127 pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 netbsd-7-2-RELEASE pgoyette-compat-0728 netbsd-8-0-RELEASE phil-wifi-base pgoyette-compat-0625 netbsd-8-0-RC2 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 netbsd-8-0-RC1 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 netbsd-7-1-2-RELEASE pgoyette-compat-base netbsd-7-1-1-RELEASE matt-nb8-mediatek-base perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 pgoyette-localcount-20170320 netbsd-7-1-RELEASE netbsd-7-1-RC2 netbsd-7-nhusb-base-20170116 bouyer-socketcan-base pgoyette-localcount-20170107 netbsd-7-1-RC1 pgoyette-localcount-20161104 netbsd-7-0-2-RELEASE localcount-20160914 netbsd-7-nhusb-base pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base netbsd-7-0-1-RELEASE netbsd-7-0-RELEASE netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 tls-maxphys-base
# 1.17 22-Mar-2014 dholland

move extern decls to .h files


Revision tags: riastradh-drm2-base3 riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base agc-symver-base yamt-pagecache-base8 yamt-pagecache-base7 yamt-pagecache-base6 yamt-pagecache-base5 yamt-pagecache-base4
# 1.16 18-Feb-2012 matt

branches: 1.16.2;
Fix conflicting variable definitions


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-1-5-RELEASE netbsd-6-1-4-RELEASE netbsd-6-0-5-RELEASE netbsd-6-1-3-RELEASE netbsd-6-0-4-RELEASE netbsd-6-1-2-RELEASE netbsd-6-0-3-RELEASE netbsd-6-1-1-RELEASE netbsd-6-0-2-RELEASE netbsd-6-1-RELEASE netbsd-6-1-RC4 netbsd-6-1-RC3 netbsd-6-1-RC2 netbsd-6-1-RC1 netbsd-6-0-1-RELEASE matt-nb6-plus-nbase netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 netbsd-6-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base cherry-xenmp-base bouyer-quota2-nbase bouyer-quota2-base matt-mips64-premerge-20101231
# 1.15 29-Mar-2010 dholland

branches: 1.15.6;
Some improvements to the new UI.


# 1.14 29-Mar-2010 dholland

Better user interface. From OpenBSD, written by Paul Janzen quite a
long time ago. A few minor adjustments by yours truly.


# 1.13 29-Mar-2010 dholland

Don't exit(0) on failure. Use errx() instead of fprintf.


Revision tags: matt-premerge-20091211
# 1.12 13-Jul-2009 roy

Rename internal getline() function to get_line() so it does
conflict with the soon to be added getline(3) libc function.


# 1.11 04-Jun-2009 dholland

Increase spending on vowels. No object file diffs.


# 1.10 04-Jun-2009 dholland

ANSIfy function declarations.x


Revision tags: netbsd-5-2-3-RELEASE netbsd-5-1-5-RELEASE netbsd-5-2-2-RELEASE netbsd-5-1-4-RELEASE netbsd-5-2-1-RELEASE netbsd-5-1-3-RELEASE netbsd-5-2-RELEASE netbsd-5-2-RC1 netbsd-5-1-2-RELEASE netbsd-5-1-1-RELEASE matt-nb5-mips64-premerge-20101231 matt-nb5-pq3-base netbsd-5-1-RELEASE netbsd-5-1-RC4 matt-nb5-mips64-k15 netbsd-5-1-RC3 netbsd-5-1-RC2 netbsd-5-1-RC1 netbsd-5-0-2-RELEASE matt-nb5-mips64-premerge-20091211 matt-nb5-mips64-u2-k2-k4-k7-k8-k9 matt-nb4-mips64-k7-u2a-k9b matt-nb5-mips64-u1-k1-k5 netbsd-5-0-1-RELEASE jym-xensuspend-nbase netbsd-5-0-RELEASE netbsd-5-0-RC4 netbsd-5-0-RC3 netbsd-5-0-RC2 jym-xensuspend-base netbsd-5-0-RC1 netbsd-5-base matt-mips64-base2 wrstuden-revivesa-base-3 wrstuden-revivesa-base-2
# 1.9 08-Aug-2008 drochner

if initscr() fails, exit with a message rather than crash in the
next curses call


Revision tags: netbsd-4-0-1-RELEASE wrstuden-fixsa-newbase wrstuden-revivesa-base-1 yamt-pf42-base4 yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-baseX yamt-pf42-base2 wrstuden-revivesa-base yamt-pf42-base keiichi-mipv6-base matt-armv6-nbase matt-armv6-prevmlocking wrstuden-fixsa-base-1 netbsd-4-0-RELEASE cube-autoconf-base netbsd-4-0-RC5 netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 netbsd-4-0-RC1 matt-armv6-base matt-mips64-base hpcarm-cleanup-base netbsd-3-1-1-RELEASE netbsd-3-0-3-RELEASE wrstuden-fixsa-base abandoned-netbsd-4-base netbsd-3-1-RELEASE netbsd-3-0-2-RELEASE netbsd-3-1-RC4 netbsd-3-1-RC3 netbsd-3-1-RC2 netbsd-3-1-RC1 netbsd-4-base netbsd-3-0-1-RELEASE netbsd-3-0-RELEASE netbsd-3-0-RC6 netbsd-3-0-RC5 netbsd-3-0-RC4 netbsd-3-0-RC3 netbsd-3-0-RC2 netbsd-3-0-RC1 netbsd-2-0-3-RELEASE netbsd-2-1-RELEASE netbsd-2-1-RC6 netbsd-2-1-RC5 netbsd-2-1-RC4 netbsd-2-1-RC3 netbsd-2-1-RC2 netbsd-2-1-RC1 netbsd-2-0-2-RELEASE netbsd-3-base netbsd-2-0-1-RELEASE netbsd-2-base netbsd-2-0-RELEASE netbsd-2-0-RC5 netbsd-2-0-RC4 netbsd-2-0-RC3 netbsd-2-0-RC2 netbsd-2-0-RC1 netbsd-2-0-base
# 1.8 07-Aug-2003 agc

branches: 1.8.32;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22269, verified by myself.


Revision tags: netbsd-1-6-PATCH002-RELEASE netbsd-1-6-PATCH002 netbsd-1-6-PATCH002-RC4 netbsd-1-6-PATCH002-RC3 netbsd-1-6-PATCH002-RC2 netbsd-1-6-PATCH002-RC1 netbsd-1-6-PATCH001 netbsd-1-6-PATCH001-RELEASE netbsd-1-6-PATCH001-RC3 netbsd-1-6-PATCH001-RC2 netbsd-1-6-PATCH001-RC1 fvdl_fs64_base netbsd-1-6-RELEASE netbsd-1-6-RC3 netbsd-1-6-RC2 netbsd-1-6-RC1 netbsd-1-6-base
# 1.7 05-Feb-2001 christos

fix nested externs


Revision tags: netbsd-1-5-PATCH003 netbsd-1-5-PATCH002 netbsd-1-5-PATCH001 netbsd-1-5-RELEASE netbsd-1-5-BETA2 netbsd-1-5-BETA netbsd-1-5-ALPHA2 netbsd-1-5-base minoura-xpg4dl-base wrstuden-devbsize-19991221 wrstuden-devbsize-base comdex-fall-1999-base
# 1.6 08-Sep-1999 jsm

Add use of `const' where appropriate to the games.

This merges in all such remaining changes from the Linux port of the
NetBSD games, except in hunt (where substantial changes from OpenBSD
need to be looked at).

Some such changes were previously covered in PRs bin/6041, bin/6146,
bin/6148, bin/6150, bin/6151, bin/6580, bin/6660, bin/7993, bin/7994,
bin/8039, bin/8057 and bin/8093.


Revision tags: netbsd-1-4-PATCH003 netbsd-1-4-PATCH002 netbsd-1-4-PATCH001 netbsd-1-4-RELEASE netbsd-1-4-base netbsd-1-3-PATCH003 netbsd-1-3-PATCH003-CANDIDATE2 netbsd-1-3-PATCH003-CANDIDATE1 netbsd-1-3-PATCH003-CANDIDATE0 netbsd-1-3-PATCH002 netbsd-1-3-PATCH001 netbsd-1-3-RELEASE netbsd-1-3-BETA netbsd-1-3-base
# 1.5 10-Oct-1997 lukem

WARNSify


# 1.4 03-Jan-1997 cgd

fix NetBSD RCS ID headers


# 1.3 03-Jan-1997 cgd

include string.h and stdlib.h for prototypes, as appropriate


# 1.2 28-Dec-1996 tls

add gomoku game, from 4.4BSD-Lite2


# 1.1 28-Dec-1996 tls

branches: 1.1.1;
Initial revision


# 1.49 28-May-2022 rillig

gomoku: highlight the winning frame


# 1.48 28-May-2022 rillig

gomoku: group movelog and nmoves into a game struct

No functional change.


# 1.47 27-May-2022 rillig

gomoku: replace 1-based movenum with 0-based nmoves

No functional change, not even the TIE that is wrongly announced when
the very last spot on the board is yet to be filled by Black. Even
without this off-by-one error, it could be that filling the very last
spot completes a frame, so that code has been wrong all the time.

In practical terms, this situation only arises when the human player is
unconcentrated or the computer player has a bad strategy. The latter
may well be, as the computer moves in the (boring) endgame are not
directed towards winning -- they fill irrelevant spots before relevant
ones.


# 1.46 22-May-2022 rillig

gomoku: add mouse support

NetBSD 10 provides the mouse handling functions from <curses.h> but does
not actually implement the mouse handling. For the benefit of other
platforms, add mouse support; when linked with ncurses instead of
curses, it works.

Depending on the input device, mouse clicks are either reported as
"button 1 clicked" (mouse) or "button 1 pressed/released" (touchpad);
support both.

Be strict about the X coordinate when clicking. Since the coordinates
are integer numbers, getting the location between two spots is
ambiguous, as it could be just one pixel away or right in the middle of
the space between the spots.


# 1.45 22-May-2022 rillig

gomoku: clean up coordinate calculations in get_coord

No functional change.


# 1.44 22-May-2022 rillig

gomoku: make coordinates in get_coord 1-based

The rest of the game has 1-based coordinates as well.

No functional change.


# 1.43 22-May-2022 rillig

gomoku: extract save_game from main

No functional change.


# 1.42 21-May-2022 rillig

gomoku: right-align column header for move number


# 1.41 21-May-2022 rillig

gomoku: move comments closer to their corresponding entities

No binary change.


# 1.40 21-May-2022 rillig

gomoku: warn before overwriting a saved game file


# 1.39 21-May-2022 rillig

gomoku: do not accept overly long lines from the input

Typing beyond the screen and then pressing and holding backspace still
removes the prompt, just as before.


# 1.38 21-May-2022 rillig

gomoku: fix deleting a character when reading a line


# 1.37 21-May-2022 rillig

gomoku: make drawing the player's names simpler

No functional change.


# 1.36 19-May-2022 rillig

gomoku: use combined curses functions

To save some screen space in the source code and some bytes in the
generated binary.

No functional change.


# 1.35 19-May-2022 rillig

gomoku: clean up coordinate for the currently selected spot

There is no need to make this coordinate dependent on the board size.

No binary change.


# 1.34 19-May-2022 rillig

gomoku: clean up version control sections

Lint can handle these definitions, and the '#if 0' is redundant.

No functional change.


# 1.33 19-May-2022 rillig

gomoku: replace magic numbers with proper coordinate calculation


# 1.32 19-May-2022 rillig

gomoku: properly center the player's names


# 1.31 19-May-2022 rillig

gomoku: de-obfuscate screen coordinate calculation

Modern compilers optimize linear integer arithmetic, so there is no
reason to use strange or misleading formulas.

Replace several magic numbers with proper formulas.

No binary change.


# 1.30 19-May-2022 rillig

gomoku: fix error message for small screen

- gomoku: Screen too small (need 8018d)
+ gomoku: Screen too small (need 80x24)


# 1.29 19-May-2022 rillig

gomoku: fix type mismatch in call to curses function

Not yet detected by lint, as lint is more permissive for type mismatches
if the value is a constant 0. Being permissive doesn't make sense in
this case. Now the calls to 'keypad' and 'leaveok' are consistent.

No binary change.


# 1.28 18-May-2022 rillig

gomoku: reduce scope of 'for' loop variables

No binary change.


# 1.27 16-May-2022 rillig

gomoku: highlight the last played move


# 1.26 16-May-2022 rillig

gomoku: enable lint's strict bool mode

No functional change.


# 1.25 16-May-2022 rillig

gomoku: fix most lint warnings in -DDEBUG mode

No binary change.


# 1.24 16-May-2022 rillig

gomoku: prepare lint's strict bool mode

No binary change.


# 1.23 16-May-2022 rillig

gomoku: fix lint warnings

Most warnings were about implicit conversions from ptrdiff_t to int; add
explicit cast for them, as they are far from overflowing int.

The casts from one pointer type to 'struct combostr **' were indeed
suspicious. In these cases, a single region of memory is allocated to
store two objects of different type, without declaring a struct type for
their combination. The second object is an array of variable size.

No binary change.


# 1.22 15-May-2022 rillig

gomoku: inline macros BSZ1, BSZ2, BSZ3, BSZ4

These macro names didn't convey any meaning, so replace them with their
replacement text, to have fewer identifiers to worry about.

No binary change.


# 1.21 15-May-2022 rillig

gomoku: remove redundant parentheses around return values

No binary change.


# 1.20 15-May-2022 rillig

gomoku: apply some style fixes towards KNF

There are still parts of the code that use an indentation level of 4
instead of the usual 8. Fixing that right now would introduce more
unnatural line breaks, so defer that until later.

No binary change.


# 1.19 14-May-2022 rillig

gomoku: clean up unused code and lint warnings

No binary change.


Revision tags: cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base
# 1.18 02-May-2021 rillig

games: remove trailing whitespace in *.c and *.h


Revision tags: netbsd-9-2-RELEASE netbsd-9-1-RELEASE phil-wifi-20200421 phil-wifi-20200411 is-mlppp-base phil-wifi-20200406 netbsd-8-2-RELEASE netbsd-9-0-RELEASE netbsd-9-0-RC2 netbsd-9-0-RC1 phil-wifi-20191119 netbsd-9-base phil-wifi-20190609 netbsd-8-1-RELEASE netbsd-8-1-RC1 pgoyette-compat-merge-20190127 pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 netbsd-7-2-RELEASE pgoyette-compat-0728 netbsd-8-0-RELEASE phil-wifi-base pgoyette-compat-0625 netbsd-8-0-RC2 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 netbsd-8-0-RC1 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 netbsd-7-1-2-RELEASE pgoyette-compat-base netbsd-7-1-1-RELEASE matt-nb8-mediatek-base perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 pgoyette-localcount-20170320 netbsd-7-1-RELEASE netbsd-7-1-RC2 netbsd-7-nhusb-base-20170116 bouyer-socketcan-base pgoyette-localcount-20170107 netbsd-7-1-RC1 pgoyette-localcount-20161104 netbsd-7-0-2-RELEASE localcount-20160914 netbsd-7-nhusb-base pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base netbsd-7-0-1-RELEASE netbsd-7-0-RELEASE netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 tls-maxphys-base
# 1.17 22-Mar-2014 dholland

move extern decls to .h files


Revision tags: riastradh-drm2-base3 riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base agc-symver-base yamt-pagecache-base8 yamt-pagecache-base7 yamt-pagecache-base6 yamt-pagecache-base5 yamt-pagecache-base4
# 1.16 18-Feb-2012 matt

branches: 1.16.2;
Fix conflicting variable definitions


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-1-5-RELEASE netbsd-6-1-4-RELEASE netbsd-6-0-5-RELEASE netbsd-6-1-3-RELEASE netbsd-6-0-4-RELEASE netbsd-6-1-2-RELEASE netbsd-6-0-3-RELEASE netbsd-6-1-1-RELEASE netbsd-6-0-2-RELEASE netbsd-6-1-RELEASE netbsd-6-1-RC4 netbsd-6-1-RC3 netbsd-6-1-RC2 netbsd-6-1-RC1 netbsd-6-0-1-RELEASE matt-nb6-plus-nbase netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 netbsd-6-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base cherry-xenmp-base bouyer-quota2-nbase bouyer-quota2-base matt-mips64-premerge-20101231
# 1.15 29-Mar-2010 dholland

branches: 1.15.6;
Some improvements to the new UI.


# 1.14 29-Mar-2010 dholland

Better user interface. From OpenBSD, written by Paul Janzen quite a
long time ago. A few minor adjustments by yours truly.


# 1.13 29-Mar-2010 dholland

Don't exit(0) on failure. Use errx() instead of fprintf.


Revision tags: matt-premerge-20091211
# 1.12 13-Jul-2009 roy

Rename internal getline() function to get_line() so it does
conflict with the soon to be added getline(3) libc function.


# 1.11 04-Jun-2009 dholland

Increase spending on vowels. No object file diffs.


# 1.10 04-Jun-2009 dholland

ANSIfy function declarations.x


Revision tags: netbsd-5-2-3-RELEASE netbsd-5-1-5-RELEASE netbsd-5-2-2-RELEASE netbsd-5-1-4-RELEASE netbsd-5-2-1-RELEASE netbsd-5-1-3-RELEASE netbsd-5-2-RELEASE netbsd-5-2-RC1 netbsd-5-1-2-RELEASE netbsd-5-1-1-RELEASE matt-nb5-mips64-premerge-20101231 matt-nb5-pq3-base netbsd-5-1-RELEASE netbsd-5-1-RC4 matt-nb5-mips64-k15 netbsd-5-1-RC3 netbsd-5-1-RC2 netbsd-5-1-RC1 netbsd-5-0-2-RELEASE matt-nb5-mips64-premerge-20091211 matt-nb5-mips64-u2-k2-k4-k7-k8-k9 matt-nb4-mips64-k7-u2a-k9b matt-nb5-mips64-u1-k1-k5 netbsd-5-0-1-RELEASE jym-xensuspend-nbase netbsd-5-0-RELEASE netbsd-5-0-RC4 netbsd-5-0-RC3 netbsd-5-0-RC2 jym-xensuspend-base netbsd-5-0-RC1 netbsd-5-base matt-mips64-base2 wrstuden-revivesa-base-3 wrstuden-revivesa-base-2
# 1.9 08-Aug-2008 drochner

if initscr() fails, exit with a message rather than crash in the
next curses call


Revision tags: netbsd-4-0-1-RELEASE wrstuden-fixsa-newbase wrstuden-revivesa-base-1 yamt-pf42-base4 yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-baseX yamt-pf42-base2 wrstuden-revivesa-base yamt-pf42-base keiichi-mipv6-base matt-armv6-nbase matt-armv6-prevmlocking wrstuden-fixsa-base-1 netbsd-4-0-RELEASE cube-autoconf-base netbsd-4-0-RC5 netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 netbsd-4-0-RC1 matt-armv6-base matt-mips64-base hpcarm-cleanup-base netbsd-3-1-1-RELEASE netbsd-3-0-3-RELEASE wrstuden-fixsa-base abandoned-netbsd-4-base netbsd-3-1-RELEASE netbsd-3-0-2-RELEASE netbsd-3-1-RC4 netbsd-3-1-RC3 netbsd-3-1-RC2 netbsd-3-1-RC1 netbsd-4-base netbsd-3-0-1-RELEASE netbsd-3-0-RELEASE netbsd-3-0-RC6 netbsd-3-0-RC5 netbsd-3-0-RC4 netbsd-3-0-RC3 netbsd-3-0-RC2 netbsd-3-0-RC1 netbsd-2-0-3-RELEASE netbsd-2-1-RELEASE netbsd-2-1-RC6 netbsd-2-1-RC5 netbsd-2-1-RC4 netbsd-2-1-RC3 netbsd-2-1-RC2 netbsd-2-1-RC1 netbsd-2-0-2-RELEASE netbsd-3-base netbsd-2-0-1-RELEASE netbsd-2-base netbsd-2-0-RELEASE netbsd-2-0-RC5 netbsd-2-0-RC4 netbsd-2-0-RC3 netbsd-2-0-RC2 netbsd-2-0-RC1 netbsd-2-0-base
# 1.8 07-Aug-2003 agc

branches: 1.8.32;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22269, verified by myself.


Revision tags: netbsd-1-6-PATCH002-RELEASE netbsd-1-6-PATCH002 netbsd-1-6-PATCH002-RC4 netbsd-1-6-PATCH002-RC3 netbsd-1-6-PATCH002-RC2 netbsd-1-6-PATCH002-RC1 netbsd-1-6-PATCH001 netbsd-1-6-PATCH001-RELEASE netbsd-1-6-PATCH001-RC3 netbsd-1-6-PATCH001-RC2 netbsd-1-6-PATCH001-RC1 fvdl_fs64_base netbsd-1-6-RELEASE netbsd-1-6-RC3 netbsd-1-6-RC2 netbsd-1-6-RC1 netbsd-1-6-base
# 1.7 05-Feb-2001 christos

fix nested externs


Revision tags: netbsd-1-5-PATCH003 netbsd-1-5-PATCH002 netbsd-1-5-PATCH001 netbsd-1-5-RELEASE netbsd-1-5-BETA2 netbsd-1-5-BETA netbsd-1-5-ALPHA2 netbsd-1-5-base minoura-xpg4dl-base wrstuden-devbsize-19991221 wrstuden-devbsize-base comdex-fall-1999-base
# 1.6 08-Sep-1999 jsm

Add use of `const' where appropriate to the games.

This merges in all such remaining changes from the Linux port of the
NetBSD games, except in hunt (where substantial changes from OpenBSD
need to be looked at).

Some such changes were previously covered in PRs bin/6041, bin/6146,
bin/6148, bin/6150, bin/6151, bin/6580, bin/6660, bin/7993, bin/7994,
bin/8039, bin/8057 and bin/8093.


Revision tags: netbsd-1-4-PATCH003 netbsd-1-4-PATCH002 netbsd-1-4-PATCH001 netbsd-1-4-RELEASE netbsd-1-4-base netbsd-1-3-PATCH003 netbsd-1-3-PATCH003-CANDIDATE2 netbsd-1-3-PATCH003-CANDIDATE1 netbsd-1-3-PATCH003-CANDIDATE0 netbsd-1-3-PATCH002 netbsd-1-3-PATCH001 netbsd-1-3-RELEASE netbsd-1-3-BETA netbsd-1-3-base
# 1.5 10-Oct-1997 lukem

WARNSify


# 1.4 03-Jan-1997 cgd

fix NetBSD RCS ID headers


# 1.3 03-Jan-1997 cgd

include string.h and stdlib.h for prototypes, as appropriate


# 1.2 28-Dec-1996 tls

add gomoku game, from 4.4BSD-Lite2


# 1.1 28-Dec-1996 tls

branches: 1.1.1;
Initial revision


# 1.46 22-May-2022 rillig

gomoku: add mouse support

NetBSD 10 provides the mouse handling functions from <curses.h> but does
not actually implement the mouse handling. For the benefit of other
platforms, add mouse support; when linked with ncurses instead of
curses, it works.

Depending on the input device, mouse clicks are either reported as
"button 1 clicked" (mouse) or "button 1 pressed/released" (touchpad);
support both.

Be strict about the X coordinate when clicking. Since the coordinates
are integer numbers, getting the location between two spots is
ambiguous, as it could be just one pixel away or right in the middle of
the space between the spots.


# 1.45 22-May-2022 rillig

gomoku: clean up coordinate calculations in get_coord

No functional change.


# 1.44 22-May-2022 rillig

gomoku: make coordinates in get_coord 1-based

The rest of the game has 1-based coordinates as well.

No functional change.


# 1.43 22-May-2022 rillig

gomoku: extract save_game from main

No functional change.


# 1.42 21-May-2022 rillig

gomoku: right-align column header for move number


# 1.41 21-May-2022 rillig

gomoku: move comments closer to their corresponding entities

No binary change.


# 1.40 21-May-2022 rillig

gomoku: warn before overwriting a saved game file


# 1.39 21-May-2022 rillig

gomoku: do not accept overly long lines from the input

Typing beyond the screen and then pressing and holding backspace still
removes the prompt, just as before.


# 1.38 21-May-2022 rillig

gomoku: fix deleting a character when reading a line


# 1.37 21-May-2022 rillig

gomoku: make drawing the player's names simpler

No functional change.


# 1.36 19-May-2022 rillig

gomoku: use combined curses functions

To save some screen space in the source code and some bytes in the
generated binary.

No functional change.


# 1.35 19-May-2022 rillig

gomoku: clean up coordinate for the currently selected spot

There is no need to make this coordinate dependent on the board size.

No binary change.


# 1.34 19-May-2022 rillig

gomoku: clean up version control sections

Lint can handle these definitions, and the '#if 0' is redundant.

No functional change.


# 1.33 19-May-2022 rillig

gomoku: replace magic numbers with proper coordinate calculation


# 1.32 19-May-2022 rillig

gomoku: properly center the player's names


# 1.31 19-May-2022 rillig

gomoku: de-obfuscate screen coordinate calculation

Modern compilers optimize linear integer arithmetic, so there is no
reason to use strange or misleading formulas.

Replace several magic numbers with proper formulas.

No binary change.


# 1.30 19-May-2022 rillig

gomoku: fix error message for small screen

- gomoku: Screen too small (need 8018d)
+ gomoku: Screen too small (need 80x24)


# 1.29 19-May-2022 rillig

gomoku: fix type mismatch in call to curses function

Not yet detected by lint, as lint is more permissive for type mismatches
if the value is a constant 0. Being permissive doesn't make sense in
this case. Now the calls to 'keypad' and 'leaveok' are consistent.

No binary change.


# 1.28 18-May-2022 rillig

gomoku: reduce scope of 'for' loop variables

No binary change.


# 1.27 16-May-2022 rillig

gomoku: highlight the last played move


# 1.26 16-May-2022 rillig

gomoku: enable lint's strict bool mode

No functional change.


# 1.25 16-May-2022 rillig

gomoku: fix most lint warnings in -DDEBUG mode

No binary change.


# 1.24 16-May-2022 rillig

gomoku: prepare lint's strict bool mode

No binary change.


# 1.23 16-May-2022 rillig

gomoku: fix lint warnings

Most warnings were about implicit conversions from ptrdiff_t to int; add
explicit cast for them, as they are far from overflowing int.

The casts from one pointer type to 'struct combostr **' were indeed
suspicious. In these cases, a single region of memory is allocated to
store two objects of different type, without declaring a struct type for
their combination. The second object is an array of variable size.

No binary change.


# 1.22 15-May-2022 rillig

gomoku: inline macros BSZ1, BSZ2, BSZ3, BSZ4

These macro names didn't convey any meaning, so replace them with their
replacement text, to have fewer identifiers to worry about.

No binary change.


# 1.21 15-May-2022 rillig

gomoku: remove redundant parentheses around return values

No binary change.


# 1.20 15-May-2022 rillig

gomoku: apply some style fixes towards KNF

There are still parts of the code that use an indentation level of 4
instead of the usual 8. Fixing that right now would introduce more
unnatural line breaks, so defer that until later.

No binary change.


# 1.19 14-May-2022 rillig

gomoku: clean up unused code and lint warnings

No binary change.


Revision tags: cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 cjep_staticlib_x-base
# 1.18 02-May-2021 rillig

games: remove trailing whitespace in *.c and *.h


Revision tags: netbsd-9-2-RELEASE netbsd-9-1-RELEASE phil-wifi-20200421 phil-wifi-20200411 is-mlppp-base phil-wifi-20200406 netbsd-8-2-RELEASE netbsd-9-0-RELEASE netbsd-9-0-RC2 netbsd-9-0-RC1 phil-wifi-20191119 netbsd-9-base phil-wifi-20190609 netbsd-8-1-RELEASE netbsd-8-1-RC1 pgoyette-compat-merge-20190127 pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 netbsd-7-2-RELEASE pgoyette-compat-0728 netbsd-8-0-RELEASE phil-wifi-base pgoyette-compat-0625 netbsd-8-0-RC2 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 netbsd-8-0-RC1 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 netbsd-7-1-2-RELEASE pgoyette-compat-base netbsd-7-1-1-RELEASE matt-nb8-mediatek-base perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 pgoyette-localcount-20170320 netbsd-7-1-RELEASE netbsd-7-1-RC2 netbsd-7-nhusb-base-20170116 bouyer-socketcan-base pgoyette-localcount-20170107 netbsd-7-1-RC1 pgoyette-localcount-20161104 netbsd-7-0-2-RELEASE localcount-20160914 netbsd-7-nhusb-base pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base netbsd-7-0-1-RELEASE netbsd-7-0-RELEASE netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 tls-maxphys-base
# 1.17 22-Mar-2014 dholland

move extern decls to .h files


Revision tags: riastradh-drm2-base3 riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base agc-symver-base yamt-pagecache-base8 yamt-pagecache-base7 yamt-pagecache-base6 yamt-pagecache-base5 yamt-pagecache-base4
# 1.16 18-Feb-2012 matt

branches: 1.16.2;
Fix conflicting variable definitions


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-1-5-RELEASE netbsd-6-1-4-RELEASE netbsd-6-0-5-RELEASE netbsd-6-1-3-RELEASE netbsd-6-0-4-RELEASE netbsd-6-1-2-RELEASE netbsd-6-0-3-RELEASE netbsd-6-1-1-RELEASE netbsd-6-0-2-RELEASE netbsd-6-1-RELEASE netbsd-6-1-RC4 netbsd-6-1-RC3 netbsd-6-1-RC2 netbsd-6-1-RC1 netbsd-6-0-1-RELEASE matt-nb6-plus-nbase netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 netbsd-6-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base cherry-xenmp-base bouyer-quota2-nbase bouyer-quota2-base matt-mips64-premerge-20101231
# 1.15 29-Mar-2010 dholland

branches: 1.15.6;
Some improvements to the new UI.


# 1.14 29-Mar-2010 dholland

Better user interface. From OpenBSD, written by Paul Janzen quite a
long time ago. A few minor adjustments by yours truly.


# 1.13 29-Mar-2010 dholland

Don't exit(0) on failure. Use errx() instead of fprintf.


Revision tags: matt-premerge-20091211
# 1.12 13-Jul-2009 roy

Rename internal getline() function to get_line() so it does
conflict with the soon to be added getline(3) libc function.


# 1.11 04-Jun-2009 dholland

Increase spending on vowels. No object file diffs.


# 1.10 04-Jun-2009 dholland

ANSIfy function declarations.x


Revision tags: netbsd-5-2-3-RELEASE netbsd-5-1-5-RELEASE netbsd-5-2-2-RELEASE netbsd-5-1-4-RELEASE netbsd-5-2-1-RELEASE netbsd-5-1-3-RELEASE netbsd-5-2-RELEASE netbsd-5-2-RC1 netbsd-5-1-2-RELEASE netbsd-5-1-1-RELEASE matt-nb5-mips64-premerge-20101231 matt-nb5-pq3-base netbsd-5-1-RELEASE netbsd-5-1-RC4 matt-nb5-mips64-k15 netbsd-5-1-RC3 netbsd-5-1-RC2 netbsd-5-1-RC1 netbsd-5-0-2-RELEASE matt-nb5-mips64-premerge-20091211 matt-nb5-mips64-u2-k2-k4-k7-k8-k9 matt-nb4-mips64-k7-u2a-k9b matt-nb5-mips64-u1-k1-k5 netbsd-5-0-1-RELEASE jym-xensuspend-nbase netbsd-5-0-RELEASE netbsd-5-0-RC4 netbsd-5-0-RC3 netbsd-5-0-RC2 jym-xensuspend-base netbsd-5-0-RC1 netbsd-5-base matt-mips64-base2 wrstuden-revivesa-base-3 wrstuden-revivesa-base-2
# 1.9 08-Aug-2008 drochner

if initscr() fails, exit with a message rather than crash in the
next curses call


Revision tags: netbsd-4-0-1-RELEASE wrstuden-fixsa-newbase wrstuden-revivesa-base-1 yamt-pf42-base4 yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-baseX yamt-pf42-base2 wrstuden-revivesa-base yamt-pf42-base keiichi-mipv6-base matt-armv6-nbase matt-armv6-prevmlocking wrstuden-fixsa-base-1 netbsd-4-0-RELEASE cube-autoconf-base netbsd-4-0-RC5 netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 netbsd-4-0-RC1 matt-armv6-base matt-mips64-base hpcarm-cleanup-base netbsd-3-1-1-RELEASE netbsd-3-0-3-RELEASE wrstuden-fixsa-base abandoned-netbsd-4-base netbsd-3-1-RELEASE netbsd-3-0-2-RELEASE netbsd-3-1-RC4 netbsd-3-1-RC3 netbsd-3-1-RC2 netbsd-3-1-RC1 netbsd-4-base netbsd-3-0-1-RELEASE netbsd-3-0-RELEASE netbsd-3-0-RC6 netbsd-3-0-RC5 netbsd-3-0-RC4 netbsd-3-0-RC3 netbsd-3-0-RC2 netbsd-3-0-RC1 netbsd-2-0-3-RELEASE netbsd-2-1-RELEASE netbsd-2-1-RC6 netbsd-2-1-RC5 netbsd-2-1-RC4 netbsd-2-1-RC3 netbsd-2-1-RC2 netbsd-2-1-RC1 netbsd-2-0-2-RELEASE netbsd-3-base netbsd-2-0-1-RELEASE netbsd-2-base netbsd-2-0-RELEASE netbsd-2-0-RC5 netbsd-2-0-RC4 netbsd-2-0-RC3 netbsd-2-0-RC2 netbsd-2-0-RC1 netbsd-2-0-base
# 1.8 07-Aug-2003 agc

branches: 1.8.32;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22269, verified by myself.


Revision tags: netbsd-1-6-PATCH002-RELEASE netbsd-1-6-PATCH002 netbsd-1-6-PATCH002-RC4 netbsd-1-6-PATCH002-RC3 netbsd-1-6-PATCH002-RC2 netbsd-1-6-PATCH002-RC1 netbsd-1-6-PATCH001 netbsd-1-6-PATCH001-RELEASE netbsd-1-6-PATCH001-RC3 netbsd-1-6-PATCH001-RC2 netbsd-1-6-PATCH001-RC1 fvdl_fs64_base netbsd-1-6-RELEASE netbsd-1-6-RC3 netbsd-1-6-RC2 netbsd-1-6-RC1 netbsd-1-6-base
# 1.7 05-Feb-2001 christos

fix nested externs


Revision tags: netbsd-1-5-PATCH003 netbsd-1-5-PATCH002 netbsd-1-5-PATCH001 netbsd-1-5-RELEASE netbsd-1-5-BETA2 netbsd-1-5-BETA netbsd-1-5-ALPHA2 netbsd-1-5-base minoura-xpg4dl-base wrstuden-devbsize-19991221 wrstuden-devbsize-base comdex-fall-1999-base
# 1.6 08-Sep-1999 jsm

Add use of `const' where appropriate to the games.

This merges in all such remaining changes from the Linux port of the
NetBSD games, except in hunt (where substantial changes from OpenBSD
need to be looked at).

Some such changes were previously covered in PRs bin/6041, bin/6146,
bin/6148, bin/6150, bin/6151, bin/6580, bin/6660, bin/7993, bin/7994,
bin/8039, bin/8057 and bin/8093.


Revision tags: netbsd-1-4-PATCH003 netbsd-1-4-PATCH002 netbsd-1-4-PATCH001 netbsd-1-4-RELEASE netbsd-1-4-base netbsd-1-3-PATCH003 netbsd-1-3-PATCH003-CANDIDATE2 netbsd-1-3-PATCH003-CANDIDATE1 netbsd-1-3-PATCH003-CANDIDATE0 netbsd-1-3-PATCH002 netbsd-1-3-PATCH001 netbsd-1-3-RELEASE netbsd-1-3-BETA netbsd-1-3-base
# 1.5 10-Oct-1997 lukem

WARNSify


# 1.4 03-Jan-1997 cgd

fix NetBSD RCS ID headers


# 1.3 03-Jan-1997 cgd

include string.h and stdlib.h for prototypes, as appropriate


# 1.2 28-Dec-1996 tls

add gomoku game, from 4.4BSD-Lite2


# 1.1 28-Dec-1996 tls

branches: 1.1.1;
Initial revision