Writing a computer program is like writing down a list of tasks that you want the computer to do. If this were all that a computer program could do, it would be pretty great, because instead of asking the computer to perform each step, one at a time, you can point the computer to the program and the computer can take care of all the steps in one go.
But what if the task you want the computer to perform is a little more complicated? For example, what if the list of tasks includes checking to see where you are in the task, and deciding on what action to take next based on how things have been going so far? This sort of check is known as a conditional.
To make this concrete, imagine that you are going to write a program that is going to determine all of the positive factors of the number 32. These factors will be numbers that you can multiply by another number to get 32, and they can not be fractions.
The number 1 is always a factor, so you could write a program that prints out the number 1, and you would be part way there.
2 is also a factor of 32, because 2 x 16 is 32, so we would want our program to print out "2". If we wanted to use our program determine factors for another number, say 33, then it shouldn't print out "2". How are we going to address this?
Here's a PICO-8 program that calculates the factors
y=32 for z=1,y do if y%z == 0 then print(z) end end
more