Computer Science Canada How do I make the if statement boolean if I need it to be as an integer? |
Author: | JLChow [ Tue Nov 10, 2015 5:48 pm ] | ||
Post subject: | How do I make the if statement boolean if I need it to be as an integer? | ||
What is it you are trying to achieve? <Replace all the <> with your answers/code and remove the <>> What is the problem you are having? <We are told to make a slot machine in class, so I decided to take it for a spin. Now I am stuck with this problem of not being able to do something. So I have my random integers put as a variable with the name "slot1" slot2" and "slot3", but now when I try to do "if slot1, slot2, slot3 = 1 then" "put "WINNER!" it will tell me that it has to be in boolean format. I don't know what to do now. Describe what you have tried to solve this problem <Answer Here> Post any relevant code (You may choose to attach the file instead of posting the code if it is too long) <Answer Here>
Please specify what version of Turing you are using <Answer Here> ![]() ![]() ![]() ![]() |
Author: | Insectoid [ Tue Nov 10, 2015 7:25 pm ] | ||
Post subject: | RE:How do I make the if statement boolean if I need it to be as an integer? | ||
You need to test each slot individually and join them with the and keyword, like this:
|