when you collect chestall sonar devices will update to locate the next closest sunken treasure chest press enter to continue ''' input( print( print(' !' print( print('would you like to view the instructions(yes/no)' if input(lower(startswith(' ') showinstructions( while true game setup sonardevices theboard getnewboard( thechests getrandomchests( drawboard(theboard previousmoves [ while sonardevices start of turn show sonar device/chest status if sonardevices extrassonar ' elseextrassonar ' if len(thechests extraschest ' elseextraschest ' print('you have % sonar device% left % treasure chest% remaining (sonardevicesextrassonarlen(thechests)extraschest) xy enterplayermove( previousmoves append([xy]we must track all moves so that sonar devices can be updated moveresult makemove(theboardthechestsxy if moveresult =false continue else if moveresult ='you have found sunken treasure chest!' update all the sonar devices currently on the map for xy in previousmoves makemove(theboardthechestsxy drawboard(theboard print(moveresult