Microsoft Small Basic

Program Listing: ZVJ452
TextWindow.Title = "Gors' Edgy Calculator"

TextWindow.WriteLine ("Welcome to Gors' Edgy Calculator! Here, you can make small math calculations.")
TextWindow.Read()

Help:

TextWindow.WriteLine ("Here are this calculator's possible tasks:")
TextWindow.WriteLine ("")
TextWindow.WriteLine ("[A] = add")
TextWindow.WriteLine ("[S] = subtract")
TextWindow.WriteLine ("[M] = multiply")
TextWindow.WriteLine ("[D] = divide")
TextWindow.WriteLine ("[2] = squared")
TextWindow.WriteLine ("[R] = Reset")
TextWindow.WriteLine ("[E] = End Program")
TextWindow.Read()

ResetOperations:

initialvalue = 0

Start:

TextWindow.Write ("Insert your value here >")
x = TextWindow.ReadNumber()

x = initialvalue + x

Calculation:

TextWindow.Writeline ("What do you want to do with the value " + x + "?")
TextWindow.WriteLine ("(Press [H] for help.)")
Action = TextWindow.Read()
Action = Text.ConvertToUpperCase (Action)

If Action = "H" Then
TextWindow.WriteLine ("Here are this calculator's possible tasks:")
TextWindow.WriteLine ("")
TextWindow.WriteLine ("[A] = add")
TextWindow.WriteLine ("[S] = subtract")
TextWindow.WriteLine ("[M] = multiply")
TextWindow.WriteLine ("[D] = divide")
TextWindow.WriteLine ("[R] = Reset")
TextWindow.WriteLine ("[E] = End Program")
TextWindow.Read()
Goto Calculation
ElseIf Action = "A" then
TextWindow.Write (x + " + ? >")
y = TextWindow.ReadNumber()
x = x + y
TextWindow.WriteLine ("Your value is now " + x + ".")
Goto Calculation
Elseif Action = "S" then
TextWindow.Write (x + " - ? >")
y = TextWindow.ReadNumber()
x = x - y
TextWindow.WriteLine ("Your value is now " + x + ".")
Goto Calculation
elseif Action = "M" then
TextWindow.Write (x + " * ? >")
y = TextWindow.ReadNumber()
x = x * y
TextWindow.WriteLine ("Your value is now " + x + ".")
Goto Calculation
elseif Action = "D" then
TextWindow.Write (x + " / ? >")
y = TextWindow.ReadNumber()
If y = "0" then
Goto FUCK
Else
x = x / y
TextWindow.WriteLine ("Your value is now " + x + ".")
EndIf
Goto Calculation
elseif Action = "2" then
TextWindow.Write (x + " squared.")
x = x * x
TextWindow.WriteLine (" Your value is now " + x + ".")
Goto Calculation
Elseif Action = "R" then
TextWindow.Write ("Do you wish to reset the value? y/n >")
yn = TextWindow.Read()
yn = Text.ConvertToLowerCase (yn)

Question:

If yn = "y" then
Goto ResetOperations
elseif yn = "n" then
Goto Calculation
Else
TextWindow.WriteLine ("This is not a valid answer.")
TextWindow.Read()
Goto Question
EndIf
Elseif Action = "E" then
TextWindow.Write ("Do you wish to end the program? y/n >")
yn = TextWindow.Read()
yn = Text.ConvertToLowerCase (yn)

Endquestion:

If yn = "y" then
Goto End
elseif yn = "n" then
Goto Calculation
Else
TextWindow.WriteLine ("This is not a valid answer.")
TextWindow.Read()
Goto Endquestion
EndIf
Else
TextWindow.WriteLine ("This is not a valid answer.")
TextWindow.Read()
Goto Calculation
EndIf

FUCK:

TextWindow.WriteLine ("You divided by 0.")
TextWindow.Read()

FUCKLOOP:

TextWindow.WriteLine ("F")
Goto FUCKLOOP

End:

TextWindow.WriteLine ("")
TextWindow.WriteLine ("Thank you for using this app.")