Cosmos/source/Cosmos.Shell.Guess/Random.cs
mterwoord_cp 1af29eea10
2008-06-04 15:47:10 +00:00

29 lines
649 B
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Cosmos.Shell.Guess
{
/// <summary>
/// Uses nasty security holed pointer logic to get the next
/// value. This is our PRNG
/// </summary>
public unsafe class Random
{
private int val;
public Random()
{
int max = Hardware.RTC.GetHours();
max *= (int)Hardware.RTC.GetMinutes();
max *= (int)Hardware.RTC.GetSeconds();
val = (max / 432);
}
public int Next()
{
return val;
}
}
}