colors[ headtailcolor set head color colors[- headtailcolor set tail color set up the rest of fish data structure fish {'right'fishtype['right'] 'left'fishtype['left'] 'colors'colors 'hspeed'random randint( ) 'vspeed'random randint( ) 'timetohdirchange'random randint( ) 'timetovdirchange'random randint( ) 'goingright'random choice([truefalse]) 'goingdown'random choice([truefalse]) 'xis always the leftmost side of the fish body fish[' 'random randint( width longest_fish_length fish[' 'random randint( height return fish def simulateaquarium() """simulate the movements in the aquarium for one step "" global fishesbubblersbubbleskelpstep simulate the fish for one step for fish in fishes move the fish horizontally if step fish['hspeed'= if fish['goingright'] if fish[' '!right_edge fish[' '+ move the fish right else fish['goingright'false turn the fish around fish['colors'reverse(turn the colors around else if fish[' '!left_edge fish[' '- move the fish left else fish['goingright'true turn the fish around fish['colors'reverse(turn the colors around fish can randomly change their horizontal direction fish['timetohdirchange'- if fish['timetohdirchange'= fish['timetohdirchange'random randint( turn the fish around fish['goingright'not fish['goingright' move the fish vertically if step fish['vspeed'= if fish['goingdown'] if fish[' '!bottom_edge fish[' '+ move the fish down else fish['goingdown'false turn the fish around fish tank