forked from mr-andreas/neuralnet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
49 lines (35 loc) · 847 Bytes
/
main.cpp
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
#include <iostream>
#include <vector>
#include "gfx.h"
using namespace std;
typedef struct {
int inputCount;
unsigned int threshold;
unsigned int weights[4];
} neuron_t;
int oldmain(int argc, char **argv) {
neuron_t hiddenLayer[4];
neuron_t outputLayer[2];
std::cout << "Hello, world!" << std::endl;
return 0;
}
int main(int argc, char **argv) {
srand(time(NULL));
sdlgamestate_t g;
Gamestate gs(400, 400);
g.gamestate = &gs;
for(int i = 0; i < 40; i++) {
Mine m;
m.posx = rand()%gs.boardWidth;
m.posy = rand()%gs.boardHeight;
gs.mines.push_back(m);
}
for(int i = 0; i < 20; i++) {
Sweeper s;
s.posx = rand()%gs.boardWidth;
s.posy = rand()%gs.boardHeight;
gs.sweepers.push_back(s);
}
g.gamestate->initGenAlg();
return sdlMainLoop(&g);
}