func Startup() { //the function that's the "main menu" of sorts isDone := false doWhat := "" for isDone == false { //for loop so you don't have to come back here each time. //and a switch statment to force a responce. switch doWhat { case "a": findC() doWhat = "" case "b": findAorB() doWhat = "" case "c": isDone = true default: fmt.Println(c.CL + c.B01 + "distance and midpoint calculator " + Version) s.Spacer(2) fmt.Println(c.B1 + "What do you need solved?" + c.X) fmt.Println(c.Y + "Enter one of the letters in red:") s.Spacer(1) fmt.Println(c.R + "{A}" + c.B0 + " Find distance") fmt.Println(c.R + "{B}" + c.B0 + " Find midpoint") fmt.Println(c.R + "{C}" + c.B0 + " Nothing! Stop talking to me perv!") doWhat = i.StringInput(c.M + ">>> " + c.B) } } }
func Startup() { //the function that's the "main menu" of sorts isDone := false doWhat := "" for isDone == false { //for loop so you don't have to come back here each time. //and a switch statment to force a responce. switch doWhat { case "a": fmt.Println("PROVIDE FUNCTION") doWhat = "" case "b": fmt.Println("PROVIDE FUNCTION") doWhat = "" case "d": isDone = true case "c": fmt.Println("PROVIDE FUNCTION") doWhat = "" default: fmt.Println(c.CL + c.B01 + "Quadratics calculator: " + Version) s.Spacer(2) fmt.Println(c.B1 + "What do you need solved?" + c.X) fmt.Println(c.Y + "Enter one of the letters in red:") s.Spacer(1) fmt.Println(c.R + "{A}" + c.B0 + " [OPTION A]") fmt.Println(c.R + "{B}" + c.B0 + " [OPTION B]") fmt.Println(c.R + "{C}" + c.B0 + " [OPTION C]") fmt.Println(c.R + "{D}" + c.B0 + " Exit system") doWhat = i.StringInput(c.M + ">>> " + c.B) } } }
func Start() { solve := "" for solve != "q" { fmt.Println(c.CL + "Type " + c.O + "fn" + c.X + " for math functions and " + c.O + "q" + c.X + " to quit.") solve = i.StringInput("~> ") if solve == "fn" { mathFuncs() } else { fmt.Println(c.X + "Lolwut?") } } }
func mathFuncs() { //the only function in this isDone := false doWhatNow := "" for isDone == false { //So that you don't have to restart the program each time switch doWhatNow { case "a": ymxb.Function() //Calls the ymxb library's startup function. see module for more details. doWhatNow = "" //We have to reset doWhatNow lest we want the same module on repeat case "b": tria.Startup() doWhatNow = "" case "c": dist.Startup() doWhatNow = "" case "d": ccs.Startup() doWhatNow = "" case "e": quad.FindDiscriminant() doWhatNow = "" case "f": isDone = true default: //forces a responce fmt.Println(c.CL + c.X + "Functions") fmt.Println(c.Y + "Select one of the letters in red") s.Spacer(1) //adds a line fmt.Println(c.R + "{A}" + c.B0 + " Find a linear slope equation") fmt.Println(c.R + "{B}" + c.B0 + " Find the hypotonuse of a right triangle") fmt.Println(c.R + "{C}" + c.B0 + " Find distance or midpoint") fmt.Println(c.R + "{D}" + c.B0 + " Find volume of cone, cylinder or sphere") fmt.Println(c.R + "{E}" + c.B0 + " Quadratics") fmt.Println(c.R + "{F}" + c.B0 + " Nothing go away") s.Spacer(1) doWhatNow = i.StringInput(c.B + ">>>" + c.X) } } }