Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draw a beautiful 'You won!' window #22

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion src/ttysolitaire.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ struct game game;
void version();
void usage(const char *);
void draw_greeting();
void draw_you_won();

int main(int argc, char *argv[]) {
int option;
Expand Down Expand Up @@ -99,9 +100,14 @@ int main(int argc, char *argv[]) {
keyboard_event(getch());
} while (!game_won());

clear();
draw_you_won();
refresh();
getch();
clear();

endwin();
game_end();
printf("You won.\n");

return(0);
}
Expand All @@ -115,6 +121,15 @@ void draw_greeting() {
mvprintw(15, 19, "Press the space bar to play or q to quit.");
}

void draw_you_won() {
mvprintw(10, 8, "██╗ ██╗ ██████╗ ██╗ ██╗ ██╗ ██╗ ██████╗ ███╗ ██╗██╗");
mvprintw(11, 8, "╚██╗ ██╔╝██╔═══██╗██║ ██║ ██║ ██║██╔═══██╗████╗ ██║██║");
mvprintw(12, 8, " ╚████╔╝ ██║ ██║██║ ██║ ██║ █╗ ██║██║ ██║██╔██╗ ██║██║");
mvprintw(13, 8, " ╚██╔╝ ██║ ██║██║ ██║ ██║███╗██║██║ ██║██║╚██╗██║╚═╝");
mvprintw(14, 8, " ██║ ╚██████╔╝╚██████╔╝ ╚███╔███╔╝╚██████╔╝██║ ╚████║██╗");
mvprintw(15, 8, " ╚═╝ ╚═════╝ ╚═════╝ ╚══╝╚══╝ ╚═════╝ ╚═╝ ╚═══╝╚═╝");
}

void usage(const char *program_name) {
printf("usage: %s [-v|--version] [-h|--help] [-p|--passes=NUMBER]\n", program_name);
printf(" -v, --version Show version\n");
Expand Down