Loading...
Processing Forum
Recent Topics
All Forums
Move this topic
Forum :
Share your Work
Programming Questions
Core Library Questions
Contributed Library Questions
Android Processing
Processing with Other Languages
Integration and Hardware
Library and Tool Development
Events and Opportunities
General Discussion
Sub forum :
Move this topic
Cancel
Programming Questions
paatriick..
Urgent Help! Conditionals. Someone please help asap.
in
Programming Questions
•
1 year ago
I need to change this code to a condition statement.
fill(i%2==0?(nSides%2==0?255:targetColour):((nSides%2==0)?targetColour:255));
patrick.
1
Replies(4)
allonestr..
Re: Urgent Help! Conditionals. Someone please help asap.
1 year ago
I think that it expands to this:
if (i % 2 == 0)
{
if (nSides % 2 == 0
{
fill(255);
}
else
{
fill(targetColour);
}
}
else
{
if (nSides % 2 == 0)
{
fill(targetColour);
}
else
{
fill(255);
}
}
Leave a comment on allonestring's reply
kooogy
Re: Urgent Help! Conditionals. Someone please help asap.
1 year ago
exclusive or!
http://en.wikipedia.org/wiki/Exclusive_or
fill(255);
if ((i % 2 == 0) ^ (nsides % 2 == 0)) {
fill(targetColour);
}
plain old 'not equals' works too...
if ((i % 2 == 0) != (nsides % 2 == 0)) {
...
Leave a comment on kooogy's reply
tfguy44
Re: Urgent Help! Conditionals. Someone please help asap.
1 year ago
HRM...
http://forum.processing.org/topic/targets-circles-shooting-game-concentric-rings
Leave a comment on tfguy44's reply
patrickch..
Re: Urgent Help! Conditionals. Someone please help asap.
1 year ago
allonestring, it works well thank you.
tfguy the person who composed that post is in my class, we are doing it together.
Leave a comment on patrickchallita123's reply
Change topic type
Topic Type :
Discussions
Questions
No of days :
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
Change topic type
Cancel
Link this topic
Provide the permalink of a topic that is related to this topic
Permalink
Save
Close
Reply to paatriickcc's question
Top
Reply
{"z21348252":[25080000001724069],"z4106057":[25080000001719991],"z21347113":[25080000001719930],"z4102052":[25080000001719951],"z5977540":[25080000001721553]}
Statistics
4
Replies
328
Views
0
Followers
Tags
No tags available for this topic.
Cancel
Actions
Permalink
Related Posts
Creating a simple, interactive shuf...
"Pixel Sorting"
Cannot Destroy Context while it is ...
Projecting a 2d (flat) image onto a...
How to make a ball bounce with grav...