Jump to content
  • 0

[help]aporia me random(java)


Question

Posted

1)switch (Rnd.get(3)

gia paradigma exoume auto kai apo katw pernoume cases periptoseis , omos poses akrivos pernoume? ksekiname apo to 0 mexri to 2? i apo to 0 mexri to 3? auto den to exw katalavei akrivos, ti enoei auto akrivos? opios mporei na me pei euxaristo ;)

 

2)pos gia paradigma mporw na kanw 2 periptoseis me diaforetiko success gia px.. na pataei 1 item kai na exei 60% na ginei hero kai 40% oxi.(paradigma leme tora)

 

euxaristo, opios me apantisei tha me help arketa

4 answers to this question

Recommended Posts

  • 0
Posted

Mporis na to kaneis etsi (opws to exw kai gw )

Pernis 3 chance opou einai sta % 33.3333....

kai vazeis

 

		int chance = Rnd.get(3);

			if(chance == 0)


			{
			activeChar.sendMessage("Grantz")
			}

			if(chance == 1)
			{
			activeChar.sendMessage("Loser")
			}

			if(chance == 3)
			{
			activeChar.sendMessage("Nothing done")
			}

 

Oso gia to 2o mporis na kaneis

 

int chance = Rnd.get(4);
if(chance == 1)
			{
			activeChar.sendMessage("Try again.")
			}

if(chance == 2)
			{
			activeChar.sendMessage("Congratz. You are hero now")
                                setIsHero (true);
			}
if(chance == 3)
			{
			activeChar.sendMessage("Congratz. You are hero now")
                                setIsHero (true);
			}
if(chance == 4)
			{
			activeChar.sendMessage("Congratz. You are hero now")
                                setIsHero (true);
			}
[code]

Note : Afto einai gia 25% - 75%.
Elpizw na voi8isa

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock