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.
NaxEla Offline
Senior Member

Posts: 415
Threads: 5
Joined: Dec 2012
Reputation: 28
#5
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)

You aren't actually supposed to have those curly brackets after each case. It will cause an error.

In Ruins [WIP]
04-13-2013, 05:08 PM
Find


Messages In This Thread
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)