aboutsummaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorNathan Vance <nathav63@gmail.com>2015-07-27 19:15:59 -0400
committerNathan Vance <nathav63@gmail.com>2015-07-27 19:15:59 -0400
commit06818a49b337ef5d3277ebf6ed0b3f13a88239d3 (patch)
tree500f311c25ac68fc9a3b8429bf0747572e4d3e69 /main.c
parentfixed bugs and formatting errors (diff)
download7w-06818a49b337ef5d3277ebf6ed0b3f13a88239d3.tar.gz
7w-06818a49b337ef5d3277ebf6ed0b3f13a88239d3.tar.bz2
7w-06818a49b337ef5d3277ebf6ed0b3f13a88239d3.zip
Updated to work with gcc 5.X
Diffstat (limited to 'main.c')
-rw-r--r--main.c87
1 files changed, 35 insertions, 52 deletions
diff --git a/main.c b/main.c
index 0684561..d80f5f3 100644
--- a/main.c
+++ b/main.c
@@ -1,63 +1,46 @@
#include "7w.h"
#include <stdlib.h>
#include <stdio.h>
+#include <curses.h>
-void tester();
-void io_init();
-void cards_init();
-void io_clearscreen();
-int* getdeck(int era, int numplayers);
-void data_init(int num_players);
-void player_turn(int player);
-void ai_turn(int player);
-void wonder_selected(int player);
-void view_refresh(int focus, int cursor, int player);
-int data_numplayers();
-void data_endturn();
-int data_getera();
-void data_setai(int p);
-int data_isai(int p);
-int* pregame();
-
-void halt()
-{
- endwin();
- exit(0);
+void halt() {
+ endwin();
+ exit(0);
}
-void haltError(char *message, int num)
-{
- endwin();
- printf("Something has gone wrong, very wrong.\n");
- printf(message);
- printf("\n");
- printf("Number associated with this error: %d\n", num);
- exit(1);
+void haltError(char *message, int num) {
+ endwin();
+ printf("Something has gone wrong, very wrong.\n");
+ printf(message);
+ printf("\n");
+ printf("Number associated with this error: %d\n", num);
+ exit(1);
}
-main_routine()
-{
- int player = 0;
- while(1) {
- if(data_isai(player)) ai_turn(player);
- else player_turn(player);
- if(++player == data_numplayers()) {
- data_endturn();
- player = 0;
- }
- }
+void main_routine() {
+ int player = 0;
+ while (1) {
+ if (data_isai(player))
+ ai_turn(player);
+ else
+ player_turn(player);
+ if (++player == data_numplayers()) {
+ data_endturn();
+ player = 0;
+ }
+ }
}
-main()
-{
- io_init();
- cards_init();
- int *setupdat = pregame();
- data_init(setupdat[7]);
- int i;
- for(i = 0; i < 7; i++) {
- if(setupdat[i]) data_setai(i);
- }
- main_routine();
- halt();
+int main() {
+ io_init();
+ cards_init();
+ int *setupdat = pregame();
+ data_init(setupdat[7]);
+ int i;
+ for (i = 0; i < 7; i++) {
+ if (setupdat[i])
+ data_setai(i);
+ }
+ main_routine();
+ halt();
}
bgstack15