trying_out_go/playground/playground.go

63 lines
1.5 KiB
Go
Raw Normal View History

package main
import (
"fmt"
"log"
"github.com/dixonwille/wmenu/v5"
)
func main() {
menu := wmenu.NewMenu("Choose a program.")
menu.Action(func(opts []wmenu.Opt) error {
fmt.Printf("You chose " + opts[0].Text + ". Launching...\n")
switch opts[0].Text {
case "Pass or Fail":
passFail()
case "Guessing Game":
guess()
case "Shopping List":
shopping()
case "Commandline Test":
terminalTest()
case "Wall Area":
wallArea()
case "myIntPointer":
myIntPointer()
case "Double":
double()
case "Convert To Celsius":
toCelsius()
case "Get the Average My Solution":
averageMySolution()
case "Get the Average Head First Solution":
averageHeadFirstSolution()
2023-11-04 13:09:04 -04:00
case "Get the Average Variadic":
averageVariadic()
case "Slices":
slices()
2023-11-04 13:09:04 -04:00
case "Variadic Functions":
variadic()
}
return nil
})
menu.PadOptionID()
menu.Option("Pass or Fail", nil, false, nil)
menu.Option("Guessing Game", nil, false, nil)
menu.Option("Shopping List", nil, false, nil)
menu.Option("Commandline Test", nil, false, nil)
menu.Option("Wall Area", nil, false, nil)
menu.Option("myIntPointer", nil, false, nil)
menu.Option("Double", nil, false, nil)
menu.Option("Convert To Celsius", nil, false, nil)
menu.Option("Get the Average My Solution", nil, false, nil)
menu.Option("Get the Average Head First Solution", nil, false, nil)
2023-11-04 13:09:04 -04:00
menu.Option("Get the Average Variadic", nil, false, nil)
menu.Option("Slices", nil, false, nil)
2023-11-04 13:09:04 -04:00
menu.Option("Variadic Functions", nil, false, nil)
err := menu.Run()
if err != nil {
log.Fatal(err)
}
}