This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -1,2 +1,3 @@
|
||||
.idea
|
||||
boot-dev-pokedex
|
||||
boot-dev-pokedex
|
||||
*.log
|
||||
22
main.go
22
main.go
@@ -1,13 +1,33 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"bufio"
|
||||
"fmt"
|
||||
"os"
|
||||
"strings"
|
||||
)
|
||||
|
||||
func main() {
|
||||
|
||||
fmt.Println("Hello, World!")
|
||||
quit := false
|
||||
|
||||
for !quit {
|
||||
|
||||
// read user input
|
||||
input := bufio.NewScanner(os.Stdin)
|
||||
fmt.Print("Pokedex > ")
|
||||
for input.Scan() {
|
||||
word := input.Text()
|
||||
cleanedWord := cleanInput(word)
|
||||
fmt.Printf("Your command was: %s\n", cleanedWord[0])
|
||||
|
||||
if cleanedWord[0] == "quit" {
|
||||
quit = true
|
||||
}
|
||||
break
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user