VIper.git
21 months agorename to 'viper', new makefile master github/master
girst [Sat, 2 Feb 2019 16:49:43 +0000 (17:49 +0100)]
rename to 'viper', new makefile

21 months agoimplement SIGTSTP handling
girst [Sat, 26 Jan 2019 18:45:45 +0000 (19:45 +0100)]
implement SIGTSTP handling

22 months agofix raw mode bug
girst [Sat, 5 Jan 2019 18:12:39 +0000 (19:12 +0100)]
fix raw mode bug

doesn't apply to this application, but was fixed in minesviiper

2 years agouse correct longjmp buffer
girst [Mon, 5 Nov 2018 14:36:12 +0000 (15:36 +0100)]
use correct longjmp buffer

so clang on freebsd doesn't emit a warning

2 years agominor cleanup
girst [Mon, 5 Nov 2018 14:35:08 +0000 (15:35 +0100)]
minor cleanup

from the 4th of september, never committed

2 years agoincrease freeze steps, remove debug/test code
girst [Mon, 3 Sep 2018 17:09:32 +0000 (19:09 +0200)]
increase freeze steps, remove debug/test code

2 years agotime freeze bonus
girst [Mon, 3 Sep 2018 17:02:15 +0000 (19:02 +0200)]
time freeze bonus

2 years agomore food items
girst [Mon, 3 Sep 2018 13:39:14 +0000 (15:39 +0200)]
more food items

2 years agoremove vt220 support, II
girst [Mon, 3 Sep 2018 13:26:49 +0000 (15:26 +0200)]
remove vt220 support, II

2 years agoremove vt220 support
girst [Mon, 3 Sep 2018 13:24:58 +0000 (15:24 +0200)]
remove vt220 support

too much hassle, not enough bandwidth

2 years agoreadme: formatting
girst [Mon, 3 Sep 2018 13:01:36 +0000 (15:01 +0200)]
readme: formatting

2 years agoreadme: new todo
girst [Mon, 3 Sep 2018 13:00:08 +0000 (15:00 +0200)]
readme: new todo

2 years agocleanup wrapmode, fix bonus interval
girst [Mon, 3 Sep 2018 12:57:11 +0000 (14:57 +0200)]
cleanup wrapmode, fix bonus interval

when consuming an item, set the time of next bonus then (instead of just
when spawning). at spawn time we also factor in the time a bonus might
be alive (can be shortened by eating it).

bonus actions (i.e. wraparound) is now a bitmap. thus, more than 1
action might be active at the same time.

2 years agolonghelp: add -l
girst [Mon, 3 Sep 2018 08:37:32 +0000 (10:37 +0200)]
longhelp: add -l

2 years agowrap-around-mode (needs cleanup)
girst [Mon, 3 Sep 2018 07:53:04 +0000 (09:53 +0200)]
wrap-around-mode (needs cleanup)

2 years agorefactor pause screen; todos, readme updated
girst [Fri, 31 Aug 2018 21:42:21 +0000 (23:42 +0200)]
refactor pause screen; todos, readme updated

2 years agofix: snake speed bug
girst [Fri, 31 Aug 2018 20:57:33 +0000 (22:57 +0200)]
fix: snake speed bug

