Value and type of last evaluated expression: Address of array element: Address of array elementx: (none)
Your browser does not support the canvas element
which will make some the features unavailable.
If you are using Internet Explorer within the University of Exeter
try going to the Settings menu (probably the gear shape at the top right
of this page),
selecting "Compatibility View settings",
unchecking "Display intranet sites in Compatibility View"
and reloading this page.
Code
Header...
#define HSFILE "highscore.txt"
//
// Read the high score from a file, returning zero
// if the file does not exist.
int readhighscore(){ ...
» int hs;
» FILE *infile;
»infile=fopen(HSFILE, "r");
» if (infile==NULL) // First time game has been played
return 0;
»fscanf(infile, "%d", &hs);
»fclose(infile);
» return hs;
}
//
// Write the high score file checking that this game's
// high score is greater than the saved one.
void writehighscore(int hs){ ...