optimize triangle_chess code