Minggu, 26 Mei 2013

Console Random Number 1-6...!!!

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

namespace RandomNumber
{
    class Program
    {
           static void Main()
           {
                  Random();
                  Random();
                  Random();
                  Random();
                  Random();
                  Random();

           }

           static Random MyRandom = new Random();
           static void R()
           {
                  for(int i = 0; i < 600; i++)
                  {
                         double value;
                         double n = 0.5 + MyRandom.NextDouble() * 6.0-0.5;
                         value = Math.Round(n);
                         Console.WriteLine(value);
                   }
                   Console.ReadLine();
            }
     }
}

Tidak ada komentar:

Posting Komentar