すのものの「いろいろ」(その332)


64 枚の円盤からなるハノイの塔のプログラム [... no tô no puroguramu]

#include <stdio.h>

#define N 64            /* 円盤の数 */

void hanoi(int n, int from, int to);
void show(void);
int add1(void);

int a[N];               /* 各円盤が 0, 1, 2 のどの棒にささっているか */
unsigned num[4];

int main() {
  int i;

  num[3] = num[2] = num[1] = num[0] = 0;


  for (i = 0; i < N; i++) {     /* 初期化 */
    a[i] = 0;                   /* すべてが棒 0 にささっているとする */
  }
  show();                       /* 表示 */
  hanoi(N-1, 0, 1);
}

/* 円盤 0 から円盤 n までを、棒 from から棒 to へ移す */
void hanoi(int n, int from, int to) {
  if (n == -1) {
    ;                           /* 空文(何もしない)*/
  } else {
    hanoi(n-1, from, 3-from-to);	/* 再帰呼び出し */
    a[n] = to; add1(); show();
    hanoi(n-1, 3-from-to, to);		/* 再帰呼び出し */
  }
}

/* 円盤の配置を表示 */
void show(void) {
  int i, j;

  printf("%04x %04x %04x %04x:", num[3], num[2], num[1], num[0]);

  for (j = 0; j <= 2; j++) {    /* j は棒の番号 */
    printf("    ");
    for (i = 0; i < N; i++) {   /* i は円盤の番号 */
      if (a[i] == j) {
        printf("%x", i%16);     /* 十六進で下一けたのみを表示 */
      } else {
        printf("-");            /* 空きの印 */
      }
   }
   printf("|");                 /* 床の印 */
 }
  printf("\n");
}

/* num[ ] に 1 を加える */
int add1(void) {
  if (num[0] != 0xffff) {
    num[0]++;
  } else if (num[1] != 0xffff) {
    num[0] = 0; num[1]++;
  } else if (num[2] != 0xffff) {
    num[1] = num[0] = 0; num[2]++;
  } else if (num[3] != 0xffff) {
    num[2] = num[1] = num[0] = 0; num[3]++;
  } else {
    return 0;
  }
  return 1;
}

出力の冒頭部分。

