public static void Main(string[] args) { int machinePoolSize = 64; MachinePool machinePool = new MachinePool(machinePoolSize); Console.Write("Random free machine IDs while setting them busy: "); while (machinePool.FreeCount() > 0) { int freeMachineId = machinePool.GetRandomFree(); Console.Write(freeMachineId + " "); machinePool.SetBusy(freeMachineId); } Console.WriteLine(); Console.Write("Random free machine IDs while setting machines free in order: "); for (int machineId = 0; machineId < machinePoolSize; machineId++) { machinePool.SetFree(machineId); Console.Write(machinePool.GetRandomFree() + " "); } Console.WriteLine(); }