From 7ec29d83048dfebcf48a7191a0bb699bab9cab2f Mon Sep 17 00:00:00 2001 From: lee Date: Tue, 27 Aug 2019 14:54:29 +0100 Subject: [PATCH 1/4] fix writing problems --- subjects/listpushfront.en.md | 14 +++++++------- subjects/listpushfront.fr.md | 14 +++++++------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/subjects/listpushfront.en.md b/subjects/listpushfront.en.md index dd01e9fa9..578cb74ca 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/test$ go build student@ubuntu:~/piscine/test$ ./test -how are you -man -Hello +how are you man Hello student@ubuntu:~/piscine/test$ ``` diff --git a/subjects/listpushfront.fr.md b/subjects/listpushfront.fr.md index 4a2ddd2a7..95c80bd6e 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/test$ go build student@ubuntu:~/piscine/test$ ./test -how are you -man -Hello +how are you man Hello student@ubuntu:~/piscine/test$ ``` From a5361affd77801a54ca23644cfdbcf567e1aca65 Mon Sep 17 00:00:00 2001 From: lee Date: Thu, 5 Sep 2019 21:42:16 +0100 Subject: [PATCH 2/4] correcting output from the readme --- subjects/listmerge.en.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/subjects/listmerge.en.md b/subjects/listmerge.en.md index 0a72201fe..470507712 100644 --- a/subjects/listmerge.en.md +++ b/subjects/listmerge.en.md @@ -75,6 +75,11 @@ And its output : ```console student@ubuntu:~/piscine/test$ go build student@ubuntu:~/piscine/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/test$ ``` From 1d207328a968980d2ce061dace16f047a1573525 Mon Sep 17 00:00:00 2001 From: lee Date: Fri, 6 Sep 2019 11:08:40 +0100 Subject: [PATCH 3/4] missing "_node" on listforeach --- subjects/listforeach.en.md | 2 +- subjects/listforeach.fr.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/subjects/listforeach.en.md b/subjects/listforeach.en.md index d2f91bb4b..18ae35018 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 75d6c2e58..b13e4ac1a 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 { From 3d0970ca7f8c206aeb1c243a7960162e930e5dfc Mon Sep 17 00:00:00 2001 From: lee Date: Fri, 6 Sep 2019 11:44:20 +0100 Subject: [PATCH 4/4] fix output given to the student --- subjects/listforeachif.en.md | 15 +++++++++------ subjects/listforeachif.fr.md | 15 +++++++++------ 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/subjects/listforeachif.en.md b/subjects/listforeachif.en.md index 497e3dc29..253c968bc 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/test$ go build student@ubuntu:~/piscine/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/test$ ``` diff --git a/subjects/listforeachif.fr.md b/subjects/listforeachif.fr.md index c0f6be181..0c2a0eb23 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,15 @@ Et son résultat : ```console student@ubuntu:~/piscine/test$ go build student@ubuntu:~/piscine/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/test$ ```