Guest User

Untitled

a guest
Nov 6th, 2012
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.72 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5.  
  6. namespace ConsoleApplication1
  7. {
  8.     class Program
  9.     {
  10.         static void Main()
  11.         {
  12.             turn();
  13.             Console.Read();
  14.         }
  15.  
  16.         static int DiceThrow()
  17.         {
  18.             Random rnd = new Random();
  19.             int rolled = rnd.Next(1, 7); //random number from 1 to 6
  20.             return rolled;
  21.             // return int.Parse(Console.ReadLine());
  22.         }
  23.  
  24.         private static void turn()
  25.         {
  26.  
  27.             for (int i = 0; i < 4; i++)
  28.             {
  29.                 int numrolled = DiceThrow();
  30.                 Console.WriteLine(numrolled);
  31.             }
  32.         }
  33.     }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment