func Function() { var done bool = false fmt.Println(c.CL) fmt.Println(c.B3, "Welcome to the Liner Solver by Whitman Huntley.") fmt.Println(c.B3, "This calculator supports all rational numbers as float64 datatypes.") fmt.Println(c.B3, "This program is text based.To make anything function, enter a keyword and then press enter.") u.Spacer(1) fmt.Println(c.V, "ERROR CHECK:", c.B00, "Don't mind me, I'm just here to make sure the program \n doesn't break.") u.Go(1) for done == false { fmt.Println(c.CL + c.X + c.G + "What data do you have?") fmt.Println(c.R + "a" + c.G + ": Two pairs of points. (x1, y1), (x2, y2)") fmt.Println(c.R + "b" + c.G + ": The slope and a point. m, (x1, y1)") fmt.Println(c.R + "c" + c.G + ": None, I'd like to leave.") mode, err := i.Prompt(c.G + "Select mode using the red key above\n" + c.B + ">" + c.M) u.QuitAtError(err) switch mode { //mode is defined as an input string above. case "a", "1": s.TwoPoints() case "b", "2": s.PointSlope() case "c", "3": fmt.Println(c.Y, "Okey! bye-bye!") done = true default: fmt.Println(c.B, "That statment isn't valid...") u.Go(1) } } }
func Go(testfor int) { fmt.Println() if testfor == 0 { fmt.Println(c.CL) } else if testfor == 1 { fmt.Println() fmt.Println() fmt.Println() } fmt.Println(c.B1 + "Press enter to continue") i.Prompt(c.B + ">" + c.M) fmt.Println(c.CL) }