This commit is contained in:
2025-03-10 21:47:13 +02:00
parent 5811e43f3c
commit c6e41f607a
2 changed files with 23 additions and 2 deletions

3
.gitignore vendored
View File

@@ -1,2 +1,3 @@
.idea
boot-dev-pokedex
boot-dev-pokedex
*.log

22
main.go
View File

@@ -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
}
}
}