static internal int part1() { var pr1 = new Pr(0); var done = false; do { done = pr1.Step(); }while (!done); return(pr1.count); }
static void Main(string[] args) { var pr1 = new Pr(0); var pr2 = new Pr(1); pr1.p = pr2; pr2.p = pr1; do { pr1.Step(); pr2.Step(); }while (!pr1.IsWaiting || !pr2.IsWaiting); Console.WriteLine(pr2.SentValues); Console.ReadKey(); }