diff --git a/main.go b/main.go index aab7c20..172575d 100644 --- a/main.go +++ b/main.go @@ -2,8 +2,59 @@ package main import ( "fmt" + "os" + "strconv" ) -func main() { - fmt.Println("Sample text") +func asciiLogo() { + fmt.Println(` + # # ( ) + ___#_#___|__ + _ |____________| _ + _=====| | | | | |==== _ + =====| |.---------------------------. | |==== + <--------------------' . . . . . . . . '--------------/ + \ / + \___________________________________________________________/ + `) +} + +func startMenu() { + fmt.Println("[1] Singleplayer") + fmt.Println("[2] Join server") + fmt.Println("[3] Host server") + fmt.Println("[4] Quit") + fmt.Printf("\nChoice: ") +} + +func quitPrompt() { + fmt.Printf("Do you wish to quit? [y/n] ") + choice := scanLine() + if choice == "y" { + os.Exit(0) + } +} + +func main() { + for { + clear() + asciiLogo() + startMenu() + strchoice := scanLine() + choice, _ := strconv.Atoi(strchoice) + switch choice { + case 1: + singleplayer() + break + case 2: + client() + case 3: + server() + case 4: + quitPrompt() + default: + + } + + } }