func TestGetMemoriPiboList(t *testing.T) { t.Log("TestGetMemoriPiboList") a := pibo.GetMemoriPiboList(10) t.Log(a) correct := []uint{0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55} if !reflect.DeepEqual(a, correct) { t.Error("GetMemoriPiboList") } }
func main() { fmt.Println("go main") var piboMax int fmt.Print("input pibonachi length =") fmt.Scanf("%d", &piboMax) //fmt.Println("pibolist", pibo.GetMemoriPiboList(uint(piboMax))) /* for v, i := range pibo.GetRecursivePiboList(piboMax) { fmt.Println("index", v, "value", i.String()) } */ for v, i := range pibo.GetMemoriPiboList(piboMax) { fmt.Println("index", v, "value", i.String()) } }