
                                         
// Project: HighScores
// Created: 2015-04-16
#include "StringLibrary.agc"
//*** Define types ***
type PlayerType
name as string
score as integer
endtype
//***************************************
//*** Main program ***
//***************************************
topscores as PlayerType[] //Holds top scores
latestplayer as PlayerType //Details of latest game
//*** Set window properties ***
SetWindowTitle("Maintaining a Set of High Scores")
SetWindowSize(1024,768,0)
SetDisplayAspect(1024/768.0)
UseNewDefaultFonts(1)
  
  
//*** Clear screen ***
ClearScreen()
//*** Generate dummy score details ***
latestplayer.name = RandomString()
latestplayer.score = Random2(100, 20000)
//***Update highest scores list ***
topscores = UpdateHighScoresFile(latestPlayer)
do
for c = 1 to 5
Print("Name : "+topscores[c].name+" Score : "  +Str(topscores[c].score))

next c
Sync()
loop
