Author |
Message |
person
|
Posted: Wed Feb 02, 2005 4:52 pm Post subject: weird problem with if statement |
|
|
y doesnt this work?
its supposed to check if a dot's colour is 1 or 44, and if its not 1 or 44 then draw a circle there
code: |
if whatdotcolor (40, 40) not= (44 and 1) then
drawfilloval (40, 40, 35, 35, 1)
end if
|
|
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
cycro1234
![](http://www.inetresults.com/gifs/images/Mad_hack.gif)
|
Posted: Wed Feb 02, 2005 4:59 pm Post subject: (No subject) |
|
|
why do u have
if whatdotcolor (40, 40) not= (44 and 1) then
the and there?? its:
if whatdotcolor (40, 40) not= *insert colour here* |
|
|
|
|
![](images/spacer.gif) |
person
|
Posted: Wed Feb 02, 2005 5:02 pm Post subject: (No subject) |
|
|
ummm.....maybe 44 and 1 r colours? |
|
|
|
|
![](images/spacer.gif) |
Bacchus
![](http://img104.exs.cx/img104/9206/ravenmoon12ns.jpg)
|
Posted: Wed Feb 02, 2005 5:02 pm Post subject: (No subject) |
|
|
thats not how u use and. you need to do
code: | if whatdotcolor(x,y)not=color1 & whatdotcolor(x,y) not=color2 then |
|
|
|
|
|
![](images/spacer.gif) |
md
![](http://compsci.ca/v3/uploads/user_avatars/1849317514ed6c4399768d.png)
|
Posted: Wed Feb 02, 2005 5:03 pm Post subject: (No subject) |
|
|
I'm not sure what cryo |
|
|
|
|
![](images/spacer.gif) |
person
|
Posted: Wed Feb 02, 2005 5:04 pm Post subject: (No subject) |
|
|
so wat does turing think im trying to say when i use my previous code? |
|
|
|
|
![](images/spacer.gif) |
Bacchus
![](http://img104.exs.cx/img104/9206/ravenmoon12ns.jpg)
|
Posted: Wed Feb 02, 2005 5:05 pm Post subject: (No subject) |
|
|
no idea im not turing |
|
|
|
|
![](images/spacer.gif) |
cycro1234
![](http://www.inetresults.com/gifs/images/Mad_hack.gif)
|
Posted: Wed Feb 02, 2005 5:06 pm Post subject: (No subject) |
|
|
I don't think Turing understands that. |
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
person
|
Posted: Wed Feb 02, 2005 5:08 pm Post subject: (No subject) |
|
|
if it doesnt understand it, y does it still run? |
|
|
|
|
![](images/spacer.gif) |
cycro1234
![](http://www.inetresults.com/gifs/images/Mad_hack.gif)
|
Posted: Wed Feb 02, 2005 5:09 pm Post subject: (No subject) |
|
|
Hey, I'm just a noob ![Sad Sad](http://compsci.ca/v3/images/smiles/icon_sad.gif) |
|
|
|
|
![](images/spacer.gif) |
person
|
Posted: Wed Feb 02, 2005 9:08 pm Post subject: (No subject) |
|
|
code: |
if whatdotcolour (x,y) = (colour1 and colour2) then
% stuff
end if
|
wat does this mean if it doesnt mean...
code: |
if whatdotcolour (x,y) = colour1 and whatdotcolour (x,y) = colour2 then
% stuff
end if
|
i know its not an error because turing actually runs it |
|
|
|
|
![](images/spacer.gif) |
cycro1234
![](http://www.inetresults.com/gifs/images/Mad_hack.gif)
|
Posted: Wed Feb 02, 2005 9:30 pm Post subject: (No subject) |
|
|
Well if it doesn't work, don't use it ![Smile Smile](http://compsci.ca/v3/images/smiles/icon_smile.gif) |
|
|
|
|
![](images/spacer.gif) |
person
|
Posted: Wed Feb 02, 2005 9:40 pm Post subject: (No subject) |
|
|
y doesnt it work? |
|
|
|
|
![](images/spacer.gif) |
cycro1234
![](http://www.inetresults.com/gifs/images/Mad_hack.gif)
|
Posted: Wed Feb 02, 2005 9:42 pm Post subject: (No subject) |
|
|
I dunno, ask some1 whose not n00bish. |
|
|
|
|
![](images/spacer.gif) |
TheZsterBunny
![](http://www.members.shaw.ca/rfolz/zstervava2.jpg)
|
Posted: Wed Feb 02, 2005 11:57 pm Post subject: (No subject) |
|
|
Turing is not like most other languages.
to compare a value to other values, you must use different statements.
code: |
if x=1 or x=5 then
%stuff
end if
|
also, perhaps you may wish to rephrase that statement.
code: |
if whatdotcolor(x,y)_ ~= color1 and whatdotcolor(x,y) ~= color2 then
% stuff
end if
|
What you have doesn't make sense to turing. you are comparing the value of (whatdotcolor(40,40)) to (44 and 1). NOT them individually, but together. -- Bad!
another way (if you want)--
code: |
if whatdotcolor(40,40) = 44 or whatdotcolor(40,40) = 1 then
%its bad!
else
%its good!
end if
|
but that'll probably get you yelled at.
-Z |
|
|
|
|
![](images/spacer.gif) |
|