from random import *
from microbit import *
from mb_file import *
from mb_disp import *
from mb_music import *

# This code selects one hash, at random, from
# a list of hashes of the ten most common 
#passwords and saves it on the micro:bit in 
# the file named "practice_password.txt"
_random_position = randint(0,9)
_hashes = ['5e884898da28047151d0e56f8dc6292773603d0d6aabbdd62a11ef721d1542d8',
'8d969eef6ecad3c29a3a629280e686cf0c3f5d5a86aff3ca12020c923adc6c92',
'15e2b0d3c33891ebb0f1ef609ec419420c20e320ce94c65fbc8c3312448eb225',
'84983c60f7daadc1cb8698621f802c0d9f9a3c3c295c810748fb048115c186ec',
'65e84be33532fb784c48129675f9eff3a682b27168c0ea744b2cf58ee02337c5',
'ef797c8118f02dfb649607dd5d3f8c7623048c9c063d532cc95c5ed7a898a64f',
'bcb15f821479b4d5772bd0ca866c00ad5f926e3580720659cc80d39c9d09802a',
'5994471abb01112afcc18159f6cc74b4f511b99806da59b3caf5a9c173cacfc5',
'6ca13d52ca70c883e0f0bb101e425a89e8624de51db2d2392593af6a84118090',
'96cae35ce8a9b0244178bf28e4966c2ce1b8385723a96a6b838858cdd6ca0a1e']
hash = _hashes[_random_position]
write_file("practice_password.txt",hash)
display.show("Image.YES")
music.play('music.JUMP_UP')