polybius-square/method_menu.c

67 lines
1.4 KiB
C

/* method_menu.c
This function is part of the Polysqu program. It presents the user with a
choice to encrypt of decrypt a message.
Copyright (C) 2015, 2016 Scott C. MacCallum
scm@ma.sdf.org
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 the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include <stdio.h>
#include <stdlib.h>
void encrypt_menu(void);
void decrypt_menu(void);
void method_menu(void)
{
int choice;
printf("What would you like to preform?\n");
printf("\n");
printf("1. Encrypt Message\n");
printf("2. Decrypt Message\n");
printf("3. Quit\n");
printf("\n");
printf("Number: ");
scanf("%d", &choice);
switch (choice) {
case 1:
encrypt_menu();
break;
case 2:
decrypt_menu();
break;
case 3:
printf("\n");
printf("Good bye!\n");
printf("\n");
exit(0);
default:
printf("\n");
printf("ERROR, bad input.\n");
printf("\n");
exit(1);
}
}