Add version display
This commit is contained in:
parent
e47e1e4f7a
commit
677f7f5be0
2 changed files with 17 additions and 7 deletions
|
@ -4,6 +4,7 @@
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include "utictactoe.h"
|
||||||
|
|
||||||
void help(){
|
void help(){
|
||||||
printf("usage: utictactoe ([-i LEVEL|-x N|-o N|-v|-V|-h] | -c FILE)\n");
|
printf("usage: utictactoe ([-i LEVEL|-x N|-o N|-v|-V|-h] | -c FILE)\n");
|
||||||
|
@ -48,25 +49,28 @@ int main(int argc, char* argv[]) {
|
||||||
inception_level = 2;
|
inception_level = 2;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'x': /* 'a' option */
|
case 'x':
|
||||||
printf ("contest activated\n");
|
printf ("cross ai\n");
|
||||||
cross_ai = true;
|
cross_ai = true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'o': /* 'a' option */
|
case 'o':
|
||||||
printf ("contest activated\n");
|
printf ("round ai\n");
|
||||||
round_ai = true;
|
round_ai = true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'c': /* 'a' option */
|
case 'c':
|
||||||
printf ("contest activated\n");
|
printf ("contest activated\n");
|
||||||
contest = true;
|
contest = true;
|
||||||
break;
|
break;
|
||||||
|
case 'V':
|
||||||
|
printf("utictactoe %d.%d.%d\n", VERSION, SUBVERSION, REVISION);
|
||||||
|
printf("This software implements a full ultimate tictactoe game.\n");
|
||||||
|
exit(EXIT_SUCCESS);
|
||||||
case 'h':
|
case 'h':
|
||||||
help();
|
help();
|
||||||
exit(EXIT_SUCCESS);
|
exit(EXIT_SUCCESS);
|
||||||
|
|
||||||
default:
|
default:
|
||||||
exit (EXIT_FAILURE);
|
exit (EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,6 @@
|
||||||
|
#ifndef UTICTACTOE_H
|
||||||
|
#define UTICTACTOE_H
|
||||||
|
#define VERSION 1
|
||||||
|
#define SUBVERSION 0
|
||||||
|
#define REVISION 0
|
||||||
|
#endif /* UTICTACTOE_H */
|
Loading…
Add table
Add a link
Reference in a new issue