Files
Yudong Jin d7b2277d2b Re-translate the Japanese version (#1871)
* Retranslate Japanese docs with GPT-5.4

* Retranslate Japanese code with GPT-5.4
2026-03-30 07:30:15 +08:00

41 lines
685 B
Go

// File: hanota_test.go
// Created Time: 2023-07-21
// Author: hongyun-robot (1836017030@qq.com)
package chapter_divide_and_conquer
import (
"container/list"
"fmt"
"testing"
. "github.com/krahets/hello-algo/pkg"
)
func TestHanota(t *testing.T) {
// リスト末尾が柱の頂上
A := list.New()
for i := 5; i > 0; i-- {
A.PushBack(i)
}
B := list.New()
C := list.New()
fmt.Println("初期状態:")
fmt.Print("A = ")
PrintList(A)
fmt.Print("B = ")
PrintList(B)
fmt.Print("C = ")
PrintList(C)
solveHanota(A, B, C)
fmt.Println("円盤の移動完了後:")
fmt.Print("A = ")
PrintList(A)
fmt.Print("B = ")
PrintList(B)
fmt.Print("C = ")
PrintList(C)
}