samedi 10 octobre 2015

How to make random.shuffle truly random?

So I have this list:

words = ["Games","Development","Keyboard","Speed","Typer","Anything","Alpha","Zealous","Accurate","Basics","Shortcut","Purpose","Window","Counter","Fortress","Modification","Computer","Science","History","Football","Basketball","Solid","Phantom","Battlefield","Advanced","Warfare","Download","Upload","Antidisestablishmentarianism","Supercalifragilisticexpialidocious","Discombobulation","Liberated","Assassin","Brotherhood","Revelation","Unity","Syndicate","Victory"]

And I have this which shuffles it and displays it on a label:

            entry.delete(0, tkinter.END)
            random.shuffle(words)
            label.config(text=str(words[1]))
            timeLabel.config(text="Time: " + str(time_score)+ "s")

I'd like to know how to make this shuffle truly random because it feels like I'm getting the same word over and over again despite there being a lot in the list. Maybe there is a way to remove a value from the list once it's been taken from it so it can't be shown again?




Aucun commentaire:

Enregistrer un commentaire