#NEWLINE# def restore( self ) : #NEWLINE# #INDENT# '\n        restore the saved game score and data\n        ' #NEWLINE# size = self . board . SIZE #NEWLINE# try : #NEWLINE# #INDENT# with open ( self . store_file , 'r' ) as f : #NEWLINE# #INDENT# lines = f . readlines ( ) #NEWLINE# score_str = lines [ 0 ] #NEWLINE# self . score = int ( lines [ 1 ] ) #NEWLINE# #UNINDENT# #UNINDENT# except : #NEWLINE# #INDENT# return False #NEWLINE# #UNINDENT# score_str_list = score_str . split ( ' ' ) #NEWLINE# count = 0 #NEWLINE# for i in range ( size ) : #NEWLINE# #INDENT# for j in range ( size ) : #NEWLINE# #INDENT# value = score_str_list [ count ] #NEWLINE# self . board . setCell ( j , i , int ( value ) ) #NEWLINE# count += 1 #NEWLINE# #UNINDENT# #UNINDENT# return True