private static int move(CI from, CI to, int num) { if (num == 1) { move1(from, to); return 1; } else { CI F, T; F.index = from.index; T.index = 3 - from.index - to.index; int c = move(F, T, num - 1); move1(from, to); F.index = 3 - from.index - to.index; T.index = to.index; return c + 1 + move(F, T, num - 1); } }
private static int move(CI from, CI to, int num) { if (num == 1) { move1(from, to); return(1); } else { CI F, T; F.index = from.index; T.index = 3 - from.index - to.index; int c = move(F, T, num - 1); move1(from, to); F.index = 3 - from.index - to.index; T.index = to.index; return(c + 1 + move(F, T, num - 1)); } }
private static int Main() { CI c = new CI(); return(100 + test(c, c, c, 0, c, c)); }
private static int test(CI c1, CI c2, CI c3, int dummy, CI c4, CI c5) { c1._m_v = 10; c2._m_v = -10; return(c1._m_v + c2._m_v + c3._m_v + c4._m_v + c5._m_v); }
private static int Main() { CI c = new CI(); return 100 + test(c, c, c, 0, c, c); }
private static int test(CI c1, CI c2, CI c3, int dummy, CI c4, CI c5) { c1._m_v = 10; c2._m_v = -10; return c1._m_v + c2._m_v + c3._m_v + c4._m_v + c5._m_v; }
private static void move1(CI from, CI to) { s_cols[to.index][s_heights[to.index]++] = s_cols[from.index][--s_heights[from.index]]; }