Added mozart and a project
This commit is contained in:
30
Die.cs
Normal file
30
Die.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
namespace Mozart
|
||||
{
|
||||
public class Die
|
||||
{
|
||||
Random random = new Random();
|
||||
|
||||
public int sides { get; set; }
|
||||
|
||||
public Die(int sides)
|
||||
{
|
||||
this.sides = sides;
|
||||
}
|
||||
|
||||
public int Throw()
|
||||
{
|
||||
return random.Next(1, sides + 1);
|
||||
}
|
||||
|
||||
public int Throw(int total)
|
||||
{
|
||||
int sum = 0;
|
||||
for (int i = 0; i < total; i++)
|
||||
{
|
||||
sum += Throw();
|
||||
}
|
||||
|
||||
return sum;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user