From 0ea390f08b15a12d865816fa8efd402e7b0c0027 Mon Sep 17 00:00:00 2001 From: "C. McEnroe" Date: Fri, 29 Jan 2021 16:00:37 -0500 Subject: Add pause to snake --- snake.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/snake.c b/snake.c index b67fe4d..e2d6e11 100644 --- a/snake.c +++ b/snake.c @@ -187,6 +187,13 @@ static void input(void) { break; case 'k': case KEY_UP: dy = -1; dx = 0; break; case 'l': case KEY_RIGHT: dy = 0; dx = +1; break; case 'q': over = "You are satisfied."; + break; case 'p': case ' ': { + nodelay(stdscr, false); + do { + ch = getch(); + } while (ch != ERR && ch != 'p' && ch != ' '); + nodelay(stdscr, true); + } break; case ERR: exit(EXIT_FAILURE); } if (dy == -head.dy && dx == -head.dx) return; -- cgit 1.4.1 d'>master dontfiles
summary refs log tree commit diff
path: root/bin (unfollow)
Commit message (Collapse)Author
2021-01-02Tag top-level typedefs the same way as function definitionsJune McEnroe
2021-01-01Clean up order lexerJune McEnroe
2021-01-01Remove empty comma statement from bitJune McEnroe
2021-01-01Increment license header templatesJune McEnroe
2020-12-31Tell "Music" rather than "iTunes"June McEnroe
It's the new era.
2020-12-31Add ASCII control code names to bitJune McEnroe
2020-12-31Simplify bit lexing and parsingJune McEnroe
Also print the value of each expression separated by commas.
2020-12-31Add ddateJune McEnroe
I'm tired of package managers not having this!
2020-12-30Print octal for 8 bits in bitJune McEnroe
2020-12-30Add unary & to bitJune McEnroe
Also unary + and fix precedence of unary -.
2020-12-30Support unary + in orderJune McEnroe
Missed this because operator(7) just doesn't list it, oddly.
2020-12-30Add postfix $ operator to bitJune McEnroe
2020-12-29Add make lexerJune McEnroe
This is kind of a mess and needs to be cleaned up against more careful reading of the make grammar.
2020-12-29Clean up C lexerJune McEnroe
This ordering of rules feels much cleaner.
2020-12-29Clean up hilex code somewhatJune McEnroe
2020-12-29Match lex/yacc %% %{ %} lines as MacroJune McEnroe
2020-12-29Match top-level C definitions as IdentifierTagJune McEnroe
2020-12-29Match C type declarations as IdentifierTagJune McEnroe
2020-12-29Match function-like macro definitions as IdentifierTagJune McEnroe
2020-12-29Reconfigure C macro start conditionsJune McEnroe
2020-12-29Document HTML class namesJune McEnroe
2020-12-29Rename Tag class to IdentifierTagJune McEnroe
2020-12-29Change HTML class from hi to hilexJune McEnroe
You can tell I was just copying the HTML code huh.
2020-12-29Add hilex HTML outputJune McEnroe