fix: vbuf and non init var

This commit is contained in:
violette 2025-05-02 12:51:50 -04:00
parent 55aee8c40b
commit 805e12f721

5
main.c
View file

@ -17,6 +17,7 @@
#include <float.h>
#include "json.h"
#define VBUF 1
#define SCREEN_WIDTH 80
#define SCREEN_HEIGHT 32
#define CUBE_WIDTH 10
@ -160,7 +161,7 @@ chooseColor(char c)
char
chooseMainFace()
{
int total;
int total = 0;
int faces[NUM_FACES] = {0};
for (int k = 0; k < SCREEN_WIDTH * SCREEN_HEIGHT; ++k)
@ -344,7 +345,9 @@ printAscii(struct json_value_s *json)
for (int k = 0; k < SCREEN_WIDTH * SCREEN_HEIGHT; ++k)
printf("%s", k % SCREEN_WIDTH ? chooseColor(output[k]) : "\r\n");
printf("\r\n");
#ifdef VBUF
fflush(stdout);
#endif
}
void