예제 #1
0
        static void Main(string[] args)
        {
            GumballStateMachine machine = new GumballStateMachine(2);

            machine.insertQuarter();
            machine.turnCrank();
            machine.insertQuarter();
            machine.ejectQuarter();
            machine.insertQuarter();
            machine.insertQuarter();
            machine.turnCrank();
            machine.insertQuarter();
            machine.turnCrank();
            machine.refill();
            machine.insertQuarter();
            machine.turnCrank();
            machine.insertQuarter();
            machine.ejectQuarter();
            machine.insertQuarter();
            machine.insertQuarter();
            machine.turnCrank();

            System.Console.ReadLine();
        }
예제 #2
0
 public NoQuarter(GumballStateMachine gsm)
 {
     machine = gsm;
 }
예제 #3
0
 public Sold(GumballStateMachine gsm)
 {
     machine = gsm;
 }