Else makes an edge in all four directions .
else : NEW_LINE INDENT g [ k ] . append ( k + 1 ) NEW_LINE g [ k + 1 ] . append ( k ) NEW_LINE g [ k ] . append ( k + m ) NEW_LINE g [ k + m ] . append ( k ) NEW_LINE DEDENT k += 1 NEW_LINE