]> git.gir.st - minesVIiper.git/log
minesVIiper.git
5 months agoadd compile time flag 'FLAGALL_ON_CHOORD' master github/master
girst [Fri, 27 Oct 2023 15:52:17 +0000 (17:52 +0200)]
add compile time flag 'FLAGALL_ON_CHOORD'

when choording on an open cell, which has exactly the amount of closed
cells around it as it has mines next to it, flag all of them.

this is inspired by Lucas Nunes' Antimine.

5 months agofix -Werror=misleading-indentation
girst [Fri, 27 Oct 2023 15:51:22 +0000 (17:51 +0200)]
fix -Werror=misleading-indentation

mines.c:551:9: error: this ‘for’ clause does not guard... [-Werror=misleading-indentation]
  551 |         for (int c = g.p[1]+plusminus; c >= 0 && c < f.w; c+=plusminus) \
      |         ^~~
mines.c:564:29: note: in expansion of macro ‘FIND_NEXT’
  564 |                             FIND_NEXT(CELL.o && CELL.n == what-'0', direction);
      |                             ^~~~~~~~~
mines.c:556:17: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘for’
  556 |                 return 0; \
      |                 ^~~~~~
mines.c:564:29: note: in expansion of macro ‘FIND_NEXT’
  564 |                             FIND_NEXT(CELL.o && CELL.n == what-'0', direction);
      |                             ^~~~~~~~~

2 years agochange how '\' works
girst [Sun, 21 Feb 2021 00:44:50 +0000 (01:44 +0100)]
change how '\' works

3 years agomake ':n' start a new game (not 'r')
girst [Wed, 22 Jul 2020 17:28:32 +0000 (19:28 +0200)]
make ':n' start a new game (not 'r')

3 years agoprefer landing on closed cell with w/b/u/d
girst [Wed, 22 Jul 2020 17:22:22 +0000 (19:22 +0200)]
prefer landing on closed cell with w/b/u/d

5 years agoredo makefile
girst [Sat, 2 Feb 2019 16:28:41 +0000 (17:28 +0100)]
redo makefile

5 years agoSIGTSTP, EX_NEW, fix mouse ctrlseq, cursor rendering, new TODOs
girst [Sat, 26 Jan 2019 17:56:10 +0000 (18:56 +0100)]
SIGTSTP, EX_NEW, fix mouse ctrlseq, cursor rendering, new TODOs

5 years agonew TODO: ; and ,
girst [Thu, 24 Jan 2019 00:03:25 +0000 (01:03 +0100)]
new TODO: ; and ,

5 years agoimplement "find open region"
girst [Fri, 18 Jan 2019 18:51:30 +0000 (19:51 +0100)]
implement "find open region"

algorithm is all but speed or memory optimized, but works

5 years agofix: don't overwrite stored termios structure
girst [Sat, 5 Jan 2019 18:08:55 +0000 (19:08 +0100)]
fix: don't overwrite stored termios structure

this function was originally intended to only be called once, but when
adding the ex-commands this assumption was violated. checking for
.c_lflag is not perfect, but there should be at least _something_ in
there after tcgetattr. (static variables are zero-initialized)

5 years agonote a wontfix in dec mode
girst [Mon, 5 Nov 2018 14:47:51 +0000 (15:47 +0100)]
note a wontfix in dec mode

5 years agofix header guard macro
girst [Mon, 5 Nov 2018 14:23:03 +0000 (15:23 +0100)]
fix header guard macro

5 years agoremove buggy 'p', fix vt220 issue, implement SIGCONT
girst [Thu, 1 Nov 2018 20:30:24 +0000 (21:30 +0100)]
remove buggy 'p', fix vt220 issue, implement SIGCONT

vt220 is unable to cope with screen_setup() and show_minefield() in
rapid succession because downloading (parsing?) the DRCS takes a while.
resolution: only send .init_seq once.
also: an experimental 'choord on flag' mode is implemented behind a
-D... flag

5 years agoadd note that sending drcs breaks vt220
girst [Thu, 1 Nov 2018 19:32:15 +0000 (20:32 +0100)]
add note that sending drcs breaks vt220

5 years ago'p': stomp adjacent
girst [Thu, 1 Nov 2018 15:39:26 +0000 (16:39 +0100)]
'p': stomp adjacent

stopgap feature for HJKL/^H^J^K^L; does the common action of choording
around a cell after flagging it

