draw the board data structure for xy in changedtiles bext goto(xy if board get((xy)false) bext bg(black_tile else bext bg(white_tile antishere false for ant in ants if (xy=(ant[' ']ant[' ']) antishere true if ant['direction'=north print(ant_upend='' elif ant['direction'=south print(ant_downend='' elif ant['direction'=east print(ant_leftend='' elif ant['direction'=west print(ant_rightend='' break if not antishere print('end='' display the quit message at the bottom of the screen bext goto( height bext bg(white_tile print('press ctrl- to quit 'end='' sys stdout flush((required for bext-using programs time sleep(pause_amount if this program was run (instead of imported)run the game if __name__ ='__main__' try main( except keyboardinterrupt print("langton' antby al sweigart al@inventwithpython com" sys exit(when ctrl- is pressedend the program after entering the source code and running it few timestry making experimental changes to it the comments marked with (!have suggestions for small changes you can make on your ownyou can also try to figure out how to do the following project # let the player load and save the state of the board' tiles from and to text file create additional tile states with new rules of movement and see what behavior emerges implement some of the ideas suggested in the wikipedia article for langton' ant