0000 0000 0000 0000:    0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    ----------------------------------------------------------------|    ----------------------------------------------------------------|
0000 0000 0000 0001:    -123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    ----------------------------------------------------------------|    0---------------------------------------------------------------|
0000 0000 0000 0002:    --23456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    -1--------------------------------------------------------------|    0---------------------------------------------------------------|
0000 0000 0000 0003:    --23456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    01--------------------------------------------------------------|    ----------------------------------------------------------------|
0000 0000 0000 0004:    ---3456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    01--------------------------------------------------------------|    --2-------------------------------------------------------------|
0000 0000 0000 0005:    0--3456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    -1--------------------------------------------------------------|    --2-------------------------------------------------------------|
0000 0000 0000 0006:    0--3456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    ----------------------------------------------------------------|    -12-------------------------------------------------------------|
0000 0000 0000 0007:    ---3456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    ----------------------------------------------------------------|    012-------------------------------------------------------------|
0000 0000 0000 0008:    ----456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    ---3------------------------------------------------------------|    012-------------------------------------------------------------|
0000 0000 0000 0009:    ----456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    0--3------------------------------------------------------------|    -12-------------------------------------------------------------|
0000 0000 0000 000a:    -1--456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    0--3------------------------------------------------------------|    --2-------------------------------------------------------------|
0000 0000 0000 000b:    01--456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    ---3------------------------------------------------------------|    --2-------------------------------------------------------------|
0000 0000 0000 000c:    01--456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    --23------------------------------------------------------------|    ----------------------------------------------------------------|
0000 0000 0000 000d:    -1--456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    --23------------------------------------------------------------|    0---------------------------------------------------------------|
0000 0000 0000 000e:    ----456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    -123------------------------------------------------------------|    0---------------------------------------------------------------|
0000 0000 0000 000f:    ----456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    0123------------------------------------------------------------|    ----------------------------------------------------------------|
0000 0000 0000 0010:    -----56789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    0123------------------------------------------------------------|    ----4-----------------------------------------------------------|
0000 0000 0000 0011:    0----56789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    -123------------------------------------------------------------|    ----4-----------------------------------------------------------|
0000 0000 0000 0012:    0----56789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    --23------------------------------------------------------------|    -1--4-----------------------------------------------------------|
0000 0000 0000 0013:    -----56789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    --23------------------------------------------------------------|    01--4-----------------------------------------------------------|
0000 0000 0000 0014:    --2--56789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    ---3------------------------------------------------------------|    01--4-----------------------------------------------------------|
0000 0000 0000 0015:    --2--56789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    0--3------------------------------------------------------------|    -1--4-----------------------------------------------------------|
0000 0000 0000 0016:    -12--56789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    0--3------------------------------------------------------------|    ----4-----------------------------------------------------------|
0000 0000 0000 0017:    012--56789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    ---3------------------------------------------------------------|    ----4-----------------------------------------------------------|
0000 0000 0000 0018:    012--56789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    ----------------------------------------------------------------|    ---34-----------------------------------------------------------|
0000 0000 0000 0019:    -12--56789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    ----------------------------------------------------------------|    0--34-----------------------------------------------------------|
0000 0000 0000 001a:    --2--56789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    -1--------------------------------------------------------------|    0--34-----------------------------------------------------------|
0000 0000 0000 001b:    --2--56789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    01--------------------------------------------------------------|    ---34-----------------------------------------------------------|
0000 0000 0000 001c:    -----56789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    01--------------------------------------------------------------|    --234-----------------------------------------------------------|
0000 0000 0000 001d:    0----56789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    -1--------------------------------------------------------------|    --234-----------------------------------------------------------|
0000 0000 0000 001e:    0----56789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    ----------------------------------------------------------------|    -1234-----------------------------------------------------------|
0000 0000 0000 001f:    -----56789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    ----------------------------------------------------------------|    01234-----------------------------------------------------------|
0000 0000 0000 0020:    ------6789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    -----5----------------------------------------------------------|    01234-----------------------------------------------------------|
0000 0000 0000 0021:    ------6789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    0----5----------------------------------------------------------|    -1234-----------------------------------------------------------|
0000 0000 0000 0022:    -1----6789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    0----5----------------------------------------------------------|    --234-----------------------------------------------------------|
0000 0000 0000 0023:    01----6789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    -----5----------------------------------------------------------|    --234-----------------------------------------------------------|
0000 0000 0000 0024:    01----6789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    --2--5----------------------------------------------------------|    ---34-----------------------------------------------------------|
0000 0000 0000 0025:    -1----6789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    --2--5----------------------------------------------------------|    0--34-----------------------------------------------------------|
0000 0000 0000 0026:    ------6789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    -12--5----------------------------------------------------------|    0--34-----------------------------------------------------------|
0000 0000 0000 0027:    ------6789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    012--5----------------------------------------------------------|    ---34-----------------------------------------------------------|
0000 0000 0000 0028:    ---3--6789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    012--5----------------------------------------------------------|    ----4-----------------------------------------------------------|
0000 0000 0000 0029:    0--3--6789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    -12--5----------------------------------------------------------|    ----4-----------------------------------------------------------|
0000 0000 0000 002a:    0--3--6789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    --2--5----------------------------------------------------------|    -1--4-----------------------------------------------------------|
0000 0000 0000 002b:    ---3--6789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    --2--5----------------------------------------------------------|    01--4-----------------------------------------------------------|
0000 0000 0000 002c:    --23--6789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    -----5----------------------------------------------------------|    01--4-----------------------------------------------------------|
0000 0000 0000 002d:    --23--6789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    0----5----------------------------------------------------------|    -1--4-----------------------------------------------------------|
0000 0000 0000 002e:    -123--6789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    0----5----------------------------------------------------------|    ----4-----------------------------------------------------------|
0000 0000 0000 002f:    0123--6789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    -----5----------------------------------------------------------|    ----4-----------------------------------------------------------|
0000 0000 0000 0030:    0123--6789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    ----45----------------------------------------------------------|    ----------------------------------------------------------------|
0000 0000 0000 0031:    -123--6789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    ----45----------------------------------------------------------|    0---------------------------------------------------------------|
0000 0000 0000 0032:    --23--6789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    -1--45----------------------------------------------------------|    0---------------------------------------------------------------|
0000 0000 0000 0033:    --23--6789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    01--45----------------------------------------------------------|    ----------------------------------------------------------------|
0000 0000 0000 0034:    ---3--6789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    01--45----------------------------------------------------------|    --2-------------------------------------------------------------|
0000 0000 0000 0035:    0--3--6789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    -1--45----------------------------------------------------------|    --2-------------------------------------------------------------|
0000 0000 0000 0036:    0--3--6789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    ----45----------------------------------------------------------|    -12-------------------------------------------------------------|
0000 0000 0000 0037:    ---3--6789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    ----45----------------------------------------------------------|    012-------------------------------------------------------------|
0000 0000 0000 0038:    ------6789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    ---345----------------------------------------------------------|    012-------------------------------------------------------------|
0000 0000 0000 0039:    ------6789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    0--345----------------------------------------------------------|    -12-------------------------------------------------------------|
0000 0000 0000 003a:    -1----6789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    0--345----------------------------------------------------------|    --2-------------------------------------------------------------|
0000 0000 0000 003b:    01----6789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    ---345----------------------------------------------------------|    --2-------------------------------------------------------------|
0000 0000 0000 003c:    01----6789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    --2345----------------------------------------------------------|    ----------------------------------------------------------------|
0000 0000 0000 003d:    -1----6789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    --2345----------------------------------------------------------|    0---------------------------------------------------------------|
0000 0000 0000 003e:    ------6789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    -12345----------------------------------------------------------|    0---------------------------------------------------------------|
0000 0000 0000 003f:    ------6789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    012345----------------------------------------------------------|    ----------------------------------------------------------------|
0000 0000 0000 0040:    -------789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    012345----------------------------------------------------------|    ------6---------------------------------------------------------|
0000 0000 0000 0041:    0------789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    -12345----------------------------------------------------------|    ------6---------------------------------------------------------|
0000 0000 0000 0042:    0------789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    --2345----------------------------------------------------------|    -1----6---------------------------------------------------------|
0000 0000 0000 0043:    -------789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    --2345----------------------------------------------------------|    01----6---------------------------------------------------------|
0000 0000 0000 0044:    --2----789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    ---345----------------------------------------------------------|    01----6---------------------------------------------------------|
0000 0000 0000 0045:    --2----789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    0--345----------------------------------------------------------|    -1----6---------------------------------------------------------|
0000 0000 0000 0046:    -12----789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    0--345----------------------------------------------------------|    ------6---------------------------------------------------------|
0000 0000 0000 0047:    012----789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    ---345----------------------------------------------------------|    ------6---------------------------------------------------------|
0000 0000 0000 0048:    012----789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    ----45----------------------------------------------------------|    ---3--6---------------------------------------------------------|
0000 0000 0000 0049:    -12----789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    ----45----------------------------------------------------------|    0--3--6---------------------------------------------------------|
0000 0000 0000 004a:    --2----789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    -1--45----------------------------------------------------------|    0--3--6---------------------------------------------------------|
0000 0000 0000 004b:    --2----789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    01--45----------------------------------------------------------|    ---3--6---------------------------------------------------------|
0000 0000 0000 004c:    -------789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    01--45----------------------------------------------------------|    --23--6---------------------------------------------------------|
0000 0000 0000 004d:    0------789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    -1--45----------------------------------------------------------|    --23--6---------------------------------------------------------|
0000 0000 0000 004e:    0------789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    ----45----------------------------------------------------------|    -123--6---------------------------------------------------------|
0000 0000 0000 004f:    -------789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    ----45----------------------------------------------------------|    0123--6---------------------------------------------------------|
0000 0000 0000 0050:    ----4--789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    -----5----------------------------------------------------------|    0123--6---------------------------------------------------------|
0000 0000 0000 0051:    ----4--789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    0----5----------------------------------------------------------|    -123--6---------------------------------------------------------|
0000 0000 0000 0052:    -1--4--789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    0----5----------------------------------------------------------|    --23--6---------------------------------------------------------|
0000 0000 0000 0053:    01--4--789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    -----5----------------------------------------------------------|    --23--6---------------------------------------------------------|
0000 0000 0000 0054:    01--4--789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    --2--5----------------------------------------------------------|    ---3--6---------------------------------------------------------|
0000 0000 0000 0055:    -1--4--789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    --2--5----------------------------------------------------------|    0--3--6---------------------------------------------------------|
0000 0000 0000 0056:    ----4--789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    -12--5----------------------------------------------------------|    0--3--6---------------------------------------------------------|
0000 0000 0000 0057:    ----4--789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    012--5----------------------------------------------------------|    ---3--6---------------------------------------------------------|
0000 0000 0000 0058:    ---34--789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    012--5----------------------------------------------------------|    ------6---------------------------------------------------------|
0000 0000 0000 0059:    0--34--789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    -12--5----------------------------------------------------------|    ------6---------------------------------------------------------|
0000 0000 0000 005a:    0--34--789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    --2--5----------------------------------------------------------|    -1----6---------------------------------------------------------|
0000 0000 0000 005b:    ---34--789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    --2--5----------------------------------------------------------|    01----6---------------------------------------------------------|
0000 0000 0000 005c:    --234--789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    -----5----------------------------------------------------------|    01----6---------------------------------------------------------|
0000 0000 0000 005d:    --234--789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    0----5----------------------------------------------------------|    -1----6---------------------------------------------------------|
0000 0000 0000 005e:    -1234--789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    0----5----------------------------------------------------------|    ------6---------------------------------------------------------|
0000 0000 0000 005f:    01234--789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    -----5----------------------------------------------------------|    ------6---------------------------------------------------------|
0000 0000 0000 0060:    01234--789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    ----------------------------------------------------------------|    -----56---------------------------------------------------------|
0000 0000 0000 0061:    -1234--789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    ----------------------------------------------------------------|    0----56---------------------------------------------------------|
0000 0000 0000 0062:    --234--789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    -1--------------------------------------------------------------|    0----56---------------------------------------------------------|
0000 0000 0000 0063:    --234--789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    01--------------------------------------------------------------|    -----56---------------------------------------------------------|
0000 0000 0000 0064:    ---34--789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    01--------------------------------------------------------------|    --2--56---------------------------------------------------------|
0000 0000 0000 0065:    0--34--789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    -1--------------------------------------------------------------|    --2--56---------------------------------------------------------|
0000 0000 0000 0066:    0--34--789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    ----------------------------------------------------------------|    -12--56---------------------------------------------------------|
0000 0000 0000 0067:    ---34--789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    ----------------------------------------------------------------|    012--56---------------------------------------------------------|
0000 0000 0000 0068:    ----4--789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    ---3------------------------------------------------------------|    012--56---------------------------------------------------------|
0000 0000 0000 0069:    ----4--789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    0--3------------------------------------------------------------|    -12--56---------------------------------------------------------|
0000 0000 0000 006a:    -1--4--789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    0--3------------------------------------------------------------|    --2--56---------------------------------------------------------|
0000 0000 0000 006b:    01--4--789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    ---3------------------------------------------------------------|    --2--56---------------------------------------------------------|
0000 0000 0000 006c:    01--4--789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    --23------------------------------------------------------------|    -----56---------------------------------------------------------|
0000 0000 0000 006d:    -1--4--789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    --23------------------------------------------------------------|    0----56---------------------------------------------------------|
0000 0000 0000 006e:    ----4--789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    -123------------------------------------------------------------|    0----56---------------------------------------------------------|
0000 0000 0000 006f:    ----4--789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    0123------------------------------------------------------------|    -----56---------------------------------------------------------|
0000 0000 0000 0070:    -------789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    0123------------------------------------------------------------|    ----456---------------------------------------------------------|
0000 0000 0000 0071:    0------789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    -123------------------------------------------------------------|    ----456---------------------------------------------------------|
0000 0000 0000 0072:    0------789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    --23------------------------------------------------------------|    -1--456---------------------------------------------------------|
0000 0000 0000 0073:    -------789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    --23------------------------------------------------------------|    01--456---------------------------------------------------------|
0000 0000 0000 0074:    --2----789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    ---3------------------------------------------------------------|    01--456---------------------------------------------------------|
0000 0000 0000 0075:    --2----789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    0--3------------------------------------------------------------|    -1--456---------------------------------------------------------|
0000 0000 0000 0076:    -12----789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    0--3------------------------------------------------------------|    ----456---------------------------------------------------------|
0000 0000 0000 0077:    012----789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    ---3------------------------------------------------------------|    ----456---------------------------------------------------------|
0000 0000 0000 0078:    012----789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    ----------------------------------------------------------------|    ---3456---------------------------------------------------------|
0000 0000 0000 0079:    -12----789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    ----------------------------------------------------------------|    0--3456---------------------------------------------------------|
0000 0000 0000 007a:    --2----789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    -1--------------------------------------------------------------|    0--3456---------------------------------------------------------|
0000 0000 0000 007b:    --2----789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    01--------------------------------------------------------------|    ---3456---------------------------------------------------------|
0000 0000 0000 007c:    -------789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    01--------------------------------------------------------------|    --23456---------------------------------------------------------|
0000 0000 0000 007d:    0------789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    -1--------------------------------------------------------------|    --23456---------------------------------------------------------|
0000 0000 0000 007e:    0------789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    ----------------------------------------------------------------|    -123456---------------------------------------------------------|
0000 0000 0000 007f:    -------789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    ----------------------------------------------------------------|    0123456---------------------------------------------------------|
0000 0000 0000 0080:    --------89abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    -------7--------------------------------------------------------|    0123456---------------------------------------------------------|
0000 0000 0000 0081:    --------89abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    0------7--------------------------------------------------------|    -123456---------------------------------------------------------|
0000 0000 0000 0082:    -1------89abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    0------7--------------------------------------------------------|    --23456---------------------------------------------------------|
0000 0000 0000 0083:    01------89abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    -------7--------------------------------------------------------|    --23456---------------------------------------------------------|

