-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.h
More file actions
99 lines (86 loc) · 2.42 KB
/
Copy pathmain.h
File metadata and controls
99 lines (86 loc) · 2.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
/*
*/
//---------------------------------------------------------------------------
#ifndef MAINH
#define MAINH
//--Define's-----------------------------------------------------------------
//--Include's----------------------------------------------------------------
#include <windows.h>
#include <stdio.h>
#include <conio.h>
#include <stdlib.h>
#include <string.h>
#include "resource.h"
//--Define's-----------------------------------------------------------------
#define MAX_PROGS 16
//--Macro Define's-----------------------------------------------------------
//--Class Define's-----------------------------------------------------------
class trie {
private:
trie *parent;
trie *childs[26];
int ichr;
int depth;
bool end;
public:
trie(trie *p, int ic, int d);
~trie();
void add(int *ilist);
bool known(int *ilist);
int knownn(int **ilist, int length);
void print(char *buf);
int load_from_file(char *filename);
};
class bord {
public:
int ichrs[49];
int ispeler[49];
int *iver[7][7];
int *ihor[7][7];
int eindscore;
bord(void);
void clear(void);
bool doe_zet(int t, int ichr, int speler);
bool vol(void);
void print(int speler);
void fprint(FILE *fout, int speler);
int regelwaarde(int *iline[7]);
int waarde(void);
};
//--Struct Define's----------------------------------------------------------
struct SPELINFO
{
char speler1path[MAX_PATH];
char speler2path[MAX_PATH];
char beginletter;
int speler1, punten1;
int speler2, punten2;
};
struct SPELERINFO
{
HANDLE Process;
HANDLE Stdin;
HANDLE Stdout;
HANDLE Stderr;
};
//--External Vars------------------------------------------------------------
extern int Winst[MAX_PROGS][MAX_PROGS];
extern int Verlies[MAX_PROGS][MAX_PROGS];
extern int Gelijk[MAX_PROGS][MAX_PROGS];
extern char ProgPath[MAX_PROGS][MAX_PATH];
extern char WbPath[MAX_PATH];
extern char BlPath[MAX_PATH];
extern char LgPath[MAX_PATH];
extern int AantalProgs;
extern int SwitchWBmode;
extern int SwitchBLmode;
extern int SwitchLGmode;
extern char Letters[28];
extern FILE *fbordlog;
extern trie wb;
//--Functions----------------------------------------------------------------
int ScanParam(int argc, char **argv);
int Speel(SPELINFO *si);
int Waardeer(SPELINFO *si);
int fprint_waarde(FILE *fout);
#endif