to build
This commit is contained in:
parent
cc6f9bb2d1
commit
7694d697e7
2 changed files with 3 additions and 2 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -59,3 +59,4 @@ src/ginpee.toml
|
||||||
.vscode/launch.json
|
.vscode/launch.json
|
||||||
src/tetris.log
|
src/tetris.log
|
||||||
src/high_score.txt
|
src/high_score.txt
|
||||||
|
src/build/high_score.txt
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
#include "01_automato.h"
|
#include "01_automato.h"
|
||||||
|
|
||||||
int load_high_score() {
|
int load_high_score() {
|
||||||
FILE* file = fopen("high_score.txt", "r");
|
FILE* file = fopen("build/high_score.txt", "r");
|
||||||
int high_score = 0;
|
int high_score = 0;
|
||||||
if (file) {
|
if (file) {
|
||||||
if (fscanf(file, "%d", &high_score) != 1) {
|
if (fscanf(file, "%d", &high_score) != 1) {
|
||||||
|
|
@ -13,7 +13,7 @@ int load_high_score() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void save_high_score(int score) {
|
void save_high_score(int score) {
|
||||||
FILE* file = fopen("high_score.txt", "w");
|
FILE* file = fopen("build/high_score.txt", "w");
|
||||||
if (file) {
|
if (file) {
|
||||||
fprintf(file, "%d", score);
|
fprintf(file, "%d", score);
|
||||||
fclose(file);
|
fclose(file);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue