Another way to turn an equilateral triangle into a square, with five pieces and three moves. Drag the slider. First the top of the triangle splits in two, and the halves swing down on hinges into the corners: the triangle is now a rectangle, twice as wide as it is tall.
The source code is at github.com/KirillOsenkov/LiveGeometry. It is written in .NET and Avalonia.