i want to make a little game in C# / WPF
i made a label in which i want to display a random number of " | "s between 21 and 35.
String content;
String sign= "|";
Random randomNumber = new Random();
int iRandom = randomNumber.Next(21, 35);
for (int i = 0, i = iRandom, i++)
content = content.add(dunno..
label1.Content = "iRandom";
so what i want to get as result is for example a row of 27 I's like this: ||||||||||||||||||||||||||||||||||||||
after that, the player can choose to remove 1, 2 or 3 of these lines.. i made a small switch but it doesn work either
void Decrease(int& iRandom, int iNumber)// function decrease by player, iNumber is an int thats chosen by the player, iRandom is the random list of I's.
{
switch(iNumber)
{
case 1: iRandom -= 1;
break;
case 2: iRandom -= 2;
break;
case 3: iRandom -= 3;
break;
}
can anyone help me fix this??
grtzz
This post has been edited by JackOfAllTrades: 09 March 2010 - 06:23 AM
Reason for edit:: Added code tags. PLEASE!!! [code]...PUT YOUR CODE IN HERE...[/code]

New Topic/Question
Reply




MultiQuote








|