Skip to content

Commit 2cf8e58

Browse files
author
Joseph Suarez
committed
2048
1 parent f18edd0 commit 2cf8e58

File tree

1 file changed

+2
-14
lines changed

1 file changed

+2
-14
lines changed

pufferlib/ocean/g2048/g2048.c

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
#include "2048.h"
22
#include "puffernet.h"
3-
#include <stdio.h>
4-
#include <stdlib.h>
5-
#include <termios.h>
6-
#include <unistd.h>
7-
#include <time.h>
83

94
int main() {
105
srand(time(NULL));
@@ -23,10 +18,11 @@ int main() {
2318
int logit_sizes[1] = {4};
2419
LinearLSTM* net = make_linearlstm(weights, 1, 16, logit_sizes, 1);
2520
c_reset(&env);
21+
c_render(&env);
2622

2723
// Main game loop
2824
int frame = 0;
29-
while (1) {
25+
while (!WindowShouldClose()) {
3026
c_render(&env);
3127
frame++;
3228

@@ -49,14 +45,6 @@ int main() {
4945

5046
if (action != 0) {
5147
c_step(&env);
52-
if (!IsWindowReady()) {
53-
//print_grid(&env);
54-
printf("Reward: %.0f\n", env.rewards[0]);
55-
}
56-
}
57-
58-
if (IsWindowReady() && WindowShouldClose()) {
59-
break;
6048
}
6149
}
6250

0 commit comments

Comments
 (0)