Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Script Help RandInt and Switch Statements.
PutraenusAlivius Offline
Posting Freak

Posts: 4,713
Threads: 75
Joined: Dec 2012
Reputation: 119
#3
RE: RandInt and Switch Statements.

(04-13-2013, 02:02 PM)ClayPigeon Wrote:
switch(RandInt(min, max))
{    
    case min:    
    {    
    }    
    case max:    
    {    
    }
    case ((min+max)/2):  
    {    
    }
}

It's quite easy really.
Change min and max with your own values, of course. Switch the case values with the values you want to check (1, 3, 4.56, hope you got me)

Like this?
switch(RandInt(1, 3))
{    
    case 1:    
    {    
    }    
    case 3:    
    {    
    }
    case ((1+3)/2):  
    {    
    }
}

"Veni, vidi, vici."
"I came, I saw, I conquered."
04-13-2013, 03:09 PM
Find


Messages In This Thread
RE: RandInt and Switch Statements. - by PutraenusAlivius - 04-13-2013, 03:09 PM
RE: RandInt and Switch Statements. - by NaxEla - 04-13-2013, 05:08 PM
RE: RandInt and Switch Statements. - by Kreekakon - 04-13-2013, 05:23 PM
RE: RandInt and Switch Statements. - by NaxEla - 04-13-2013, 05:48 PM
RE: RandInt and Switch Statements. - by Kreekakon - 04-13-2013, 05:57 PM



Users browsing this thread: 1 Guest(s)