package main import ( "fmt" "os" "strconv" ) 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: } } }