So, I am in Grade Ten Programming and we're primarily using Turing with a dash of C# and I want to ask you something: How do I make the computer recognize all numbers within certain parameters during an if?
Or if you would rather: Eg.
if answer = 1 through 5 then put "blah-blah." end if
Something like this, but I can't figure it out.
I want to do this because my class hasn't learned this yet and I feel like going a bit "Above and Beyond" because the work is boring and I feel like making it more entertaining with Easter eggs because I don't want to lose interest half-way through the course.
I apologize, I didn't think the < signs would have messed up with the HTML...
I'm not sure I have 100% understood your question, but it seems you should use those "less than or equal to", "greater than or equal to" things:
if (answer >= 1 && answer <= 5) { put "blah-blah." }
I don't know Turing so I wrote this in AS3 syntax, tell me if you have trouble understanding it. However, this is what I think it should look like in the language you're using:
if answer >= 1 && answer <= 5 then put "blah-blah." end if
This is getting stupid, the site won't post my whole post.
I'll try again. gabolath, good idea, but they wouldn't work. The compiler says that it requires Booleans, which makes little sense to me because Booleans are normally "True" or "False" right? I'll see what my teacher has to say.