summary refs log tree commit diff homepage
diff options
context:
space:
mode:
-rw-r--r--2048.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/2048.c b/2048.c
index 8546d4b..48c13cb 100644
--- a/2048.c
+++ b/2048.c
@@ -186,6 +186,8 @@ enum {
 	GridX = 2,
 	ScoreY = 0,
 	ScoreX = GridX + 4 * TileWidth - 10,
+	HelpY = GridY,
+	HelpX = GridX + 5 * TileWidth,
 };
 
 static void drawTile(uint y, uint x) {
@@ -225,6 +227,12 @@ static void draw(void) {
 	}
 }
 
+static void drawHelp(void) {
+	mvaddstr(HelpY + 0, HelpX, "Use the arrow keys to");
+	mvaddstr(HelpY + 1, HelpX, "slide and merge tiles.");
+	mvaddstr(HelpY + 2, HelpX, "Press q to quit.");
+}
+
 static bool input(void) {
 	switch (getch()) {
 		break; case 'h': case KEY_LEFT: if (left()) spawn();
@@ -240,7 +248,10 @@ uint play2048(void) {
 	curse();
 	spawn();
 	spawn();
+	drawHelp();
+	uint help = 0;
 	do {
+		if (help++ == 3) erase();
 		draw();
 	} while (input());
 	return score;
12-31 18:20:15 -0500'>2019-12-31Refactor scoop formatters and group colored outputJune McEnroe 2019-12-31Add strftime format string optionJune McEnroe 2019-12-31Refactor binding in scoopJune McEnroe 2019-12-31Add option to group events by contextJune McEnroe 2019-12-31Add missing includeJune McEnroe 2019-12-31Use standout mode for highlightingJune McEnroe 2019-12-31Rewrite scoop(1) argument descriptionsJune McEnroe 2019-12-31Color both nicks in a changeJune McEnroe 2019-12-31Implement nick-colored outputJune McEnroe 2019-12-31Only enable highlighting on terminal outputJune McEnroe 2019-12-31Set up pager pipeJune McEnroe 2019-12-30Normalize date inputJune McEnroe 2019-12-30Add initial rough version of scoopJune McEnroe 2019-12-30Join with USING wherever possibleJune McEnroe 2019-12-30Add -D flag to prospective scoop manualJune McEnroe 2019-12-30Order results by ID in outer query in litterboxJune McEnroe 2019-12-30Use X macro for Type enumJune McEnroe 2019-12-30Remove scoop -ABCJune McEnroe 2019-12-30Add limit option for litterbox's search query interfaceJune McEnroe