5 years agoupdate readme keybindings
girst [Thu, 25 Oct 2018 13:35:19 +0000 (15:35 +0200)]
update readme keybindings

5 years agominor refactoring
girst [Thu, 25 Oct 2018 13:29:11 +0000 (15:29 +0200)]
minor refactoring

cannot reproduce "in `-d' mode if f.w is odd we are 1 char short in the
status line"

5 years agosimplify find/'til/after, backword
girst [Thu, 25 Oct 2018 13:05:36 +0000 (15:05 +0200)]
simplify find/'til/after, backword

5 years agoresize mode and ex mode improvements, backword
girst [Thu, 25 Oct 2018 13:00:02 +0000 (15:00 +0200)]
resize mode and ex mode improvements, backword

also some minor refactoring

5 years agoclean up ex mode
girst [Thu, 25 Oct 2018 09:36:58 +0000 (11:36 +0200)]
clean up ex mode

5 years agofirst draft of ex mode / colon commands
girst [Thu, 25 Oct 2018 06:47:55 +0000 (08:47 +0200)]
first draft of ex mode / colon commands

5 years agoon win: show all flags
girst [Wed, 24 Oct 2018 14:07:32 +0000 (16:07 +0200)]
on win: show all flags

the original minesweeper sets all mines to flags when won. this also
helps distinguishing wins from losses (that previously only differed
in emoticon)

5 years agoclear status line after dismissing quit dialog
girst [Thu, 24 May 2018 09:41:18 +0000 (11:41 +0200)]
clear status line after dismissing quit dialog

5 years agoless noisey `make test'
girst [Sun, 20 May 2018 20:25:33 +0000 (22:25 +0200)]
less noisey `make test'

5 years agofix -d maxwidth
girst [Sun, 20 May 2018 20:13:14 +0000 (22:13 +0200)]
fix -d maxwidth

5 years agoquit warning
girst [Sun, 20 May 2018 17:15:12 +0000 (19:15 +0200)]
quit warning

5 years agoalias fq for f?, macros renamed
girst [Sun, 20 May 2018 17:08:59 +0000 (19:08 +0200)]
alias fq for f?, macros renamed

5 years agofind, till, after x
girst [Sun, 20 May 2018 16:36:08 +0000 (18:36 +0200)]
find, till, after x

5 years ago-pedantic improvements; less noise in tests
girst [Sun, 20 May 2018 16:27:29 +0000 (18:27 +0200)]
-pedantic improvements; less noise in tests

5 years agofix stray STX messing with `m', `f', `t'
girst [Sun, 20 May 2018 16:02:14 +0000 (18:02 +0200)]
fix stray STX messing with `m', `f', `t'

5 years agoimplement find/till (horizontal only)
girst [Sun, 20 May 2018 15:54:18 +0000 (17:54 +0200)]
implement find/till (horizontal only)

5 years agostomp radius: fix disappearing mines on game over screen
girst [Wed, 2 May 2018 19:14:35 +0000 (21:14 +0200)]
stomp radius: fix disappearing mines on game over screen

5 years agoflesh out resize mode
girst [Tue, 1 May 2018 19:23:50 +0000 (21:23 +0200)]
flesh out resize mode

also fix a bug in clamp_fieldsize() re. win-width

5 years agostop timer on 'r', CTRL-R during game
girst [Tue, 1 May 2018 17:34:49 +0000 (19:34 +0200)]
stop timer on 'r', CTRL-R during game

5 years agostomp radius now with mouse, renamed partial_show_minefield()
girst [Mon, 30 Apr 2018 16:21:21 +0000 (18:21 +0200)]
stomp radius now with mouse, renamed partial_show_minefield()

