Browse Source

Merge pull request #260 from 01-edu/fixReadMeLinkList

fix writing problems on link list
pull/271/head
augusto-mantilla 5 years ago committed by GitHub
parent
commit
64239af758
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      subjects/listforeach.en.md
  2. 2
      subjects/listforeach.fr.md
  3. 15
      subjects/listforeachif.en.md
  4. 13
      subjects/listforeachif.fr.md
  5. 5
      subjects/listmerge.en.md
  6. 14
      subjects/listpushfront.en.md
  7. 14
      subjects/listpushfront.fr.md

2
subjects/listforeach.en.md

@ -63,7 +63,7 @@ func main() {
piscine.ListPushBack(link, "3") piscine.ListPushBack(link, "3")
piscine.ListPushBack(link, "5") piscine.ListPushBack(link, "5")
piscine.ListForEach(link, piscine.Add2) piscine.ListForEach(link, piscine.Add2_node)
it := link.Head it := link.Head
for it != nil { for it != nil {

2
subjects/listforeach.fr.md

@ -63,7 +63,7 @@ func main() {
piscine.ListPushBack(link, "3") piscine.ListPushBack(link, "3")
piscine.ListPushBack(link, "5") piscine.ListPushBack(link, "5")
piscine.ListForEach(link, piscine.Add2) piscine.ListForEach(link, piscine.Add2_node)
it := link.Head it := link.Head
for it != nil { for it != nil {

15
subjects/listforeachif.en.md

@ -86,7 +86,7 @@ func PrintList(l *piscine.List) {
fmt.Print(it.Data, "->") fmt.Print(it.Data, "->")
it = it.Next it = it.Next
} }
fmt.Println() fmt.Print("nil","\n")
} }
func main() { func main() {
@ -120,12 +120,15 @@ And its output :
```console ```console
student@ubuntu:~/piscine-go/test$ go build student@ubuntu:~/piscine-go/test$ go build
student@ubuntu:~/piscine-go/test$ ./test student@ubuntu:~/piscine-go/test$ ./test
1 -> hello -> 3 -> there -> 23 -> ! -> 54 -> <nil> 1->hello->3->there->23->!->54->nil
--------function applied-------- --------function applied--------
hello 1
there 3
! 23
54
--------function applied-------- --------function applied--------
1 -> 1 -> 3 -> 1 -> 23 -> 1 -> 54 -> <nil> 1->2->3->2->23->2->54->nil
student@ubuntu:~/piscine-go/test$
student@ubuntu:~/piscine-go/test$ student@ubuntu:~/piscine-go/test$
``` ```

13
subjects/listforeachif.fr.md

@ -86,7 +86,7 @@ func PrintList(l *piscine.List) {
fmt.Print(it.Data, "->") fmt.Print(it.Data, "->")
it = it.Next it = it.Next
} }
fmt.Println() fmt.Print("nil","\n")
} }
func main() { func main() {
@ -120,12 +120,13 @@ Et son résultat :
```console ```console
student@ubuntu:~/piscine-go/test$ go build student@ubuntu:~/piscine-go/test$ go build
student@ubuntu:~/piscine-go/test$ ./test student@ubuntu:~/piscine-go/test$ ./test
1 -> hello -> 3 -> there -> 23 -> ! -> 54 -> <nil> 1->hello->3->there->23->!->54->nil
--------function applied-------- --------function applied--------
hello 1
there 3
! 23
54
--------function applied-------- --------function applied--------
1 -> 1 -> 3 -> 1 -> 23 -> 1 -> 54 -> <nil> 1->2->3->2->23->2->54->nil
student@ubuntu:~/piscine-go/test$ student@ubuntu:~/piscine-go/test$
``` ```

5
subjects/listmerge.en.md

@ -75,6 +75,11 @@ And its output :
```console ```console
student@ubuntu:~/piscine-go/test$ go build student@ubuntu:~/piscine-go/test$ go build
student@ubuntu:~/piscine-go/test$ ./test student@ubuntu:~/piscine-go/test$ ./test
-----first List------
a -> b -> c -> d -> <nil>
-----second List------
e -> f -> g -> h -> <nil>
-----Merged List-----
a -> b -> c -> d -> e -> f -> g -> h -> <nil> a -> b -> c -> d -> e -> f -> g -> h -> <nil>
student@ubuntu:~/piscine-go/test$ student@ubuntu:~/piscine-go/test$
``` ```

14
subjects/listpushfront.en.md

@ -1,8 +1,8 @@
## listpushback ## listpushfront
### Instructions ### 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 ### Expected function and structure
@ -29,8 +29,9 @@ Here is a possible [program](TODO-LINK) to test your function :
package main package main
import ( import (
piscine ".."
"fmt" "fmt"
piscine ".."
) )
func main() { func main() {
@ -43,9 +44,10 @@ func main() {
it := link.Head it := link.Head
for it != nil { for it != nil {
fmt.Println(it.Data) fmt.Print(it.Data, " ")
it = it.Next it = it.Next
} }
fmt.Println()
} }
``` ```
@ -54,8 +56,6 @@ And its output :
```console ```console
student@ubuntu:~/piscine-go/test$ go build student@ubuntu:~/piscine-go/test$ go build
student@ubuntu:~/piscine-go/test$ ./test student@ubuntu:~/piscine-go/test$ ./test
how are you how are you man Hello
man
Hello
student@ubuntu:~/piscine-go/test$ student@ubuntu:~/piscine-go/test$
``` ```

14
subjects/listpushfront.fr.md

@ -1,8 +1,8 @@
## listpushback ## listpushfront
### Instructions ### 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 ### Fonction et structue attendues
@ -29,8 +29,9 @@ Voici un éventuel [programme](TODO-LINK) pour tester votre fonction :
package main package main
import ( import (
piscine ".."
"fmt" "fmt"
piscine ".."
) )
func main() { func main() {
@ -43,9 +44,10 @@ func main() {
it := link.Head it := link.Head
for it != nil { for it != nil {
fmt.Println(it.Data) fmt.Print(it.Data, " ")
it = it.Next it = it.Next
} }
fmt.Println()
} }
``` ```
@ -54,8 +56,6 @@ Et son résultat :
```console ```console
student@ubuntu:~/piscine-go/test$ go build student@ubuntu:~/piscine-go/test$ go build
student@ubuntu:~/piscine-go/test$ ./test student@ubuntu:~/piscine-go/test$ ./test
how are you how are you man Hello
man
Hello
student@ubuntu:~/piscine-go/test$ student@ubuntu:~/piscine-go/test$
``` ```

Loading…
Cancel
Save