Browse Source

fix fixthemain.en.md

content-update
lee 5 years ago committed by Christopher Fremond
parent
commit
ceee1b35a8
  1. 26
      subjects/fixthemain.en.md
  2. 26
      subjects/fixthemain.fr.md

26
subjects/fixthemain.en.md

@ -2,11 +2,13 @@
### Instructions ### Instructions
Write and fix the folloing functions. Write and fix the following program.
### Expected functions ### Expected functions
```go ```go
package piscine
func PrintStr(str string) { func PrintStr(str string) {
arrayRune := []rune(str) arrayRune := []rune(str)
for _, s := range arrayRune { for _, s := range arrayRune {
@ -28,14 +30,6 @@ func IsDoorOpen(Door Door) {
func IsDoorClose(ptrDoor *Door) bool { func IsDoorClose(ptrDoor *Door) bool {
PrintStr("Door is close ?") PrintStr("Door is close ?")
} }
```
### Usage
Here is a possible [program](TODO-LINK) to test your function :
```go
package main
func main() { func main() {
door := &Door{} door := &Door{}
@ -51,16 +45,4 @@ func main() {
CloseDoor(door) CloseDoor(door)
} }
} }
``` ```
And its output :
```console
student@ubuntu:~/piscine/test$ go build
student@ubuntu:~/piscine/test$ ./test
Door Opening...
Door is close ?
Door is open ?
Door closing...
student@ubuntu:~/piscine/test$
```

26
subjects/fixthemain.fr.md

@ -2,11 +2,13 @@
### Instructions ### Instructions
Write and fix the folloing functions. Write and fix the following program.
### Expected functions ### Expected functions
```go ```go
package piscine
func PrintStr(str string) { func PrintStr(str string) {
arrayRune := []rune(str) arrayRune := []rune(str)
for _, s := range arrayRune { for _, s := range arrayRune {
@ -28,14 +30,6 @@ func IsDoorOpen(Door Door) {
func IsDoorClose(ptrDoor *Door) bool { func IsDoorClose(ptrDoor *Door) bool {
PrintStr("Door is close ?") PrintStr("Door is close ?")
} }
```
### Usage
Here is a possible [program](TODO-LINK) to test your function :
```go
package main
func main() { func main() {
door := &Door{} door := &Door{}
@ -51,16 +45,4 @@ func main() {
CloseDoor(door) CloseDoor(door)
} }
} }
``` ```
And its output :
```console
student@ubuntu:~/piscine/test$ go build
student@ubuntu:~/piscine/test$ ./test
Door Opening...
Door is close ?
Door is open ?
Door closing...
student@ubuntu:~/piscine/test$
```
Loading…
Cancel
Save