Beispiel #1
0
        public StoneStack Copy()
        {
            var ret = new StoneStack();

            foreach (var item in this)
            {
                ret.Push(item);
            }
            return(ret);
        }
Beispiel #2
0
        public StoneStack SplitStack(int take)
        {
            var tempStack = new StoneStack();

            for (int i = 0; i < take; i++)
            {
                tempStack.Push(Pop());
            }

            var newStack = new StoneStack();

            for (int i = 0; i < take; i++)
            {
                newStack.Push(tempStack.Pop());
            }

            return(newStack);
        }