diff --git a/.gitignore b/.gitignore index df09267..9e37833 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ .idea -boot-dev-pokedex \ No newline at end of file +boot-dev-pokedex +*.log \ No newline at end of file diff --git a/main.go b/main.go index a588538..006ecf2 100644 --- a/main.go +++ b/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 + } + + } }