If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Re: Simple (to some) dice game

Your PairOfDice objects have the exposed methods int SumOfFaces(), void Roll() and bool isDoubles(). You can use these to carry out all the needed functions. For example, to "roll the dice" you can call their roll method:

Code:

pair1.Roll(); //Role the first pair of dice

You can check if both pairs have rolled doubles by:

Code:

if( pair1.isDoubles() && pair2.isDoubles() )
{
//Do something
}

You can check to see if the sum of pair1 exceeds the sum of pair2 like:

Code:

if( pair1.SumOfFaces() > pair2.SumOfFaces() )
{
//Do something
}

And, to display them, you can usually set a label (or textbox) by doing something like:

Code:

dice1Label.Text = (pair1.SumOfFaces()).ToString();

This isn't a complete solution, but I think these examples should let you carry out the other tasks you need to accomplish.

Minor point: In your PairOfDice class you are missing the closing brackets of isDoubles.

Best Regards,

BioPhysEngrhttp://blog.biophysengr.net
--
All advice is offered in good faith only. You are ultimately responsible for effects of your programs and the integrity of the machines they run on.

* The Perfect Platform for Game Developers: Android
Developing rich, high performance Android games from the ground up is a daunting task. Intel has provided Android developers with a number of tools that can be leveraged by Android game developers.

* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.