Boolean
Author |
Message |
M49913
|
Posted: Sun Jun 07, 2009 6:23 pm Post subject: Boolean |
|
|
What is it you are trying to achieve?
I just need something to display if the inputted number is bigger or equal to 1 or less than or equal to 16
What is the problem you are having?
Syntax error at <
Post any relevant code (You may choose to attach the file instead of posting the code if it is too long)
<Answer Here>
Turing: |
if answer (1) => 1 or answer (1) =< 16 then
put answer (1), " of product number ", answer (1)
end if
|
Please specify what version of Turing you are using
<Answer Here> |
|
|
|
|
|
Sponsor Sponsor
|
|
|
DtY
|
Posted: Sun Jun 07, 2009 6:52 pm Post subject: RE:Boolean |
|
|
</> comes before the =
so:
<= and >=
not
=< and => |
|
|
|
|
|
BigBear
|
Posted: Sun Jun 07, 2009 7:08 pm Post subject: RE:Boolean |
|
|
Are you using and array and referring to element 1 or character 1 of the string? |
|
|
|
|
|
zero-impact
|
Posted: Sun Jun 07, 2009 8:03 pm Post subject: RE:Boolean |
|
|
You have a logic error as well. Think about what it is saying. The number is greater than 1 OR less than 16?
Dty is correct, it should be >= and <=. |
|
|
|
|
|
Kharybdis
|
Posted: Sun Jun 07, 2009 9:04 pm Post subject: RE:Boolean |
|
|
Turing: |
if answer (1) >= 1 and answer (1) <= 16 then
put answer (1), " of product number ", answer (1)
end if
|
|
|
|
|
|
|
|
|