最後まで動かすと, 1 秒につき 10000 行の出力としても数千万年かかります。

円盤の枚数を 20 ぐらいにしてぼんやりながめるのも楽しいでしょう。 奇数の円板と奇数の円板は直接には重なり合わないし, 偶数についても同様です。そんなことが見えてきます。

付)インチキをして,上のプログラムの最後の数十行を出力させるプログラム。 「★」がついた箇所が書き換わっている。

#include <stdio.h>

#define N 64            /* 円盤の数 */

void hanoi(int n, int from, int to);
void show(void);
int add1(void);

int a[N];               /* 各円盤が 0, 1, 2 のどの棒にささっているか */
unsigned num[4];

int main() {
  int i;

  num[3] = num[2] = num[1] = num[0] = 0;


  for (i = 0; i < N; i++) {     /* 初期化 */
    a[i] = 1;                   /* すべてが棒 1 にささっているとする(★)*/
  }
  show();                       /* 表示 */
  hanoi(N-1, 1, 0);             /*(★)*/
}

/* 円盤 0 から円盤 n までを、棒 from から棒 to へ移す */
void hanoi(int n, int from, int to) {
  if (n == -1) {
    ;                           /* 空文(何もしない)*/
  } else {
    hanoi(n-1, from, 3-from-to);	/* 再帰呼び出し */
    a[n] = to; add1(); show();
    hanoi(n-1, 3-from-to, to);		/* 再帰呼び出し */
  }
}

