|
|
@ -7,7 +7,7 @@ Write and fix the folloing functions. |
|
|
|
### Expected functions |
|
|
|
### Expected functions |
|
|
|
|
|
|
|
|
|
|
|
```go |
|
|
|
```go |
|
|
|
func PutStr(str string) { |
|
|
|
func PrintStr(str string) { |
|
|
|
arrayRune := []rune(str) |
|
|
|
arrayRune := []rune(str) |
|
|
|
for _, s := range arrayRune { |
|
|
|
for _, s := range arrayRune { |
|
|
|
z01.PrintRune(s) |
|
|
|
z01.PrintRune(s) |
|
|
@ -15,18 +15,18 @@ func PutStr(str string) { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
func CloseDoor(ptrDoor *Door) bool { |
|
|
|
func CloseDoor(ptrDoor *Door) bool { |
|
|
|
PutStr("Door closing...") |
|
|
|
PrintStr("Door closing...") |
|
|
|
state = CLOSE |
|
|
|
state = CLOSE |
|
|
|
return true |
|
|
|
return true |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
func IsDoorOpen(Door Door) { |
|
|
|
func IsDoorOpen(Door Door) { |
|
|
|
PutStr("Door is open ?") |
|
|
|
PrintStr("Door is open ?") |
|
|
|
return Door.state = OPEN |
|
|
|
return Door.state = OPEN |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
func IsDoorClose(ptrDoor *Door) bool { |
|
|
|
func IsDoorClose(ptrDoor *Door) bool { |
|
|
|
PutStr("Door is close ?") |
|
|
|
PrintStr("Door is close ?") |
|
|
|
} |
|
|
|
} |
|
|
|
``` |
|
|
|
``` |
|
|
|
|
|
|
|
|
|
|
|