Hi
I've read somewhere that the appropiate way to make a best score list is with a dictionarie
So you'll have something like this:
best_score={"Peter":100,"Jhon":23}
Best Regards
Alberto
![]()
Gaucho
>From: Kent Johnson <[EMAIL PROTECTED]> >CC: Python tutor <tutor@python.org> >Subject: Re: [Tutor] high score lists >Date: Thu, 14 Apr 2005 18:24:55 -0400 > >R. Alan Monroe wrote: >>>Anyone have some good beginning ideas/references to creating a >>>high >>>score list and storing scores in a simple python game? (if there's >>>something in the pygames module, or a simpler python way). I'm >>>mod'ing a space invaders-type game and would like to add a high >>>score >>>list :) >> >> >>Quick and dirty approach: make a list of tuples >>[ (40000, 'John Doe'), >> (30000, 'Steve Austin') ] >> >>You can append new ones to the end of the list, sort it, reverse >>it,
>>etc. > >And you can use the pickle module to save and restore the list. > >Kent > >_______________________________________________ >Tutor maillist - Tutor@python.org >http://mail.python.org/mailman/listinfo/tutor
_______________________________________________
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor