nSnake
A ncurses implementation of the classic Snake game
 All Data Structures Files Functions Variables Enumerations Macros Pages
Functions | Variables
hscores.h File Reference

Declaration of the functions and structures related to high scores. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

int hscore_clean ()
 Restore the Highscores to the default. More...
 
void hscore_init ()
 Creates/reads from the High Score file. More...
 
void hscore_store ()
 Records the player High Score.
 

Variables

int HIGH_SCORE_BORDERS
 HighScore of the game mode with borders.
 
int HIGH_SCORE_BORDERS_OFF
 HighScore of the game mode without borders.
 

Detailed Description

Declaration of the functions and structures related to high scores.

Definition in file hscores.h.

Function Documentation

int hscore_clean ( )

Restore the Highscores to the default.

Note
If the Highscores file doesn't exist, it is created.

Definition at line 203 of file hscores.c.

void hscore_init ( )

Creates/reads from the High Score file.

First, we try to open for reading. If it doesn't exist, then we open it for writing, effectively creating it.

Note
The path to the score file is defined by the Makefile. Currently, it is /var/games/.nsnake.scores
Todo:
clean this code. Lots of useless ifs and elses.

Definition at line 236 of file hscores.c.