We're creating a program based on the Opportunity card game. On each of the player's turn to draw, they have a 10% chance of drawing two cards instead of one at the price of 1000. How should we implement this? Thanks

I know nothing of Opportunity, but for 10% chance you use Math.random() to get a random double >= 0.0 and < 1.0
Something like

if (Math.random() < .10) // draw 2 cards
else // draw one card
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.