partial_show_minefield() -> redraw_cell(): more intuitive, less long
stomp radius:
factored out into functions show_stomp() and wait_stomp().
initially, I just used them as-is in wait_mouse_up(), but then
do_uncover() showed the stomp _again_, which is undesired.
do_uncover() now takes a new parameter, actor, which tells it
what method the user used to activate it. (feels like a dirty
hack :( )

PS: this took 2 --amends to get right m(

5 years agoshave off 4 bytes in DEC scheme (II)
girst [Mon, 30 Apr 2018 15:43:04 +0000 (17:43 +0200)]
shave off 4 bytes in DEC scheme (II)

GNOME-Terminal is also missing DECDWL and we are using SS2 somewhere
else too; so this whole thing was moot and I'm doing it.
This reverts commit b7cb4eb688ac83ae91e8a63e7ba18c81e2a4d2c3.

5 years agostomp radius bugfix
girst [Mon, 30 Apr 2018 14:40:28 +0000 (16:40 +0200)]
stomp radius bugfix

go figure: the signal handler interrupting the poll(2) call makes it go
right though. that meant, the stomp radius might not be shown the full
150ms, but only a fraction of it if SIGALRM comes in at a unfavourable
time.

5 years agoadd mines.h as dependency
girst [Mon, 30 Apr 2018 02:42:03 +0000 (04:42 +0200)]
add mines.h as dependency

5 years agomove FIELDSPEC help into header
girst [Mon, 30 Apr 2018 02:41:49 +0000 (04:41 +0200)]
move FIELDSPEC help into header

5 years agoRevert "shave off 4 bytes in DEC scheme"
girst [Mon, 30 Apr 2018 02:31:04 +0000 (04:31 +0200)]
Revert "shave off 4 bytes in DEC scheme"

while that was a correct change, gnome-terminal and mlterm don't support
this escape sequence (xterm does) :(

This reverts commit 0dc199da7121ed4595229bb3fe99dd8891f59d8a.

5 years agoshave off 4 bytes in DEC scheme
girst [Mon, 30 Apr 2018 02:28:43 +0000 (04:28 +0200)]
shave off 4 bytes in DEC scheme

5 years agodon't warn on too many mines; minor cleanup, ideas for stomp-radius
girst [Mon, 30 Apr 2018 02:03:17 +0000 (04:03 +0200)]
don't warn on too many mines; minor cleanup, ideas for stomp-radius

5 years agorefactor resize mode, bump version number (changed scheme)
girst [Mon, 30 Apr 2018 00:50:36 +0000 (02:50 +0200)]
refactor resize mode, bump version number (changed scheme)

i'm out of numbers of pi i know off the top of my head

5 years agofinish resize mode
girst [Mon, 30 Apr 2018 00:20:21 +0000 (02:20 +0200)]
finish resize mode

 - use lower level getchar function: getch_wrapper() calls
   wait_mouse_up() which fails in resize mode.
 - must free_field() _before_ resizing the field, otherwise when
   free_field() iterates over f.{w,h} it might over- or undershoot

5 years agostart with resize mode (segfaults!), mouse highlight, minor cleanups
girst [Fri, 27 Apr 2018 18:12:55 +0000 (20:12 +0200)]
start with resize mode (segfaults!), mouse highlight, minor cleanups

mouse highlight is now also reverse-video instead of a glyph

5 years agoimplement AROUND() macro
girst [Fri, 27 Apr 2018 16:58:14 +0000 (18:58 +0200)]
implement AROUND() macro

replaces the many "for(line-1..line+1 and col-1..col+1)" loops

5 years agofix bug with pressing q during game; cleanup
girst [Fri, 27 Apr 2018 16:17:31 +0000 (18:17 +0200)]
fix bug with pressing q during game; cleanup

5 years agomore event loop refactoring: mainly get/set marks
girst [Thu, 26 Apr 2018 21:40:18 +0000 (23:40 +0200)]
more event loop refactoring: mainly get/set marks

5 years agorefactor main event loop
girst [Thu, 26 Apr 2018 20:49:33 +0000 (22:49 +0200)]
refactor main event loop

probably needs more testing. I've started reusing enums; let's see how
that turns out.

6 years agofurther refractoring (screen setup, game struct)
girst [Thu, 19 Apr 2018 19:26:39 +0000 (21:26 +0200)]
further refractoring (screen setup, game struct)

amended commit also fixes segfault introduced during refactor

6 years agofurther cleanup and refactoring
girst [Thu, 19 Apr 2018 17:17:25 +0000 (19:17 +0200)]
further cleanup and refactoring

6 years agohelp text into header
girst [Thu, 19 Apr 2018 14:59:36 +0000 (16:59 +0200)]
help text into header

6 years agomove fieldspec parsing into function
girst [Thu, 19 Apr 2018 14:42:37 +0000 (16:42 +0200)]
move fieldspec parsing into function

6 years agorestructure mines.c (renamed from mines_2017.c)
girst [Thu, 19 Apr 2018 13:16:57 +0000 (15:16 +0200)]
restructure mines.c (renamed from mines_2017.c)

 - move declarations in a header file

6 years agoextend test target (-pedantic build)
girst [Thu, 19 Apr 2018 12:47:26 +0000 (14:47 +0200)]
extend test target (-pedantic build)

6 years agofix "\e is non-ISO-standard escape sequence"
girst [Thu, 19 Apr 2018 12:40:20 +0000 (14:40 +0200)]
fix "\e is non-ISO-standard escape sequence"

-pedantic doesn't like the \e used in VT220's schema.h

6 years agofinally fix returning from alternate screen bug
girst [Thu, 19 Apr 2018 11:54:53 +0000 (13:54 +0200)]
finally fix returning from alternate screen bug

the cursor position was off causing the screen to get partially overwritten. now saving the cursor's position before entering alternate screen and restoring after exiting from it.

6 years agoremove flag_offset, fix operator precedence bug
girst [Sun, 1 Apr 2018 22:07:33 +0000 (00:07 +0200)]
remove flag_offset, fix operator precedence bug

found with -Wextra

6 years agoVT220: Soft charset for Flag glyph (cleanup)
girst [Sun, 1 Apr 2018 21:49:37 +0000 (23:49 +0200)]
VT220: Soft charset for Flag glyph (cleanup)

6 years agoDECDCL flag glyph (new version)
girst [Sun, 1 Apr 2018 21:33:15 +0000 (23:33 +0200)]
DECDCL flag glyph (new version)

6 years agonew flag for monoscheme
girst [Sun, 1 Apr 2018 00:53:33 +0000 (02:53 +0200)]
new flag for monoscheme

6 years agos/move/move_ph/ ; s/cursor_move/move_hi/
girst [Sat, 31 Mar 2018 23:07:53 +0000 (01:07 +0200)]
s/move/move_ph/ ; s/cursor_move/move_hi/

6 years agoadd `make test'
girst [Sat, 31 Mar 2018 23:02:03 +0000 (01:02 +0200)]
add `make test'

6 years agominor cleanup
girst [Sat, 31 Mar 2018 23:01:50 +0000 (01:01 +0200)]
minor cleanup

6 years agocrudely fix `-q' flagcounter, :D clicking in dec mode wasn't broken at all
girst [Sat, 31 Mar 2018 22:23:03 +0000 (00:23 +0200)]
crudely fix `-q' flagcounter, :D clicking in dec mode wasn't broken at all

6 years agoimplement 'z' key, improved scheme (is new version)
girst [Sat, 31 Mar 2018 21:31:23 +0000 (23:31 +0200)]
implement 'z' key, improved scheme (is new version)

6 years agosimplify :D click, fix :o emoticon in DEC mode
girst [Sat, 31 Mar 2018 20:54:17 +0000 (22:54 +0200)]
simplify :D click, fix :o emoticon in DEC mode

6 years agofix segfault when clicking out of bound and then using the keyboard
girst [Sat, 31 Mar 2018 20:17:36 +0000 (22:17 +0200)]
fix segfault when clicking out of bound and then using the keyboard

6 years agoimplement cursor keys, fix endgame emoticon, minor fixes
girst [Sat, 31 Mar 2018 20:00:25 +0000 (22:00 +0200)]
implement cursor keys, fix endgame emoticon, minor fixes

6 years agosimplify border, minor fixes, 80col code, etc
girst [Sat, 31 Mar 2018 18:58:53 +0000 (20:58 +0200)]
simplify border, minor fixes, 80col code, etc

6 years agofinish schemes cleanup, fix %.*s format
girst [Sat, 31 Mar 2018 15:57:37 +0000 (17:57 +0200)]
finish schemes cleanup, fix %.*s format

6 years agocleanup color esc.seq with macro
girst [Sat, 31 Mar 2018 15:04:21 +0000 (17:04 +0200)]
cleanup color esc.seq with macro

6 years agocleanup schemes.h
girst [Sat, 31 Mar 2018 14:45:30 +0000 (16:45 +0200)]
cleanup schemes.h

6 years agocolor flag, v2
girst [Sat, 31 Mar 2018 14:42:38 +0000 (16:42 +0200)]
color flag, v2

6 years agocolor flag icon, v1
girst [Sat, 31 Mar 2018 14:28:06 +0000 (16:28 +0200)]
color flag icon, v1

6 years agofix missing modechar after flagging
girst [Thu, 29 Mar 2018 04:38:25 +0000 (06:38 +0200)]
fix missing modechar after flagging

6 years agofix mines>999, time>999, simplify 2nd line
girst [Thu, 29 Mar 2018 02:25:58 +0000 (04:25 +0200)]
fix mines>999, time>999, simplify 2nd line

6 years agocrude patch for >999 mines
girst [Thu, 29 Mar 2018 01:02:33 +0000 (03:02 +0200)]
crude patch for >999 mines

6 years agoclamp field size to window/mouse-max, dynamic minenum if not given
girst [Sat, 24 Mar 2018 23:35:12 +0000 (00:35 +0100)]
clamp field size to window/mouse-max, dynamic minenum if not given

6 years agocount non-placed flags (down) instead of placed (up)
girst [Wed, 7 Mar 2018 00:59:56 +0000 (01:59 +0100)]
count non-placed flags (down) instead of placed (up)

6 years agoadd default mine-num for 8x8 and 16x16
girst [Mon, 5 Mar 2018 01:54:45 +0000 (02:54 +0100)]
add default mine-num for 8x8 and 16x16

6 years agotodo: wait_mouse_up does not redraw correct emoticon
girst [Sat, 3 Mar 2018 16:21:05 +0000 (17:21 +0100)]
todo: wait_mouse_up does not redraw correct emoticon

6 years agoadd bug notice
girst [Sat, 3 Mar 2018 16:14:02 +0000 (17:14 +0100)]
add bug notice

6 years agonicer emoticons
girst [Sat, 3 Mar 2018 16:09:56 +0000 (17:09 +0100)]
nicer emoticons

didn't like the X( and 8) -- eyes now always colons

6 years agoadd game won emoticon, move them to schemes.h
girst [Sat, 3 Mar 2018 16:08:19 +0000 (17:08 +0100)]
add game won emoticon, move them to schemes.h

6 years agoupdate keybindings in `-h'
girst [Wed, 28 Feb 2018 02:13:24 +0000 (03:13 +0100)]
update keybindings in `-h'

6 years agoincrease version number
girst [Wed, 28 Feb 2018 02:06:12 +0000 (03:06 +0100)]
increase version number

6 years agofix typos in readme
girst [Wed, 28 Feb 2018 02:03:03 +0000 (03:03 +0100)]
fix typos in readme

6 years agoupdate readme to reflect recent changes
girst [Wed, 28 Feb 2018 01:58:15 +0000 (02:58 +0100)]
update readme to reflect recent changes

6 years agomove find-word-boundary code into one giant macro (dry)
girst [Wed, 28 Feb 2018 01:49:17 +0000 (02:49 +0100)]
move find-word-boundary code into one giant macro (dry)

have fun debugging this mess, future me!

6 years agobetter bigmove (now moves to "word boundaries" (changes of open/flag state))
girst [Wed, 28 Feb 2018 00:52:58 +0000 (01:52 +0100)]
better bigmove (now moves to "word boundaries" (changes of open/flag state))

6 years agoadd indicator for space mode next to the time
girst [Wed, 28 Feb 2018 00:09:01 +0000 (01:09 +0100)]
add indicator for space mode next to the time

6 years agoworking invert cursor
girst [Tue, 27 Feb 2018 23:49:36 +0000 (00:49 +0100)]
working invert cursor

6 years agotesting some flag patterns
girst [Tue, 27 Feb 2018 23:03:13 +0000 (00:03 +0100)]
testing some flag patterns

6 years agomodeful space will always choord, s/set_cursor_pos/move_cursor/
girst [Fri, 23 Feb 2018 01:42:23 +0000 (02:42 +0100)]
modeful space will always choord, s/set_cursor_pos/move_cursor/

6 years agoupdate introductory comment & version number
girst [Fri, 23 Feb 2018 01:00:24 +0000 (02:00 +0100)]
update introductory comment & version number

6 years agoimplement modeful space, cleanup gameloop a tiny bit
girst [Fri, 23 Feb 2018 00:43:31 +0000 (01:43 +0100)]
implement modeful space, cleanup gameloop a tiny bit

6 years agoslightly improve alt.screen handling (will force-clear)
girst [Sun, 18 Feb 2018 20:31:25 +0000 (21:31 +0100)]
slightly improve alt.screen handling (will force-clear)

6 years agochange command line switches -w -h -m to positional
girst [Sun, 18 Feb 2018 17:08:32 +0000 (18:08 +0100)]
change command line switches -w -h -m to positional

6 years agoimplement m ' ` (mark and jump)
girst [Sun, 18 Feb 2018 16:32:57 +0000 (17:32 +0100)]
implement m ' ` (mark and jump)

Imprint / Impressum