2023-10-16 12:44:08 -04:00
|
|
|
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()
|
2023-10-18 20:46:25 -04:00
|
|
|
case "Get the Average My Solution":
|
|
|
|
averageMySolution()
|
|
|
|
case "Get the Average Head First Solution":
|
|
|
|
averageHeadFirstSolution()
|
2023-10-24 20:36:25 -04:00
|
|
|
case "Slices":
|
|
|
|
slices()
|
2023-10-16 12:44:08 -04:00
|
|
|
}
|
|
|
|
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)
|
2023-10-18 20:46:25 -04:00
|
|
|
menu.Option("Get the Average My Solution", nil, false, nil)
|
|
|
|
menu.Option("Get the Average Head First Solution", nil, false, nil)
|
2023-10-24 20:36:25 -04:00
|
|
|
menu.Option("Slices", nil, false, nil)
|
2023-10-16 12:44:08 -04:00
|
|
|
err := menu.Run()
|
|
|
|
if err != nil {
|
|
|
|
log.Fatal(err)
|
|
|
|
}
|
|
|
|
}
|