Commit Graph

34 Commits

Author SHA1 Message Date
christos 02e7c0b99a Enable FANCY mode for debugging purposes:
- 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-27 18:48:49 +00:00
nia 42708011d3 robots: Use arc4random_uniform for better uniform distribution 2020-07-26 15:38:22 +00:00
dholland 5305281b0c sprinkle static 2009-08-12 08:21:41 +00:00
christos 4b76b4506c don't use char values for functions that can return -1; chars are not always
signed.
2009-08-05 19:34:09 +00:00
dholland f5d4590c31 Use getopt instead of hand-rolled options code. Document all the arguments
and options. Don't allow the previously undocumented method to change the
maximum number of scores kept per user to be used on the system-wide high
score file. Sort options list in the man page. Bump its date.
2009-08-05 04:03:47 +00:00
dholland 8a0aa42d77 Use random() instead of rand(), and seed with time instead of pid. 2009-07-20 06:43:18 +00:00
dholland a4cc1f4f06 Assorted minor cleanups, no functional change:
- u_int* -> uint*
   - don't make private typedefs of system structures
   - use curses TRUE and FALSE only with curses booleans, otherwise
     true and false;
   - includes cleanup
   - group globals in extern.c by functionality

Object file diffs inspected.
2009-07-20 06:39:06 +00:00
dholland d547a06ea3 A bit more whitespace. 2009-07-20 06:09:29 +00:00
dholland 62c771fd10 Whitespace. 2009-07-20 06:00:56 +00:00
dholland 30870bd58b ANSIfy. Use __dead. Object diffs checked. 2009-07-20 05:44:02 +00:00
drochner 432ec04420 if initscr() fails, exit with a message rather than crash in the
next curses call
2008-08-08 16:10:47 +00:00
lukem 2fe2731d3f Remove the \n and tabs from the __COPYRIGHT() strings. 2008-07-20 00:52:39 +00:00
perry 8b0f9554ff convert __attribute__s to applicable cdefs.h macros 2007-12-15 19:44:37 +00:00
dsl 49f7d8a9b1 Add (unsigned char) cast to ctype functions 2004-11-05 21:30:31 +00:00
jsm cb5fd8342e Remove uses of __P. 2004-01-27 20:30:28 +00:00
agc e5aeb4ea46 Move UCB-licensed code from 4-clause to 3-clause licence.
Patches provided by Joel Baker in PR 22269, verified by myself.
2003-08-07 09:36:50 +00:00
blymn d82bd70ce6 Change deprecated curses function to new equivalent. 2001-12-06 12:17:57 +00:00
christos 1b1c2fdcec fix nested externs 2001-02-05 01:02:45 +00:00
mycroft f9eca6973d Use setgid(), not setregid(). 2000-05-08 07:55:59 +00:00
jsm 5c54ba1b0d Ensure correct prompt asking about another game is given at the end of
each game.

Bug report and fix from Malcolm Parsons <malcolm@bits.bris.ac.uk>.
2000-01-19 19:43:42 +00:00
jsm a645bf0f29 Typo fix in unknown option message (from Malcolm Parsons
<malcolm@bits.bris.ac.uk>).
2000-01-19 19:19:43 +00:00
jsm 27bcd0d70a Remove definition of __cputchar. 2000-01-19 19:02:27 +00:00
lukem 88d3d7c59e update after change to return value of tputs() third argument 1999-10-04 23:26:59 +00:00
jsm 5367f3400c Security improvements for games (largely from or inspired by OpenBSD).
Games which run setgid from dm, but don't need to, should drop their
privileges at startup.

Games which have a scorefile should open it at startup, then drop all
privileges leaving just the open writable file descriptor.  If the
game can invoke subprocesses, this should be made close-on-exec.

Games with scorefiles should make sure they do not get a file
descriptor < 3.  (Otherwise, they could get confused and corrupt the
scorefile when using stdin, stdout or stderr.)

Some old setuid revokes from the days of setuid games change into gid
revokes.
1999-09-12 09:02:20 +00:00
jsm b03d4fa882 Add `__noreturn__' and `__unused__' attributes 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).

Most noreturn attributes were previously added in bin/6144, with some
others that were missed then in bin/8082.  Previous `unused'
attributes were covered in bin/6557, bin/8058 and other PRs (all these
PRs have already been handled and closed).
1999-09-08 21:45:25 +00:00
jsm 092d313019 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.
1999-09-08 21:17:44 +00:00
christos 18dfb39e84 Add -A for automatic playing mode.
Make the score file MI
1999-05-15 23:56:35 +00:00
lukem 130a514f31 deprecate bzero, rindex, etc. use symbolic constants in open() 1997-10-12 14:16:26 +00:00
lukem 9007937fbb WARNSify 1997-10-12 14:09:55 +00:00
cgd 6045e6e034 clean up import 1995-04-22 10:08:46 +00:00
mycroft cf433c1aac Really fix exit code. 1993-08-10 15:39:40 +00:00
mycroft 46b7faea15 Rewrite grody exit code and eliminate use of _putchar(). 1993-08-10 02:40:55 +00:00
mycroft 8542364e07 Add RCS identifiers. 1993-08-01 18:49:50 +00:00
cgd 61f282557f initial import of 386bsd-0.1 sources 1993-03-21 09:45:37 +00:00