/* 円盤の配置を表示 */
void show(void) {
  int i, j;

  printf("%04x %04x %04x %04x:", 0xffff - num[3], 0xffff - num[2], 0xffff - num[1], 0xffff - num[0]);  /*(★)*/

  for (j = 0; j <= 2; j++) {    /* j は棒の番号 */
    printf("    ");
    for (i = 0; i < N; i++) {   /* i は円盤の番号 */
      if (a[i] == j) {
        printf("%x", i%16);     /* 十六進で下一けたのみを表示 */
      } else {
        printf("-");            /* 空きの印 */
      }
   }
   printf("|");                 /* 床の印 */
 }
  printf("\n");
}

/* num[ ] に 1 を加える */
int add1(void) {
  if (num[0] != 0xffff) {
    num[0]++;
  } else if (num[1] != 0xffff) {
    num[0] = 0; num[1]++;
  } else if (num[2] != 0xffff) {
    num[1] = num[0] = 0; num[2]++;
  } else if (num[3] != 0xffff) {
    num[2] = num[1] = num[0] = 0; num[3]++;
  } else {
    return 0;
  }
  return 1;
}

その出力の冒頭を,sort に通したもの。

ffff ffff ffff ff7a:    --2----7--------------------------------------------------------|    -1------89abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    0--3456---------------------------------------------------------|
ffff ffff ffff ff7b:    --2----7--------------------------------------------------------|    01------89abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    ---3456---------------------------------------------------------|
ffff ffff ffff ff7c:    -------7--------------------------------------------------------|    01------89abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    --23456---------------------------------------------------------|
ffff ffff ffff ff7d:    0------7--------------------------------------------------------|    -1------89abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    --23456---------------------------------------------------------|
ffff ffff ffff ff7e:    0------7--------------------------------------------------------|    --------89abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    -123456---------------------------------------------------------|
ffff ffff ffff ff7f:    -------7--------------------------------------------------------|    --------89abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    0123456---------------------------------------------------------|
ffff ffff ffff ff80:    ----------------------------------------------------------------|    -------789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    0123456---------------------------------------------------------|
ffff ffff ffff ff81:    ----------------------------------------------------------------|    0------789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    -123456---------------------------------------------------------|
ffff ffff ffff ff82:    -1--------------------------------------------------------------|    0------789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    --23456---------------------------------------------------------|
ffff ffff ffff ff83:    01--------------------------------------------------------------|    -------789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    --23456---------------------------------------------------------|
ffff ffff ffff ff84:    01--------------------------------------------------------------|    --2----789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    ---3456---------------------------------------------------------|
ffff ffff ffff ff85:    -1--------------------------------------------------------------|    --2----789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    0--3456---------------------------------------------------------|
ffff ffff ffff ff86:    ----------------------------------------------------------------|    -12----789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    0--3456---------------------------------------------------------|
ffff ffff ffff ff87:    ----------------------------------------------------------------|    012----789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    ---3456---------------------------------------------------------|
ffff ffff ffff ff88:    ---3------------------------------------------------------------|    012----789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    ----456---------------------------------------------------------|
ffff ffff ffff ff89:    0--3------------------------------------------------------------|    -12----789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    ----456---------------------------------------------------------|
ffff ffff ffff ff8a:    0--3------------------------------------------------------------|    --2----789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    -1--456---------------------------------------------------------|
ffff ffff ffff ff8b:    ---3------------------------------------------------------------|    --2----789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    01--456---------------------------------------------------------|
ffff ffff ffff ff8c:    --23------------------------------------------------------------|    -------789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    01--456---------------------------------------------------------|
ffff ffff ffff ff8d:    --23------------------------------------------------------------|    0------789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    -1--456---------------------------------------------------------|
ffff ffff ffff ff8e:    -123------------------------------------------------------------|    0------789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    ----456---------------------------------------------------------|
ffff ffff ffff ff8f:    0123------------------------------------------------------------|    -------789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    ----456---------------------------------------------------------|
ffff ffff ffff ff90:    0123------------------------------------------------------------|    ----4--789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    -----56---------------------------------------------------------|
ffff ffff ffff ff91:    -123------------------------------------------------------------|    ----4--789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    0----56---------------------------------------------------------|
ffff ffff ffff ff92:    --23------------------------------------------------------------|    -1--4--789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    0----56---------------------------------------------------------|
ffff ffff ffff ff93:    --23------------------------------------------------------------|    01--4--789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    -----56---------------------------------------------------------|
ffff ffff ffff ff94:    ---3------------------------------------------------------------|    01--4--789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    --2--56---------------------------------------------------------|
ffff ffff ffff ff95:    0--3------------------------------------------------------------|    -1--4--789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    --2--56---------------------------------------------------------|
ffff ffff ffff ff96:    0--3------------------------------------------------------------|    ----4--789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    -12--56---------------------------------------------------------|
ffff ffff ffff ff97:    ---3------------------------------------------------------------|    ----4--789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    012--56---------------------------------------------------------|
ffff ffff ffff ff98:    ----------------------------------------------------------------|    ---34--789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    012--56---------------------------------------------------------|
ffff ffff ffff ff99:    ----------------------------------------------------------------|    0--34--789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    -12--56---------------------------------------------------------|
ffff ffff ffff ff9a:    -1--------------------------------------------------------------|    0--34--789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    --2--56---------------------------------------------------------|
ffff ffff ffff ff9b:    01--------------------------------------------------------------|    ---34--789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    --2--56---------------------------------------------------------|
ffff ffff ffff ff9c:    01--------------------------------------------------------------|    --234--789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    -----56---------------------------------------------------------|
ffff ffff ffff ff9d:    -1--------------------------------------------------------------|    --234--789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    0----56---------------------------------------------------------|
ffff ffff ffff ff9e:    ----------------------------------------------------------------|    -1234--789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    0----56---------------------------------------------------------|
ffff ffff ffff ff9f:    ----------------------------------------------------------------|    01234--789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    -----56---------------------------------------------------------|
ffff ffff ffff ffa0:    -----5----------------------------------------------------------|    01234--789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    ------6---------------------------------------------------------|
ffff ffff ffff ffa1:    0----5----------------------------------------------------------|    -1234--789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    ------6---------------------------------------------------------|
ffff ffff ffff ffa2:    0----5----------------------------------------------------------|    --234--789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    -1----6---------------------------------------------------------|
ffff ffff ffff ffa3:    -----5----------------------------------------------------------|    --234--789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    01----6---------------------------------------------------------|
ffff ffff ffff ffa4:    --2--5----------------------------------------------------------|    ---34--789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    01----6---------------------------------------------------------|
ffff ffff ffff ffa5:    --2--5----------------------------------------------------------|    0--34--789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    -1----6---------------------------------------------------------|
ffff ffff ffff ffa6:    -12--5----------------------------------------------------------|    0--34--789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    ------6---------------------------------------------------------|
ffff ffff ffff ffa7:    012--5----------------------------------------------------------|    ---34--789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    ------6---------------------------------------------------------|
ffff ffff ffff ffa8:    012--5----------------------------------------------------------|    ----4--789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    ---3--6---------------------------------------------------------|
ffff ffff ffff ffa9:    -12--5----------------------------------------------------------|    ----4--789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    0--3--6---------------------------------------------------------|
ffff ffff ffff ffaa:    --2--5----------------------------------------------------------|    -1--4--789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    0--3--6---------------------------------------------------------|
ffff ffff ffff ffab:    --2--5----------------------------------------------------------|    01--4--789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    ---3--6---------------------------------------------------------|
ffff ffff ffff ffac:    -----5----------------------------------------------------------|    01--4--789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    --23--6---------------------------------------------------------|
ffff ffff ffff ffad:    0----5----------------------------------------------------------|    -1--4--789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    --23--6---------------------------------------------------------|
ffff ffff ffff ffae:    0----5----------------------------------------------------------|    ----4--789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    -123--6---------------------------------------------------------|
ffff ffff ffff ffaf:    -----5----------------------------------------------------------|    ----4--789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    0123--6---------------------------------------------------------|
ffff ffff ffff ffb0:    ----45----------------------------------------------------------|    -------789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    0123--6---------------------------------------------------------|
ffff ffff ffff ffb1:    ----45----------------------------------------------------------|    0------789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    -123--6---------------------------------------------------------|
ffff ffff ffff ffb2:    -1--45----------------------------------------------------------|    0------789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    --23--6---------------------------------------------------------|
ffff ffff ffff ffb3:    01--45----------------------------------------------------------|    -------789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    --23--6---------------------------------------------------------|
ffff ffff ffff ffb4:    01--45----------------------------------------------------------|    --2----789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    ---3--6---------------------------------------------------------|
ffff ffff ffff ffb5:    -1--45----------------------------------------------------------|    --2----789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    0--3--6---------------------------------------------------------|
ffff ffff ffff ffb6:    ----45----------------------------------------------------------|    -12----789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    0--3--6---------------------------------------------------------|
ffff ffff ffff ffb7:    ----45----------------------------------------------------------|    012----789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    ---3--6---------------------------------------------------------|
ffff ffff ffff ffb8:    ---345----------------------------------------------------------|    012----789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    ------6---------------------------------------------------------|
ffff ffff ffff ffb9:    0--345----------------------------------------------------------|    -12----789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    ------6---------------------------------------------------------|
ffff ffff ffff ffba:    0--345----------------------------------------------------------|    --2----789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    -1----6---------------------------------------------------------|
ffff ffff ffff ffbb:    ---345----------------------------------------------------------|    --2----789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    01----6---------------------------------------------------------|
ffff ffff ffff ffbc:    --2345----------------------------------------------------------|    -------789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    01----6---------------------------------------------------------|
ffff ffff ffff ffbd:    --2345----------------------------------------------------------|    0------789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    -1----6---------------------------------------------------------|
ffff ffff ffff ffbe:    -12345----------------------------------------------------------|    0------789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    ------6---------------------------------------------------------|
ffff ffff ffff ffbf:    012345----------------------------------------------------------|    -------789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    ------6---------------------------------------------------------|
ffff ffff ffff ffc0:    012345----------------------------------------------------------|    ------6789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    ----------------------------------------------------------------|
ffff ffff ffff ffc1:    -12345----------------------------------------------------------|    ------6789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    0---------------------------------------------------------------|
ffff ffff ffff ffc2:    --2345----------------------------------------------------------|    -1----6789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    0---------------------------------------------------------------|
ffff ffff ffff ffc3:    --2345----------------------------------------------------------|    01----6789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    ----------------------------------------------------------------|
ffff ffff ffff ffc4:    ---345----------------------------------------------------------|    01----6789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    --2-------------------------------------------------------------|
ffff ffff ffff ffc5:    0--345----------------------------------------------------------|    -1----6789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    --2-------------------------------------------------------------|
ffff ffff ffff ffc6:    0--345----------------------------------------------------------|    ------6789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    -12-------------------------------------------------------------|
ffff ffff ffff ffc7:    ---345----------------------------------------------------------|    ------6789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    012-------------------------------------------------------------|
ffff ffff ffff ffc8:    ----45----------------------------------------------------------|    ---3--6789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    012-------------------------------------------------------------|
ffff ffff ffff ffc9:    ----45----------------------------------------------------------|    0--3--6789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    -12-------------------------------------------------------------|
ffff ffff ffff ffca:    -1--45----------------------------------------------------------|    0--3--6789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    --2-------------------------------------------------------------|
ffff ffff ffff ffcb:    01--45----------------------------------------------------------|    ---3--6789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    --2-------------------------------------------------------------|
ffff ffff ffff ffcc:    01--45----------------------------------------------------------|    --23--6789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    ----------------------------------------------------------------|
ffff ffff ffff ffcd:    -1--45----------------------------------------------------------|    --23--6789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    0---------------------------------------------------------------|
ffff ffff ffff ffce:    ----45----------------------------------------------------------|    -123--6789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    0---------------------------------------------------------------|
ffff ffff ffff ffcf:    ----45----------------------------------------------------------|    0123--6789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    ----------------------------------------------------------------|
ffff ffff ffff ffd0:    -----5----------------------------------------------------------|    0123--6789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    ----4-----------------------------------------------------------|
ffff ffff ffff ffd1:    0----5----------------------------------------------------------|    -123--6789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    ----4-----------------------------------------------------------|
ffff ffff ffff ffd2:    0----5----------------------------------------------------------|    --23--6789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    -1--4-----------------------------------------------------------|
ffff ffff ffff ffd3:    -----5----------------------------------------------------------|    --23--6789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    01--4-----------------------------------------------------------|
ffff ffff ffff ffd4:    --2--5----------------------------------------------------------|    ---3--6789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    01--4-----------------------------------------------------------|
ffff ffff ffff ffd5:    --2--5----------------------------------------------------------|    0--3--6789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    -1--4-----------------------------------------------------------|
ffff ffff ffff ffd6:    -12--5----------------------------------------------------------|    0--3--6789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    ----4-----------------------------------------------------------|
ffff ffff ffff ffd7:    012--5----------------------------------------------------------|    ---3--6789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    ----4-----------------------------------------------------------|
ffff ffff ffff ffd8:    012--5----------------------------------------------------------|    ------6789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    ---34-----------------------------------------------------------|
ffff ffff ffff ffd9:    -12--5----------------------------------------------------------|    ------6789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    0--34-----------------------------------------------------------|
ffff ffff ffff ffda:    --2--5----------------------------------------------------------|    -1----6789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    0--34-----------------------------------------------------------|
ffff ffff ffff ffdb:    --2--5----------------------------------------------------------|    01----6789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    ---34-----------------------------------------------------------|
ffff ffff ffff ffdc:    -----5----------------------------------------------------------|    01----6789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    --234-----------------------------------------------------------|
ffff ffff ffff ffdd:    0----5----------------------------------------------------------|    -1----6789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    --234-----------------------------------------------------------|
ffff ffff ffff ffde:    0----5----------------------------------------------------------|    ------6789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    -1234-----------------------------------------------------------|
ffff ffff ffff ffdf:    -----5----------------------------------------------------------|    ------6789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    01234-----------------------------------------------------------|
ffff ffff ffff ffe0:    ----------------------------------------------------------------|    -----56789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    01234-----------------------------------------------------------|
ffff ffff ffff ffe1:    ----------------------------------------------------------------|    0----56789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    -1234-----------------------------------------------------------|
ffff ffff ffff ffe2:    -1--------------------------------------------------------------|    0----56789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    --234-----------------------------------------------------------|
ffff ffff ffff ffe3:    01--------------------------------------------------------------|    -----56789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    --234-----------------------------------------------------------|
ffff ffff ffff ffe4:    01--------------------------------------------------------------|    --2--56789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    ---34-----------------------------------------------------------|
ffff ffff ffff ffe5:    -1--------------------------------------------------------------|    --2--56789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    0--34-----------------------------------------------------------|
ffff ffff ffff ffe6:    ----------------------------------------------------------------|    -12--56789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    0--34-----------------------------------------------------------|
ffff ffff ffff ffe7:    ----------------------------------------------------------------|    012--56789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    ---34-----------------------------------------------------------|
ffff ffff ffff ffe8:    ---3------------------------------------------------------------|    012--56789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    ----4-----------------------------------------------------------|
ffff ffff ffff ffe9:    0--3------------------------------------------------------------|    -12--56789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    ----4-----------------------------------------------------------|
ffff ffff ffff ffea:    0--3------------------------------------------------------------|    --2--56789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    -1--4-----------------------------------------------------------|
ffff ffff ffff ffeb:    ---3------------------------------------------------------------|    --2--56789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    01--4-----------------------------------------------------------|
ffff ffff ffff ffec:    --23------------------------------------------------------------|    -----56789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    01--4-----------------------------------------------------------|
ffff ffff ffff ffed:    --23------------------------------------------------------------|    0----56789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    -1--4-----------------------------------------------------------|
ffff ffff ffff ffee:    -123------------------------------------------------------------|    0----56789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    ----4-----------------------------------------------------------|
ffff ffff ffff ffef:    0123------------------------------------------------------------|    -----56789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    ----4-----------------------------------------------------------|
ffff ffff ffff fff0:    0123------------------------------------------------------------|    ----456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    ----------------------------------------------------------------|
ffff ffff ffff fff1:    -123------------------------------------------------------------|    ----456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    0---------------------------------------------------------------|
ffff ffff ffff fff2:    --23------------------------------------------------------------|    -1--456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    0---------------------------------------------------------------|
ffff ffff ffff fff3:    --23------------------------------------------------------------|    01--456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    ----------------------------------------------------------------|
ffff ffff ffff fff4:    ---3------------------------------------------------------------|    01--456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    --2-------------------------------------------------------------|
ffff ffff ffff fff5:    0--3------------------------------------------------------------|    -1--456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    --2-------------------------------------------------------------|
ffff ffff ffff fff6:    0--3------------------------------------------------------------|    ----456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    -12-------------------------------------------------------------|
ffff ffff ffff fff7:    ---3------------------------------------------------------------|    ----456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    012-------------------------------------------------------------|
ffff ffff ffff fff8:    ----------------------------------------------------------------|    ---3456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    012-------------------------------------------------------------|
ffff ffff ffff fff9:    ----------------------------------------------------------------|    0--3456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    -12-------------------------------------------------------------|
ffff ffff ffff fffa:    -1--------------------------------------------------------------|    0--3456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    --2-------------------------------------------------------------|
ffff ffff ffff fffb:    01--------------------------------------------------------------|    ---3456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    --2-------------------------------------------------------------|
ffff ffff ffff fffc:    01--------------------------------------------------------------|    --23456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    ----------------------------------------------------------------|
ffff ffff ffff fffd:    -1--------------------------------------------------------------|    --23456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    0---------------------------------------------------------------|
ffff ffff ffff fffe:    ----------------------------------------------------------------|    -123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    0---------------------------------------------------------------|
ffff ffff ffff ffff:    ----------------------------------------------------------------|    0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef|    ----------------------------------------------------------------|

2017-12-03 (0) 20:06:07 +0900


すのもの Sunomono