project # filename +txtwith open(filename' 'encoding='utf- 'as filefile write('join(moves'\ 'file write(getcanvasstring(canvasnonenone)exceptprint('errorcould not save file 'for command in responseif command not in (' '' '' '' ')continue ignore this letter and continue to the next one moves append(commandrecord this move the first line we add needs to form full lineif canvas ={}if command in (' '' ')make the first line horizontal onecanvas[(cursorxcursory)set([' '' ']elif command in (' '' ')make the first line vertical onecanvas[(cursorxcursory)set([' '' ']update and yif command ='wand cursory canvas[(cursorxcursory)add(commandcursory cursory elif command ='sand cursory canvas_height canvas[(cursorxcursory)add(commandcursory cursory elif command ='aand cursorx canvas[(cursorxcursory)add(commandcursorx cursorx elif command ='dand cursorx canvas_width canvas[(cursorxcursory)add(commandcursorx cursorx elseif the cursor doesn' move because it would have moved off the edge of the canvasthen don' change the set at canvas[(cursorxcursory)continue if there' no set for (cursorxcursory)add an empty setif (cursorxcursorynot in canvascanvas[(cursorxcursory)set(add the direction string to this xy point' setif command =' 'canvas[(cursorxcursory)add(' 'elif command =' 'canvas[(cursorxcursory)add(' 'elif command =' 'canvas[(cursorxcursory)add(' 'elif command =' 'canvas[(cursorxcursory)add(' '