summary refs log tree commit diff
path: root/freecell.c
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2022-08-31 21:13:10 -0400
committerJune McEnroe <june@causal.agency>2022-08-31 21:13:10 -0400
commited0b67bfde7c4762d95c6132fad8d3fa66c6c76c (patch)
tree4643082f1a2a3fd989844b8b9904ee28ae4b15be /freecell.c
parentFill in some Info.plist fields (diff)
downloadwep-ed0b67bfde7c4762d95c6132fad8d3fa66c6c76c.tar.gz
wep-ed0b67bfde7c4762d95c6132fad8d3fa66c6c76c.zip
Add F5 to restart game
Diffstat (limited to 'freecell.c')
-rw-r--r--freecell.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/freecell.c b/freecell.c
index 28b277e..a346277 100644
--- a/freecell.c
+++ b/freecell.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2019  C. McEnroe <june@causal.agency>
+/* Copyright (C) 2019  June McEnroe <june@causal.agency>
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as published by
@@ -340,12 +340,14 @@ static enum Choice chooseMove(void) {
 	return choice;
 }
 
+static uint currentGame;
 static void newGame(uint game) {
 	if (!game) game = 1 + randUniform(32000);
 	deal(game);
 	char buf[sizeof("FreeCell Game #32000")];
 	snprintf(buf, sizeof(buf), "FreeCell Game #%u", game);
 	SDL_SetWindowTitle(window, buf);
+	currentGame = game;
 }
 
 static Card hiliteRank;
@@ -355,6 +357,7 @@ static uint fromStack = StacksLen;
 static bool keyDown(SDL_KeyboardEvent key) {
 	switch (key.keysym.sym) {
 		case SDLK_F2: newGame(0); return true;
+		case SDLK_F5: newGame(currentGame); return true;
 		case SDLK_BACKSPACE: return undo();
 	}
 	if (key.repeat) return false;
00'>2016-02-04More iTerm configuration tweaksJune McEnroe 2016-02-03Update to iTerm 2.9 betaJune McEnroe 2016-01-31Spawn non-login shells in iTermJune McEnroe 2016-01-28Remove linux gvim aliasJune McEnroe 2016-01-28Rewrite zshrcJune McEnroe 2016-01-28Strip out useless commentsJune McEnroe 2016-01-28Trim tmux configurationJune McEnroe 2016-01-28Remove psql format wrappedJune McEnroe 2016-01-25Wow, that is so annoying, gitJune McEnroe 2016-01-25Clean up .gitconfigJune McEnroe 2016-01-15Remove gitignoreJune McEnroe 2016-01-15Eliminate escape key delay in zshJune McEnroe 2016-01-15Move pretty git log format to .gitconfigJune McEnroe 2016-01-14Remove unused git aliasesJune McEnroe 2016-01-06Hash SSH known hostsJune McEnroe 2015-12-30Ignore directory .swp filesJune McEnroe 2015-12-16Color prompt yellow in vi normal modeJune McEnroe 2015-11-23Remove colorcolumn at 120June McEnroe 2015-11-23Always git rebase --autosquashJune McEnroe 2015-11-18Add inverted shift to KarabinerJune McEnroe 2015-11-06Clean up git configsJune McEnroe 2015-11-06Add prune scriptJune McEnroe 2015-11-03Update vendored Gruvbox colorschemeJune McEnroe 2015-11-02Redefine _newline_precmd in _newline_precmdJune McEnroe 2015-11-02Print newline before every prompt after firstJune McEnroe 2015-11-02Remove first prompt placementJune McEnroe 2015-11-02Newline before prompt and start at bottom of terminalJune McEnroe 2015-10-27Add chruby to zshrcJune McEnroe