Hmmm, might help if you knew types:
TYPES OF VARIABLES:
INT = INTEGER. ANY WHOLE NUMBER SUCH AS 9, 235, -45, -9
REAL = ANY NUMBER: 0.46, 9.345, -42.54, 9, 3, 0 (Yes, Integers can be REAL numbers)
STRING = Any TEXT (CHAR). Example: "A, HERSD, PEOPLE, AKE, G$H%, 744HD84"
BOOLEAN = TRUE OR FALSE
You probably know the first THREE variable types so I'll just explain the last one:
Boolean is used in CONDITIONAL statements. Think of boolean as a switch. A switch has an ON button and an OFF button. It can't be BOTH, it can either be ONE or the other. Boolean is set like this
Var example : boolean := true
Var example : boolean := false
So, either true or false.
Boolean is used in conditional statements. You just SET a variable to be true or false, then when a certain condition is met, you can have the value change to true or false. In doing this, it will affect different things in the program. Think of it like a chain reaction. You know those rows of lights in the classroom? You know how the light switch usually has around 4 switches? You can turn SOME lights off, and keep SOME lights on. There are numerous possibilities: "All lights on, all lights off, first two lights on, middle lights on, etc". That's kind of how boolean works. Boolean is either true or false (on or off) and in doing this, you can change different things in your program. For example:
Var X := FALSE
LOOP
IF X = FALSE THEN
X := TRUE
PUT "HELLO"
ELSIF X = TRUE THEN
X:= FALSE
PUT "GOODBYE"
END IF
END LOOP
This is just showing (In a loop that goes on forever, so it just keeps repeating and repeating and repeating.) Anyways this just shows how the boolean value keeps changing. X Starts off as being FALSE, then it is compared in the conditional statement, and it's value is then changed to TRUE and the word "HELLO" is displayed. Now, the program restarts, and X is now TRUE, so instead of going in the FALSE section, it goes into the TRUE section where it's value is switched to FALSE and "GOODBYE" is displayed. So, this keeps going on forever and forever., the values are compared, and switched. It's kind of like some bored kid who just keeps flicking the light switch ON and OFF and ON and OFF.