i have found one bug. when i put glenda in a position like this (see attachment, excuse my excellent screenshot skills :D. i need to play a lot) i somehow win, but the glenda can escape from there. diff renewed to fix that bug. in addition, i have changed the games manpage to include more info about glendy. diff -r cc26fdf57bb2 sys/man/1/games --- a/sys/man/1/games Sat Mar 13 14:57:53 2021 +0100 +++ b/sys/man/1/games Fri Apr 02 22:29:07 2021 +0300 @@ -200,7 +200,9 @@ add gibberish diagrams, equations and tables. .TP .B glendy -Don't let the rabbit escape. +Don't let the rabbit escape. Button 2 presents a menu that you +can set the difficulty level from. Button 3 presents a menu +that you can either play a new game, reset the game or exit. .TP .B juggle Display the juggling diff -r cc26fdf57bb2 sys/src/games/glendy.c --- a/sys/src/games/glendy.c Sat Mar 13 14:57:53 2021 +0100 +++ b/sys/src/games/glendy.c Fri Apr 02 22:29:07 2021 +0300 @@ -386,11 +386,10 @@ nextdir = (nrand(++count) == 0)?dir:nextdir; } } - if(min < 100) + if(min <= 100) domove(nextdir, p.x, p.y); - else + else finished = Won; - if(eqpt(findglenda(), Pt(-1, -1))) finished = Lost; } @@ -473,11 +472,7 @@ allocimages(); initlevel(); /* must happen before "eresized" */ - eresized(0); - - fontname = "/lib/font/bit/lucidasans/unicode.8.font"; - if((font = openfont(display, fontname)) == nil) - sysfatal("font '%s' not found", fontname); + eresized(0); for(;;) { e = event(&ev);