# programing drop dead game



## klaibert26 (Aug 15, 2007)

Hi

I am trying to write a code for this game...

this if the output that i am trying to make:

How many dice would you like to play with (5 - 10)? 5
1 4 4 2 5 2 dice are dead this roll. The score for this roll is 9
1 4 2 1 die is dead this roll. The score for this roll is 5
2 2 2 dice are dead this roll. The score for this roll is 0


but i came with this:

How many dice would you like to play with (5 - 10)? 5
1 4 4 2 5 2 dice are dead this roll. The score for this roll is 9
1 4 2 4 6 1 die is dead this roll. The score for this roll is 5
2 2 1 3 3 2 dice are dead this roll. The score for this roll is 0

this is my source:

using System;
using System.Collections.Generic;
using System.Text;

namespace DropDead
{
class DropDead
{
static void Main(string[] args)
{

int inputNumber;

Console.WriteLine("Welcome to the Scorer for Drop Dead");
Console.WriteLine("How many dice would you like to play with (5 - 10)? ");
inputNumber = Convert.ToInt32(Console.ReadLine());

if (inputNumber >= 5 && inputNumber <= 10)
{
int temp = inputNumber;

int[] intArray;
intArray = new int[inputNumber];
Random rand = new Random();
int dead_num = 0;

int sum = 0;

{
do
{

for (int i = 0; i < inputNumber; i++)
{

int j = rand.Next(1, 7);
intArray_ = j;


if (intArray == 2)
{
dead_num = dead_num + 1;
temp = inputNumber - dead_num;


}
else if (intArray == 5)
{
dead_num = dead_num + 1;
temp = inputNumber - dead_num;


}
else
{
sum = sum + intArray;



}

Console.Write(intArray + " ");







}
Console.WriteLine(" " + " " + " " + dead_num + " " + "dice are dead this roll." + " " + "The score for this roll is" + " " + sum);
}

while (temp > 0);


}
}
else
{
Console.WriteLine("please enter a value between 5 to 10");
}
Console.Read();







}

}

}





can anyone help me???_


----------

