Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
- /*
- * File: main.c
- * Author: francisco, juliana, pedro
- *
- * Created on 21 de Novembro de 2017, 9:17
- */
- #ifdef _WIN32
- #include <conio.h>
- #else
- #include <stdio.h>
- #define clrscr() printf("\e[1;1H\e[2J")
- #endif
- #include <stdlib.h>
- #include <string.h>
- #include <malloc.h>
- #include <time.h>
- #include <math.h>
- #include "LP_Leitura.h"
- #include "LP_Utils.h"
- #include "common.h"
- #include "cpu.h"
- #include "credits.h"
- #include "history.h"
- #include "human.h"
- void showMenu() {
- int option = 0;
- gamesHistory *game;
- int gamesNumber, maxSize;
- while (option != 5) {
- clrscr(); //Clear the screen
- readInt(&option, 1, 5, "Introduza um número de 1 a 5\n"
- "1- Jogar contra o CPU\n"
- "2- Jogar localmente\n"
- "3- Ver histórico de jogos\n"
- "4- Créditos\n"
- "5- Sair\n");
- if (option > 0 && option < 6) {
- switch (option) {
- case 1:
- setupPlayCPU();
- break;
- case 2:
- setupPlayHuman();
- break;
- case 3:
- readData(&game, &gamesNumber, &maxSize);
- listGamesHistory(game, gamesNumber);
- break;
- case 4:
- credits();
- break;
- case 5:
- exit(0);
- break;
- }
- }
- }
- }
- int main(int argc, char** argv) {
- showMenu();
- return (EXIT_SUCCESS);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement