示例#1
0
        public static void print()
        {
            card c1 = st1.Peek();
            card c2 = st2.Peek();
            card c3 = st3.Peek();
            card c4 = st4.Peek();


            //Console.WriteLine();
            Console.WriteLine("Slot 1 :  " + c1.name);
            // Console.WriteLine();
            Console.WriteLine("Slot 2 :  " + c2.name);
            // Console.WriteLine();
            Console.WriteLine("Slot 3 :  " + c3.name);
            // Console.WriteLine();
            Console.WriteLine("Slot 4 :  " + c4.name);
            Console.WriteLine();


            Console.WriteLine("Points : " + count);
            Console.WriteLine();
            Console.WriteLine("Left : " + list.Count);
            Console.WriteLine();

            Console.WriteLine();
            Console.WriteLine(" Deal Card Press      : 1");
            Console.WriteLine(" Discard Card Press   : 2");
            Console.WriteLine(" Move Card Press      : 3");
            Console.WriteLine(" Play Again Press     : 4");
            Console.WriteLine(" For Exit Press       : 5");
            Console.WriteLine();
            Console.Write("Option : ");
        }
示例#2
0
        public static void dealcard()
        {
            int x, y, z, m;

            x = r.Next(list.Count);           /*Getting r from Random*/
            //Console.WriteLine(list.Count);
            card c1 = list[x];

            st1.Push(c1);
            list.Remove(c1);
            //Console.WriteLine(list.Count);


            y = r.Next(list.Count);

            card c2 = list[y];

            st2.Push(c2);
            list.Remove(c2);



            z = r.Next(list.Count);

            card c3 = list[z];

            st3.Push(c3);
            list.Remove(c3);


            m = r.Next(list.Count);

            card c4 = list[m];

            st4.Push(c4);
            list.Remove(c4);
        }
示例#3
0
        public static void discard()
        {
            int i;

            i = Convert.ToInt32(Console.ReadLine());


            card c1 = st1.Peek();
            card c2 = st2.Peek();
            card c3 = st3.Peek();
            card c4 = st4.Peek();



            if (i == 1)
            {
                if (((c1.type == c2.type) && (c1.value < c2.value)) || ((c1.type == c3.type) && (c1.value < c3.value)) || ((c1.type == c4.type) && (c1.value < c4.value)))
                {
                    st1.Pop();
                    count++;
                }
                else
                {
                }
            }
            else if (i == 2)
            {
                if (((c2.type == c1.type) && (c2.value < c1.value)) || ((c2.type == c3.type) && (c2.value < c3.value)) || ((c2.type == c4.type) && (c2.value < c4.value)))
                {
                    st2.Pop();
                    count++;
                }
                else
                {
                }
            }
            else if (i == 3)
            {
                if (((c3.type == c1.type) && (c3.value < c1.value)) || ((c3.type == c2.type) && (c3.value < c2.value)) || ((c3.type == c4.type) && (c3.value < c4.value)))
                {
                    st3.Pop();
                    count++;
                }
                else
                {
                }
            }
            else if (i == 4)
            {
                if (((c4.type == c1.type) && (c4.value < c1.value)) || ((c4.type == c3.type) && (c4.value < c3.value)) || ((c4.type == c2.type) && (c4.value < c2.value)))
                {
                    st4.Pop();
                    count++;
                }
                else
                {
                }
            }
            else
            {
            }
        }
示例#4
0
        public static void move(int x, int y)
        {
            card c1 = st1.Peek();
            card c2 = st2.Peek();
            card c3 = st3.Peek();
            card c4 = st4.Peek();

            if (y == 1)
            {
                if (c1.type == "n")
                {
                    if (x == 2)
                    {
                        card cs = st2.Pop();
                        st1.Push(cs);
                    }
                    if (x == 3)
                    {
                        card cs = st3.Pop();
                        st1.Push(cs);
                    }
                    if (x == 4)
                    {
                        card cs = st2.Pop();
                        st1.Push(cs);
                    }
                    else
                    {
                    }
                }
            }

            else if (y == 2)
            {
                if (c2.type == "n")
                {
                    if (x == 1)
                    {
                        card cs = st1.Pop();
                        st2.Push(cs);
                    }
                    if (x == 3)
                    {
                        card cs = st3.Pop();
                        st2.Push(cs);
                    }
                    if (x == 4)
                    {
                        card cs = st4.Pop();
                        st2.Push(cs);
                    }
                    else
                    {
                    }
                }
            }

            else if (y == 3)
            {
                if (c3.type == "n")
                {
                    if (x == 2)
                    {
                        card cs = st2.Pop();
                        st3.Push(cs);
                    }
                    if (x == 1)
                    {
                        card cs = st1.Pop();
                        st3.Push(cs);
                    }
                    if (x == 4)
                    {
                        card cs = st4.Pop();
                        st3.Push(cs);
                    }
                    else
                    {
                    }
                }
            }

            else if (y == 4)
            {
                if (c4.type == "n")
                {
                    if (x == 2)
                    {
                        card cs = st2.Pop();
                        st4.Push(cs);
                    }
                    if (x == 1)
                    {
                        card cs = st1.Pop();
                        st4.Push(cs);
                    }
                    if (x == 3)
                    {
                        card cs = st3.Pop();
                        st4.Push(cs);
                    }
                    else
                    {
                    }
                }
            }
            else
            {
            }
        }