アニメーション（選択）

ハノイの塔（5段）

Animate[
x1=Piecewise[(*obj1のｘ座標*)
{{t-3,3≤t<15},{12,15≤t<46},
{58-t,46≤t<52},{6,52≤t<88},
{94-t,88≤t<94},
{t-123,123≤t<135},{12,135≤t<164},
{176-t,164≤t<170},{6,170≤t<206},
{212-t,206≤t<212},
{t-241,241≤t<253},{12,253≤t<285},
{297-t,285≤t<291},{6,291≤t<325},
{331-t,325≤t<331},
{t-362,362≤t<374},{12,374≤t<402},
{414-t,402≤t<408},{6,408≤t<444},
{450-t,444≤t<450},
{t-479,479≤t<491},{12,491≤t<520},
{532-t,520≤t<526},{6,526≤t<562},
{568-t,562≤t<568},
{t-599,599≤t<611},{12,611≤t}
},0];

y1=Piecewise[(*obj1のｙ座標*)
{{4+t,0≤t<3},{7,3≤t<15},{22-t,15≤t<22},
{t-39,39≤t<46},{7,46≤t<52},{59-t,52≤t<58},{1,58≤t<82},
{t-81,82≤t<88},{7,88≤t<94},{101-t,94≤t<99},{2,99≤t<118},
{t-116,118≤t<123},{7,123≤t<135},{142-t,135≤t<140},{2,140≤t<159},
{t-157,159≤t<164},{7,164≤t<170},{177-t,170≤t<176},{1,176≤t<200},
{t-199,200≤t<206},{7,206≤t<212},{219-t,212≤t<217},{2,217≤t<236},
{t-234,236≤t<241},{7,241≤t<253},{260-t,253≤t<260},
{t-277,277≤t<285},{7,285≤t<291},{298-t,291≤t<295},{3,295≤t<321},
{t-318,321≤t<325},{7,325≤t<331},{338-t,331≤t<338},
{t-355,355≤t<362},{7,362≤t<374},{381-t,374≤t<379},{2,379≤t<397},
{t-395,397≤t<402},{7,402≤t<408},{415-t,408≤t<414},{1,414≤t<438},
{t-437,438≤t<444},{7,444≤t<450},{457-t,450≤t<455},{2,455≤t<474},
{t-472,474≤t<479},{7,479≤t<491},{498-t,491≤t<496},{2,496≤t<515},
{t-513,515≤t<520},{7,520≤t<526},{533-t,526≤t<532},{1,532≤t<556},
{t-555,556≤t<562},{7,562≤t<568},{575-t,568≤t<575},
{t-592,592≤t<599},{7,599≤t<611},{618-t,611≤t<614},{4,614≤t}
},0];


x2=Piecewise[(*obj2のｘ座標*)
{{t-26,26≤t<32},{6,32≤t<106},
{t-100,106≤t<112},{12,112≤t<182},
{194-t,182≤t<194},
{t-266,266≤t<272},{6,272≤t<343},
{t-337,343≤t<349},{12,349≤t<420},
{432-t,420≤t<432},
{t-502,502≤t<508},{6,508≤t<582},
{t-576,582≤t<588},{12,588≤t}
},0];

y2=Piecewise[(*obj2のy座標*)
{{3,0≤t<22},
{t-19,22≤t<26},{7,26≤t<32},{39-t,32≤t<39},
{t-99,99≤t<106},{7,106≤t<112},{119-t,112≤t<118},{1,118≤t<176},
{t-175,176≤t<182},{7,182≤t<194},{201-t,194≤t<200},{1,200≤t<260},
{t-259,260≤t<266},{7,266≤t<272},{279-t,272≤t<277},{2,277≤t<338},
{t-336,338≤t<343},{7,343≤t<349},{356-t,349≤t<355},{1,355≤t<414},
{t-413,414≤t<420},{7,420≤t<432},{439-t,432≤t<438},{1,438≤t<496},
{t-495,496≤t<502},{7,502≤t<508},{515-t,508≤t<515},
{t-575,575≤t<582},{7,582≤t<588},{595-t,588≤t<592},{3,592≤t}
},0];


x3=Piecewise[(*obj3のｘ座標*)
{{t-63,63≤t<75},{12,75≤t<224},
{236-t,224≤t<230},{6,230≤t<385},
{391-t,385≤t<391},
{t-539,539≤t<551},{12,551≤t}
},0];

y3=Piecewise[(*obj3のy座標*)
{{2,0≤t<58},
{t-56,58≤t<63},{7,63≤t<75},{82-t,75≤t<82},
{t-217,217≤t<224},{7,224≤t<230},{237-t,230≤t<236},{1,236≤t<379},
{t-378,379≤t<385},{7,385≤t<391},{397-t,391≤t<397},
{t-532,532≤t<539},{7,539≤t<551},{558-t,551≤t<556},{2,556≤t}
},0];


x4=Piecewise[(*obj4のｘ座標*)
{{t-146,146≤t<152},{6,152≤t<462},
{t-456,462≤t<468},{12,468≤t}
},0];

y4=Piecewise[(*obj4のy座標*)
{{1,0≤t<140},
{t-139,140≤t<146},{7,146≤t<152},{159-t,152≤t<159},
{t-455,455≤t<462},{7,462≤t<468},{475-t,468≤t<474},{1,474≤t}
},0];


x5=Piecewise[(*obj5のｘ座標*)
{{t-302,302≤t<314},{12,314≤t}

},0];

y5=Piecewise[(*obj5のy座標*)
{{t-295,295≤t<302},{7,302≤t<314},{321-t,314≤t<321}
},0];


(*オブジェクトの設定*)
obj1={Red,Rectangle[{x1-0.5,y1},{x1+0.5,y1+1}]};
obj2={Orange,Rectangle[{x2-1,y2},{x2+1,y2+1}]};
obj3={Darker[Yellow],Rectangle[{x3-1.5,y3},{x3+1.5,y3+1}]};
obj4={Green,Rectangle[{x4-2,y4},{x4+2,y4+1}]};
obj5={Blue,Rectangle[{x5-2.5,y5},{x5+2.5,y5+1}]};
stick1={Thick,Brown,Line[{{0,0},{0,6}}]};
stick2={Thick,Brown,Line[{{6,0},{6,6}}]};
stick3={Thick,Brown,Line[{{12,0},{12,6}}]};
ground={Thick,Darker[Brown],Line[{{-3,0},{15,0}}]};

Graphics[{ground,stick1,stick2,stick3,obj1,obj2,obj3,obj4,obj5},{PlotRange->{{-3,15},{-1,10}}}],{t,0,620,0.01},AnimationRate->20,AnimationRunning->False
]