diff --git a/subjects/listforeach.en.md b/subjects/listforeach.en.md index 4dc0c2fe3..d0ab40d4c 100644 --- a/subjects/listforeach.en.md +++ b/subjects/listforeach.en.md @@ -63,7 +63,7 @@ func main() { piscine.ListPushBack(link, "3") piscine.ListPushBack(link, "5") - piscine.ListForEach(link, piscine.Add2) + piscine.ListForEach(link, piscine.Add2_node) it := link.Head for it != nil { diff --git a/subjects/listforeach.fr.md b/subjects/listforeach.fr.md index 57a62c2fa..042ecdedd 100644 --- a/subjects/listforeach.fr.md +++ b/subjects/listforeach.fr.md @@ -63,7 +63,7 @@ func main() { piscine.ListPushBack(link, "3") piscine.ListPushBack(link, "5") - piscine.ListForEach(link, piscine.Add2) + piscine.ListForEach(link, piscine.Add2_node) it := link.Head for it != nil { diff --git a/subjects/listforeachif.en.md b/subjects/listforeachif.en.md index fb54e4633..e1d0f163d 100644 --- a/subjects/listforeachif.en.md +++ b/subjects/listforeachif.en.md @@ -86,7 +86,7 @@ func PrintList(l *piscine.List) { fmt.Print(it.Data, "->") it = it.Next } - fmt.Println() + fmt.Print("nil","\n") } func main() { @@ -120,12 +120,15 @@ And its output : ```console student@ubuntu:~/piscine-go/test$ go build student@ubuntu:~/piscine-go/test$ ./test -1 -> hello -> 3 -> there -> 23 -> ! -> 54 -> +1->hello->3->there->23->!->54->nil --------function applied-------- -hello -there -! +1 +3 +23 +54 --------function applied-------- -1 -> 1 -> 3 -> 1 -> 23 -> 1 -> 54 -> +1->2->3->2->23->2->54->nil + +student@ubuntu:~/piscine-go/test$ student@ubuntu:~/piscine-go/test$ ``` diff --git a/subjects/listforeachif.fr.md b/subjects/listforeachif.fr.md index a4c2f76f3..9228f26ea 100644 --- a/subjects/listforeachif.fr.md +++ b/subjects/listforeachif.fr.md @@ -86,7 +86,7 @@ func PrintList(l *piscine.List) { fmt.Print(it.Data, "->") it = it.Next } - fmt.Println() + fmt.Print("nil","\n") } func main() { @@ -120,12 +120,13 @@ Et son résultat : ```console student@ubuntu:~/piscine-go/test$ go build student@ubuntu:~/piscine-go/test$ ./test -1 -> hello -> 3 -> there -> 23 -> ! -> 54 -> +1->hello->3->there->23->!->54->nil --------function applied-------- -hello -there -! +1 +3 +23 +54 --------function applied-------- -1 -> 1 -> 3 -> 1 -> 23 -> 1 -> 54 -> +1->2->3->2->23->2->54->nil student@ubuntu:~/piscine-go/test$ ``` diff --git a/subjects/listmerge.en.md b/subjects/listmerge.en.md index b1b2c332a..529d0ed29 100644 --- a/subjects/listmerge.en.md +++ b/subjects/listmerge.en.md @@ -75,6 +75,11 @@ And its output : ```console student@ubuntu:~/piscine-go/test$ go build student@ubuntu:~/piscine-go/test$ ./test +-----first List------ +a -> b -> c -> d -> +-----second List------ +e -> f -> g -> h -> +-----Merged List----- a -> b -> c -> d -> e -> f -> g -> h -> student@ubuntu:~/piscine-go/test$ ``` diff --git a/subjects/listpushfront.en.md b/subjects/listpushfront.en.md index 3d377c59b..6aac8e067 100644 --- a/subjects/listpushfront.en.md +++ b/subjects/listpushfront.en.md @@ -1,8 +1,8 @@ -## listpushback +## listpushfront ### Instructions -Write a function `ListPushBack` that inserts a new element `NodeL` at the beginning of the list `l` while using the structure `List` +Write a function `ListPushFront` that inserts a new element `NodeL` at the beginning of the list `l` while using the structure `List` ### Expected function and structure @@ -29,8 +29,9 @@ Here is a possible [program](TODO-LINK) to test your function : package main import ( - piscine ".." "fmt" + + piscine ".." ) func main() { @@ -43,9 +44,10 @@ func main() { it := link.Head for it != nil { - fmt.Println(it.Data) + fmt.Print(it.Data, " ") it = it.Next } + fmt.Println() } ``` @@ -54,8 +56,6 @@ And its output : ```console student@ubuntu:~/piscine-go/test$ go build student@ubuntu:~/piscine-go/test$ ./test -how are you -man -Hello +how are you man Hello student@ubuntu:~/piscine-go/test$ ``` diff --git a/subjects/listpushfront.fr.md b/subjects/listpushfront.fr.md index c547c4a48..89a75b167 100644 --- a/subjects/listpushfront.fr.md +++ b/subjects/listpushfront.fr.md @@ -1,8 +1,8 @@ -## listpushback +## listpushfront ### Instructions -Écrire une fonction `ListPushBack` qui insère un nouvel élément `NodeL` au début de la liste `l` en utilisant la structure `List`. +Écrire une fonction `ListPushFront` qui insère un nouvel élément `NodeL` au début de la liste `l` en utilisant la structure `List`. ### Fonction et structue attendues @@ -29,8 +29,9 @@ Voici un éventuel [programme](TODO-LINK) pour tester votre fonction : package main import ( - piscine ".." "fmt" + + piscine ".." ) func main() { @@ -43,9 +44,10 @@ func main() { it := link.Head for it != nil { - fmt.Println(it.Data) + fmt.Print(it.Data, " ") it = it.Next } + fmt.Println() } ``` @@ -54,8 +56,6 @@ Et son résultat : ```console student@ubuntu:~/piscine-go/test$ go build student@ubuntu:~/piscine-go/test$ ./test -how are you -man -Hello +how are you man Hello student@ubuntu:~/piscine-go/test$ ```