using System;
public class fairdice
{
private int last = 5;
private Random rnd = new Random();
public int rndseed;
public int seed(int s){
rndseed = s;
return rndseed;
}
public int Next(){
int x;
if ( last == 6){
x = rnd.Next(1,3);
else if ( last == 1 ){
x = rnd.Next(5,7);
else {
x = rnd.Next(1,7);
last = x;
return x;
public class Program
public static void Main()
int s = 5;
fairdice rnd = new fairdice(fairdice.seed(s));
for(int i = 0; i < 100 ; i++){
Console.WriteLine(rnd.Next());