Hi
I have a problem with dice game.
So I have a dice game , but I want to see the picture of the dice every time the player throws the dice not only the number..
I dont know how to make it, do I need to rewrite the random function? Or i can keep it and write there something like if dice number=1 then console.writeline picture?
Anyway here is the code I hope someone can help me :) and sorry for my bad English.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace DiceGame
{
class Program
{
static void Main(string[] args)
{Random r = new Random();
int points1 = 0, points2 = 0;
int game1 = 0, game2 = 0, number = 0;
do
{
Console.Clear();
Console.WriteLine("Player 1:");
for (int i = 0; i < 4; i++)
{
number = r.Next(1, 7);
Console.WriteLine(number);
game1 += number;
}
Console.WriteLine("=" + game1.ToString() + "\n");
Console.WriteLine("Player 2:");
for (int i = 0; i < 4; i++)
{
number = r.Next(1, 7);
Console.WriteLine(number);
game2 += number;
}
Console.WriteLine("=" + game2.ToString() + "\n");
if (game1 > game2)
{
Console.WriteLine("Player 1 wins");
points1++;
}
else
{
Console.WriteLine("Player 2 wins");
points2++;
}
Console.WriteLine("Player 1: " + points1.ToString() + " Player 2: " + points2.ToString());
Console.WriteLine("Write: 'end' to quit the game, everything else to continue.");
} while (!(Console.ReadLine().ToLower() == "end"));
Console.Clear();
Console.WriteLine("Player 1: " + points1.ToString() + " Player 2: " + points2.ToString());
Console.WriteLine(((points1 > points2) ? "Player 1 wins'" : "Player 2 wins!") + " Congratulations!");
}
}
}