If Statement Trouble
9 posts • Page 1 of 1
If Statement Trouble
I have noticed there are subtle differences in thyme from Phun, and yes i finally got Algodoo to work. here is the code
- Code: Select all
(e.geom.color == [0,0,0,1] ? {onlaserit = {}} : {})
-
niffirg1 - Posts: 376
- Joined: Mon Aug 31, 2009 10:31 pm
- Location: The Great American South!
Re: If Statement Trouble
no, this is how you shoud do it
{{scene.my.bla == 1} ? {bla} : {bla bla}}
you put the brackets in the wrong spots
{a} ? {b} : {c}
{{scene.my.bla == 1} ? {bla} : {bla bla}}
you put the brackets in the wrong spots
{a} ? {b} : {c}
-
Versieon - Posts: 375
- Joined: Tue Sep 01, 2009 4:45 pm
Re: If Statement Trouble
niffirg1 wrote:I have noticed there are subtle differences in thyme from Phun, and yes i finally got Algodoo to work. here is the codefor some reason it doesnt work
- Code: Select all
(e.geom.color == [0,0,0,1] ? {onlaserit = {}} : {})
A few things
- Spelling Mistake (as pointed out).
- You forgot to place argument (not sure of the word I'm looking for) interpreters ((e)=>).
- Although not really an error, sometimes things go wrong if you don't use e.laser.onLaserHit (well, it's easier to tell apart from onHitByLaser (e.geom))
- gradyfitz
- Posts: 174
- Joined: Tue Sep 01, 2009 8:33 am
- Location: Victoria, Australia
Re: If Statement Trouble
How do you set the If statement to not equal to.
-
niffirg1 - Posts: 376
- Joined: Mon Aug 31, 2009 10:31 pm
- Location: The Great American South!
Re: If Statement Trouble
Versieon wrote:=! instead of ==
lol it's != in C++, not sure about thyme(but thyme is C++ based.)
Please excuse my posts. I am extremely stupid.
-
cdh473 - Posts: 816
- Joined: Tue Sep 01, 2009 12:37 am
- Location: Yes
Re: If Statement Trouble
-.-
I'm going to say this one time.
== equal to
>= greater than or equal to
<= less than or equal to
> more than
< less than
!= not equal to
I'm going to say this one time.
== equal to
>= greater than or equal to
<= less than or equal to
> more than
< less than
!= not equal to
-
standardtoaster - Posts: 606
- Joined: Mon Aug 31, 2009 7:57 pm
9 posts • Page 1 of 1
Who is online
Users browsing this forum: No registered users and 11 guests