Repository navigation
Expand file tree
/
Copy pathentrypoint.cpp
More file actions
66 lines (57 loc) · 2.37 KB
/
Copy pathentrypoint.cpp
File metadata and controls
66 lines (57 loc) · 2.37 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
//
// main.cpp
// StackRabbit
//
// Created by Greg Cannon on 7/27/21.
//
#include "src/cpp_modules/src/main.cpp"
#include "src/cpp_modules/src/game_simulation.cpp"
#include <iostream>
/*
I = 0
O = 1
L = 2
J = 3
T = 4
S = 5
Z = 6
board | level | lines | curPiece | nextPiece | inputTimeline
*/
// clang-format off
char const *testInput =
"00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100010000111001000011100100001110010111111001111111110111111111011111111101111111110"
"|19|22|3|2|X..|49|2|102|aggro|16|";
// char const * testInputWithSecondBoard =
// "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000001100000000110100000011111110001111111110|00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000010001100011000110101000011111110001111111110|19|1|6|2|X.....|343|3|";
// clang-format on
int runGames() {
std::cout.imbue(std::locale("en_US.UTF-8")); // Allow for commas in printed numbers
std::vector<std::pair<int, int>> games;
int numGames = 1;
int playoutCount = 49;
int playoutLength = 2;
char const *inputFrameTimeline = "X.....";
int startingLevel = 18;
int maxLines = 230;
// Games with main weights
printf("\n----- MAIN WEIGHTS ------\n");
simulateGamesThreaded(numGames, inputFrameTimeline, startingLevel, maxLines, playoutCount,
playoutLength,
/* useTestWeights= */ false, SAFE, games);
// // Games with test weights
// printf("\n----- TEST WEIGHTS ------\n");
// simulateGamesThreaded(numGames, inputFrameTimeline, startingLevel, maxLines, playoutCount,
// playoutLength, /* useTestWeights= */ true, SAFE, games);
// for (int i = 0; i < numGames; i++){
// printf("Game %d: %d points, %d lines\n", i, games[i].first, games[i].second);
// }
return 0;
}
int main(int argc, const char *argv[]) {
printf("%s\n", mainProcess(testInput, GET_LOCK_VALUE_LOOKUP_DAS).c_str());
// printf("%s\n", mainProcess(testInput, GET_MOVE_AB_TEST).c_str());
// printf("%s\n", mainProcess(testInput, GET_MOVE).c_str());
// printf("%s\n", mainProcess(testInputWithSecondBoard, GET_TOP_MOVES).c_str());
// runGames();
return 0;
}