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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...