summaryrefslogtreecommitdiffstats
path: root/games (follow)
Commit message (Collapse)AuthorAgeFilesLines
* grdc(6): implement timeout with alarm(3)cheloha2020-06-061-11/+18
| | | | | | | | | | | | | | | grdc(6) has an optional argument indicating a timeout in seconds. For example, one could do: $ grdc 60 to to tell grdc(6) to run for sixty seconds and then exit gracefully. As implemented, however, the timeout may occur too early or too late if the system clock is reset with settimeofday(2). To avoid this problem we can instead use alarm(3) and a signal handler to implement the timeout. alarm(3) is unaffected by settimeofday(2).
* grdc(6): miscellaneous style(9)cheloha2020-06-061-47/+48
| | | | | | | | | | - Sort includes alphabetically - Sort function prototypes alphabetically - Add missing whitespace after commas - Remove extra whitespace after commas - Add missing whitespace between binary operators - Add missing whitespace between reserved words and parens, i.e. fix "if(" - Add missing __dead to usage() definition
* no need to declare "extern optarg" and "extern optind"schwarze2020-02-144-11/+4
| | | | | | when <unistd.h> is included; patch from Jan Stary <hans at stare dot cz>; OK millert
* a few depend:-related thingies that were still in.espie2019-12-211-2/+2
| | | | okay millert@, tb@
* fix gary zukav's "acceptance without proof" quote, which just appeared onjmc2019-09-272-2/+2
| | | | | | | | | | my screen. i don;t have a copy of this book, and a brief search online shows conflicting punctuation, but i've chosen to replace the comma splice with a full stop, which is at least grammatically correct, and seems the most likely solution. whether this quote needs to be in two files escapes me...
* Be more specific regarding which encoding this simulator generates:schwarze2019-09-081-5/+7
| | | | | | | | | | | | | the existing text encouraged the misconception that punched card encodings were somehow standardized, which they were not. Lots of different encodings existed, and the one simulated here was a proprietary one of one specific vendor (GE). Also correct the history: the folks at Bell Labs already played with this. HISTORY mistake noticed by Sevan Janiyan <venture37 at geeklan dot co dot uk>, who also agrees with the final patch. tweak and OK jmc@
* Move 4 manual pages from not-a-function filenames to a correct filename,deraadt2019-08-301-3/+3
| | | | | and correct Xr. ok jmc
* spelling fix and zap a stray line while here;jmc2019-08-222-3/+2
|
* When system calls indicate an error they return -1, not some arbitraryderaadt2019-06-2823-68/+68
| | | | | | value < 0. errno is only updated in this case. Change all (most?) callers of syscalls to follow this better, and let's see if this strictness helps us in the future.
* Remove unused variables; no binary change.lteo2019-05-201-3/+3
| | | | From Jake Champlin
* Unveil tetris.rob2019-05-183-14/+27
| | | | ok brynet@, tedu@
* patch from <tleguern at bouledef dot eu> to support backward rotation,schwarze2019-05-151-3/+5
| | | | hoping to save somebody's life from the Leather Goddesses of Phobos
* eaktway eviouspray;jmc2019-05-121-4/+5
|
* add an example to the man page. discovered by mlarkintedu2019-05-111-2/+5
|
* rm lists of hereditary wizards and bad users to ensure level playing fieldtedu2019-05-097-79/+16
| | | | ok benno mlarkin tb
* macro args and punctuation should be space spearated;jmc2019-04-081-3/+3
| | | | from fabio scotoni
* Fix hack(6).bentley2019-04-056-39/+62
| | | | | | | | | | - Write savegames and scorefiles to the current directory instead of /var - Save oc_name and oc_descr alongside oc_uname in all situations - When a levitation potion times out, explicitly float down These patches were contributed last year by "tonypony76"; thanks! ok deraadt@, with added enthusiasm from tedu@
* g/c unused robots_roll file.tb2019-02-261-5/+1
| | | | From Randy Hartman
* missing word found in my treeschwarze2019-02-061-3/+3
|
* give the fake latin proverb "per aspera ad astra" in the moreschwarze2019-02-031-1/+1
| | | | | | | commonly used and metrically and logically more pleasant word order, and fix the wrong translation; translation error reported by Alessandro de Laurenzis on tech@; OK pascal@ jmc@
* printing the pinball bonus in the corner is confusing when you lose.tedu2019-01-201-2/+1
| | | | just let the bonus happen if it does, players will figure it out.
* remove some obsolete comments about deleted codetedu2019-01-201-43/+1
|
* quick fix to keep the cursor in the corner during space warp.tedu2019-01-201-1/+2
| | | | less distracting this way.
* if the snake ran over the money, print the treasure instead of empty.tedu2019-01-201-3/+7
| | | | bug noticed by mlarkin
* allow q to exit the program.tedu2019-01-062-6/+23
| | | | ok cheloha deraadt schwarze
* convert to unsigned variables to avoid some overflows.tedu2018-12-271-9/+10
| | | | analysis and patch from David Fifield
* Move a badly positioned parenthesis that caused nonsensical movementschwarze2018-12-201-3/+3
| | | | | | | | | | | | properties for the Wumpus. The bug has been present since 4.3BSD-Reno and was introduced by Keith Bostic on February 14, 1990 when committing the major rewrite from Dave Taylor. Patch (accompanied by a detailed functional and historical analysis) from David Fifield <david at bamsoftware dot com> on bugs@. With all the bats in these caves, how could a bug possibly survive for twenty-eight years?
* More fixes from David Fifield:tb2018-10-161-44/+50
| | | | | | | | | | | | | | | | | | | First, fill a missing pixel in the glyph for 'U'. Second, fix an off-by-one in the line output routine. This caused an extra space character to be output at the end of every line. It might have caused a buffer overflow if any glyph had used the entire possible width of 132 pixels, but as it is the widest is only 124 pixels. Third, output blank lines instead of lines full of spaces (the number of spaces was equal to the width of the most recent non-blank line). Finally, add bounds checks to protect against buffer overflows that could arise in case the data table were ever modified to draw out of bounds (characters wider or taller than 132 pixels, or a two-byte code where the second byte is past the end of the table). ok bcallah
* Remove unused data table entries: 174 out of 9271 entries of the bitmaptb2018-10-161-948/+1047
| | | | | | | | | | | data table are unused and can be eliminated by rendering al glyphs and re-encoding them. A few more entries can be eliminated through more efficient encoding. Patch generated with a python program by David Fifield. For details see https://marc.info/?l=openbsd-bugs&m=153955110702704&w=2 ok bcallah
* Fix fortune underlines and use the right number of underscores in Notes.bentley2018-09-152-4/+4
| | | | ok sthen@
* During our refactor with tedu@ tb@ and myself we moved the score file to themestre2018-08-241-4/+1
| | | | | | | | user's home folder and setgid was removed. Therefore it's not possible to have a single score file with all the users anymore but we forgot to change a comment that still implied that. Suggested by tb@ to just delete the comment.
* Remove a few too early pledge(2)s on games/ and apply them a little bit latermestre2018-08-246-18/+29
| | | | | | | | | | | but with much reduced permissions ("stdio tty" if ncurses based and "stdio" for the ones that only perform basic operations). There's still a few games that we cannot yet remove their fs access, through pledge(2), since they open files on demand and too late, this might get revisited in the future. OK tb@
* reduce pledge(2) to "stdio tty" after ncurses initialization. robots(6) uses amestre2018-08-231-1/+5
| | | | | | | scorefile nevertheless an fd is opened way in advance and therefore we can disable any further access to the filesystem. OK tb@
* reduce pledge(2) to "stdio tty" after ncurses initialization.mestre2018-08-231-1/+4
| | | | OK tb@
* The game is playable without the need to access any files therefore we canmestre2018-08-091-2/+2
| | | | | | | effectively disable all fs access by dropping "rpath wpath cpath" from pledge(2) right at the beginning of the program. "looks right" tb@
* Drop "rpath" from pledge(2) after ncurses initialization.mestre2018-08-061-1/+5
| | | | | Discussed with and OK tb@ OK cheloha@ on previous version
* remove duplicate installation of the SIGINT handler;schwarze2018-08-051-2/+1
| | | | from Martin Kopta <martin at kopta dot eu>
* Use a NUMKEYS macro instead of magic and use a more familiar idiomtb2018-04-251-6/+7
| | | | | | in for loops. ok stsp, bcallah
* slightly reduce the difficulty of the adventure game that is readingtedu2018-02-077-20/+27
| | | | | the battlestar code by reformatting a few lines. special request from mlarkin so he'll go back to fixing meltdown.
* Fix table wrt missing element and `, detailed analysis and diff fromotto2018-01-231-18/+18
| | | | David Fifield; ok tb@
* apostrophe fix;jmc2018-01-121-1/+1
|
* Consolidate printf(3) calls at the end of main().cheloha2017-12-241-16/+29
| | | | | | Makes reading the classification algorithm easier. ok tb@
* Use more libm.cheloha2017-12-241-18/+10
| | | | | | | | | | | | adj360() is a modulo operation: use fmod(3) to simplify things. Adding 0.5 to the phase to steer implicit truncation is a hack: use lround(3) to simplify things. Product of a discussion with pjanzen@/jca@/tb@ regarding floating-point rounding and the importance of correctly classifying a gibbous moon. ok pjanzen@ jca@ tb@
* As we only use the .tv_sec field, simplify gettimeofday(2) -> time(3).cheloha2017-12-231-9/+3
| | | | ok tb@ jca@
* The code can be simplified by using clock_gettime(2)'s CLOCK_REALTIMEtb2017-12-111-11/+8
| | | | | | instead of gettimeofday(2). From Scott Cheloha, ok jca
* than -> thentb2017-11-251-1/+1
| | | | from scott cheloha
* Straightforward conversion to strtonum. Slight change of behavior in thattb2017-11-021-48/+13
| | | | | | | trailing whitespace is no longer permitted when invoked from stdin. From Scott Cheloha. ok jca
* Use <elf.h> instead of <elf_abi.h>mpi2017-10-271-2/+2
| | | | ok jasper@, jca@, deraadt@
* typo: on -> oftb2017-08-151-1/+1
| | | | From Scott Cheloha
* replace gettimeofday with monotonic gettime. from Scott Chelohatedu2017-08-134-59/+45
| | | | ok tb