originally, I noticed the snake speeding up when eating a BONUS_SLOW,
suspecting a bug there. as i found out a after way too long, i forgot to
restart the timer after routinely incrementing the velocity every 100
points. m(

however, a nice routine for debugging this was the following at the end
of the draw_sprites():
 #include<sys/timeb.h>
 struct timeb __now_time__;
 ftime(&__now_time__);
 long __time__ = __now_time__.time*1000+__now_time__.millitm;
 static long __last_time__ = 0;
 if(__last_time__) printf ("->%f (%ld)<-", g.v, __time__-__last_time__);
 __last_time__ = __time__;

2 years agoescape bonus items in ASCII mode
girst [Fri, 13 Jul 2018 17:55:14 +0000 (19:55 +0200)]
escape bonus items in ASCII mode

2 years agonew todo (vt220 softcharset), strike through done
girst [Fri, 6 Jul 2018 13:56:30 +0000 (15:56 +0200)]
new todo (vt220 softcharset), strike through done

2 years agonote about dejavu mono braille chars
girst [Fri, 6 Jul 2018 13:39:57 +0000 (15:39 +0200)]
note about dejavu mono braille chars

2 years agoreadme: small blurb about dependencies, todo item->done
girst [Fri, 6 Jul 2018 13:32:06 +0000 (15:32 +0200)]
readme: small blurb about dependencies, todo item->done

2 years agobonus timeouts (incl. warning)
girst [Fri, 6 Jul 2018 13:25:57 +0000 (15:25 +0200)]
bonus timeouts (incl. warning)

2 years ago`-pedantic' fixes
girst [Thu, 24 May 2018 22:37:23 +0000 (00:37 +0200)]
`-pedantic' fixes

2 years agofix memory leak
girst [Thu, 24 May 2018 21:18:44 +0000 (23:18 +0200)]
fix memory leak

2 years agoBonus items: shorten/elongate snake, speed up/down
girst [Thu, 24 May 2018 20:41:31 +0000 (22:41 +0200)]
Bonus items: shorten/elongate snake, speed up/down

2 years agoBONUS item: snip (Proof of Concept stage)
girst [Thu, 24 May 2018 14:57:58 +0000 (16:57 +0200)]
BONUS item: snip (Proof of Concept stage)

2 years agoclear keyboard buffer on game over
girst [Thu, 24 May 2018 14:25:49 +0000 (16:25 +0200)]
clear keyboard buffer on game over

to test: start with -l50, then stairstep into yourself. on restart,
snake must not continue stairstepping.

2 years agospeed up every 100 points
girst [Thu, 24 May 2018 10:26:05 +0000 (12:26 +0200)]
speed up every 100 points

2 years agoappend_snake(-1,-1) redraw fix
girst [Thu, 24 May 2018 10:13:34 +0000 (12:13 +0200)]
append_snake(-1,-1) redraw fix

2 years ago`-l`: set initial snake length; better init_snake meandering
girst [Thu, 24 May 2018 09:59:12 +0000 (11:59 +0200)]
`-l`: set initial snake length; better init_snake meandering

2 years agoend game when no more free spaces to go
girst [Thu, 24 May 2018 08:58:50 +0000 (10:58 +0200)]
end game when no more free spaces to go

also: end screen message configurable

2 years agos/op.scheme/op.sch/g
girst [Tue, 22 May 2018 13:19:09 +0000 (15:19 +0200)]
s/op.scheme/op.sch/g

2 years agonice end screen
girst [Tue, 22 May 2018 13:08:40 +0000 (15:08 +0200)]
nice end screen

2 years ago^Z bug: proper fix
girst [Tue, 22 May 2018 12:46:28 +0000 (14:46 +0200)]
^Z bug: proper fix

the shell unsets raw_mode, so we need to set it again and also redraw
the field.

2 years agogame loop (restartable), fix memory leak
girst [Tue, 22 May 2018 12:41:09 +0000 (14:41 +0200)]
game loop (restartable), fix memory leak

if we set respawn, we need to break out of the loop, otherwise `i' gets
->next'ed until i == NULL. then, spawn_item() will malloc() a new item,
and `i' was not freed(), but just NULL'd.

2 years agoREADME: konsole setup
girst [Tue, 22 May 2018 09:38:24 +0000 (11:38 +0200)]
README: konsole setup

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

2 years agofix food-appears-in-heads-old-location bug
girst [Sun, 20 May 2018 18:07:53 +0000 (20:07 +0200)]
fix food-appears-in-heads-old-location bug

2 years agoproof of concept for ^Z bug
girst [Sun, 20 May 2018 17:00:39 +0000 (19:00 +0200)]
proof of concept for ^Z bug

2 years agoREADME: update TODOs
girst [Sun, 20 May 2018 17:00:28 +0000 (19:00 +0200)]
README: update TODOs

2 years agofix width-off-by-one-column bug
girst [Sun, 20 May 2018 08:09:33 +0000 (10:09 +0200)]
fix width-off-by-one-column bug

2 years agosimplify direction buffer access
girst [Sun, 20 May 2018 07:57:32 +0000 (09:57 +0200)]
simplify direction buffer access

2 years agouse ring buffer for movement, minor cleanup
girst [Sun, 20 May 2018 07:31:50 +0000 (09:31 +0200)]
use ring buffer for movement, minor cleanup

(saves on malloc() for every keypress)

2 years agodon't truncate snake on small fields, fix unpause graphics glitch
girst [Sun, 20 May 2018 06:23:55 +0000 (08:23 +0200)]
don't truncate snake on small fields, fix unpause graphics glitch

2 years agoWIP: only redraw changed bits
girst [Sat, 19 May 2018 23:53:10 +0000 (01:53 +0200)]
WIP: only redraw changed bits

2 years agoreuse memory when consuming and re-spawning item
girst [Sat, 19 May 2018 23:35:39 +0000 (01:35 +0200)]
reuse memory when consuming and re-spawning item

2 years agominor in-code cleanup, documentation
girst [Sat, 19 May 2018 23:18:42 +0000 (01:18 +0200)]
minor in-code cleanup, documentation

i wanted to remove the 'only draw diff'-todo and looked into where i was
calling show_playfield(). i didn't call it anywhere where i expected it,
so i fired up gdb. gdb told me show_playfield() gets called from the
input loop after the switch(getchar()). i was puzzled about that,
because it fired even when no keys were pressed. then i noticed that
everytime the signal handler fires, a STX (ASCII 0x02) gets pushed onto
stdin.  WHO FIGURES?!  i was unable to find anything in the
documentation of sigaction or on the internet that indicates this!

2 years agosimple pause mode
girst [Sat, 19 May 2018 21:57:45 +0000 (23:57 +0200)]
simple pause mode

`p' to pause; then `q' to exit, any other key to unpause

2 years agodec charset, print cleanup, command line args, ...
girst [Sat, 19 May 2018 07:30:05 +0000 (09:30 +0200)]
dec charset, print cleanup, command line args, ...

2 years agofix segfault when eating food
girst [Sat, 19 May 2018 06:13:21 +0000 (08:13 +0200)]
fix segfault when eating food

2 years agofound segfault (yay! :/ )
girst [Sat, 19 May 2018 03:10:24 +0000 (05:10 +0200)]
found segfault (yay! :/ )

2 years agolongjmp proof-of-concept; set name for velocity
girst [Sat, 19 May 2018 02:59:06 +0000 (04:59 +0200)]
longjmp proof-of-concept; set name for velocity

(also delete some emojis that are not dispayed in cjk-fullwidth)

2 years agoeven worse coloring hack
girst [Fri, 18 May 2018 23:54:44 +0000 (01:54 +0200)]
even worse coloring hack

2 years agoupdate readme TODOs
girst [Fri, 18 May 2018 23:40:18 +0000 (01:40 +0200)]
update readme TODOs

2 years agolinked list code cleanup
girst [Fri, 18 May 2018 23:30:37 +0000 (01:30 +0200)]
linked list code cleanup

2 years agoclean up append_movement to not add same direction twice
girst [Fri, 18 May 2018 22:47:39 +0000 (00:47 +0200)]
clean up append_movement to not add same direction twice

2 years agoemoji list
girst [Fri, 18 May 2018 21:39:27 +0000 (23:39 +0200)]
emoji list

2 years agofix fast 180° turns (queue all directional keystrokes)
girst [Fri, 18 May 2018 21:30:32 +0000 (23:30 +0200)]
fix fast 180° turns (queue all directional keystrokes)

2 years agogreen snek (dirty (temporary) hack)
girst [Fri, 18 May 2018 00:15:00 +0000 (02:15 +0200)]
green snek (dirty (temporary) hack)

2 years agoexperiment with snake speeds (very ugly)
girst [Fri, 18 May 2018 00:07:38 +0000 (02:07 +0200)]
experiment with snake speeds (very ugly)

2 years agodifferent food values
girst [Thu, 17 May 2018 23:27:56 +0000 (01:27 +0200)]
different food values

2 years agomove enums, struct defs, etc into header file
girst [Thu, 17 May 2018 23:08:11 +0000 (01:08 +0200)]
move enums, struct defs, etc into header file

2 years agoschemes into .h
girst [Thu, 17 May 2018 22:36:21 +0000 (00:36 +0200)]
schemes into .h

2 years agoinitial (proof-of-concept-y) code
girst [Thu, 17 May 2018 21:41:04 +0000 (23:41 +0200)]
initial (proof-of-concept-y) code

Imprint / Impressum