project # check for the special case where the start and end points are certain neighborswhich this function doesn' handle correctlyand return hard coded list insteadif ( = and = or ( = and = )return [( )( )issteep abs( abs( if issteepthis algorithm only handles non-steep linesso let' change the slope to non-steep and change it back later swap and swap and isreversed true if the line goes right-to-left if isreversedget the points on the line going right-to-left swap and swap and deltax deltay abs( extray int(deltax currenty if ydirection elseydirection - calculate the for every in this linefor currentx in range( - )if issteeppoints append((currentycurrentx)elsepoints append((currentxcurrenty)extray -deltay if extray < only change once extray < currenty -ydirection extray +deltax elseget the points on the line going left to right deltax deltay abs( extray int(deltax currenty if ydirection elseydirection - calculate the for every in this linefor currentx in range( )if issteeppoints append((currentycurrentx)elsepoints append((currentxcurrenty)extray -deltay if extray only change once extray currenty +ydirection extray +deltax