Hello this is the 1st code:
up:
TextWindow.WriteLine("Welcome to AND operation calculator")
TextWindow.WriteLine("===================================")
TextWindow.WriteLine("Enter the the first or A's variable value (0/1): ")
A = TextWindow.ReadNumber()
TextWindow.WriteLine("Enter the second or B's variable value (0/1): ")
B = TextWindow.ReadNumber()
If A = 0 And B = 0 Then
answer = 0
ElseIf A = 0 and B = 1 then
answer = 0
elseif A = 1 and B = 0 then
answer = 0
elseif A = 1 and B = 1 then
answer = 1
EndIf
TextWindow.WriteLine("The result is: " + answer)
TextWindow.WriteLine("========================= Again?")
TextWindow.WriteLine("")
TextWindow.Read()
Goto up
And, this is the 2nd code (more condensed if statement):
up:
TextWindow.WriteLine("Welcome to AND operation calculator")
TextWindow.WriteLine("===================================")
TextWindow.WriteLine("Enter the the first or A's variable value (0/1): ")
A = TextWindow.ReadNumber()
TextWindow.WriteLine("Enter the second or B's variable value (0/1): ")
B = TextWindow.ReadNumber()
If A = 1 And B = 1 Then
answer = 1
Else
answer = 0
EndIf
TextWindow.WriteLine("The result is: " + answer)
TextWindow.WriteLine("========================= Again?")
TextWindow.WriteLine("")
TextWindow.Read()
Goto up