Be a Supporter!

or outcomes

  • 232 Views
  • 1 Reply
New Topic Respond to this Topic
tcc85811
tcc85811
  • Member since: Oct. 12, 2008
  • Offline.
Forum Stats
Member
Level 03
Blank Slate
or outcomes 2008-12-02 23:09:03 Reply

how would i use 'or' if i wanted one of two outcomes to an if statement?

in this example the 2 outcomes are functions:

if (condition == true){
outcomeOne() || outcomeTwo()
}

uyersuyer
uyersuyer
  • Member since: May. 15, 2002
  • Offline.
Forum Stats
Member
Level 05
Blank Slate
Response to or outcomes 2008-12-03 00:01:55 Reply

if (condition == true){
	ran=random(2)+1;
	if(ran==1){
		outcomeOne();
	}else{
		outcomeTwo();
	}
}

"Whoever said 'winners never quit' obviously never considered addicts." - Hoeloe

BBS Signature