Esempio n. 1
0
        static void Play(int score)
        {
            Console.WriteLine("Your score is: {0}", score);
            IdCard e = new IdCard(3);

            e.PrintCard();
            Console.WriteLine("Will you serve this customer? y/n ");
            String c    = Console.ReadLine();
            bool   fake = e.CheckFake();

            if (c.Equals("y") || c.Equals("Y"))
            {
                if (fake)
                {
                    Console.WriteLine("You served a fakeID!");
                    YouLoose(score);
                }
            }
            else if (c.Equals("n") || c.Equals("N"))
            {
                if (!fake)
                {
                    Console.Clear();
                    Console.WriteLine("You turned away a valid customer! You lost a point.");
                    score--;
                    if (score < 0)
                    {
                        YouLoose(score);
                    }
                    Play(score);
                }
                else
                {
                    Console.Clear();
                    Console.WriteLine("Great job! That was a Fake ID!");
                    Play(score + 1);
                }
            }
            else
            {
                Console.Clear();
                Console.WriteLine("That's not a valid answer!");
                Play(score);
            }
            Console.Clear();
            Console.WriteLine("TESTING: HOW MANY WORDS DO YOU WANT YOUR DRINK TO HAVE?");
            int words = Convert.ToInt32(Console.ReadLine());

            Console.WriteLine("TESTING: HOW DIFFICULT SHOULD YOUR DRINK BE? 1-20");
            int   diff = Convert.ToInt32(Console.ReadLine());
            Drink d    = new Drink(words, diff);

            Console.WriteLine("The customer asks for a : {0}", d.name);
            DrinkLoop(score, d);


            Console.ReadKey();
        }
Esempio n. 2
0
        static void Main(string[] args)

        {
            Console.WriteLine(String.Format("{0," + Console.WindowWidth / 2 + "}", "Whoah Games Presents..."));
            Console.WriteLine(String.Format("{0," + Console.WindowWidth / 2 + "0}", " "));
            Console.BackgroundColor = ConsoleColor.Blue;
            Console.ForegroundColor = ConsoleColor.White;
            Console.Write("\t\t\t\t\tUH\n\n\n\n\n\t\t\t\tOH\n\n\n\n\n\n\n\t\t\t\t\t BARTENDER");
            Console.ResetColor();
            Console.WriteLine(String.Format("{0," + Console.WindowWidth / 2 + "}", "\n\n\n\n\nPress any key to continue"));
            Console.ReadKey();
            Console.Clear();
            Console.WriteLine("Please enter your game choice.\n1. Play the game\n2. Test Drink Generation\n3. Test ID Generation");
            int ingChoice = Convert.ToInt32(Console.ReadLine());

            switch (ingChoice)
            {
            case 1:
                Play(0);
                break;

            case 2:
                Drink d = new Drink(1, 3);
                MakeABunchOfDrink(d);
                break;

            case 3:
                IdCard c = new IdCard(3);
                MakeABunchOfID(c);
                break;

            default:
                Console.WriteLine("-nvalid answer.");
                Console.ReadKey();
                break;
            }
        }
Esempio n. 3
0
        static void MakeABunchOfID(IdCard c)
        {
            Console.WriteLine("Welcome to the ID generation tester.");
            Console.WriteLine("Here are your current ID percentages");
            Console.WriteLine("1. Chance for expired ID : {0}", c.CHANCEFOREXPIRED);
            Console.WriteLine("2. Chance for the ID to be generated without a seal: {0}", c.CHANCEFORSEAL);
            Console.WriteLine("3. Chance for the state name to get mixed up: {0}", c.CHANCEFORSTATE);
            Console.WriteLine("4. Chance for the customer to be under Drinking Age: {0}", c.CHANCEFORUNDERAGE);
            Console.WriteLine("5. Drinking age is: {0}", c.DRINKINGAGE);
            Console.WriteLine("Please select an option to change its percent value. Chance is represented as chance/100, so setting to 50 will make it a 50% chance.");
            Console.WriteLine("Please enter 6 to proceed with generation.");
            int choice = Convert.ToInt32(Console.ReadLine());
            int val    = 0;

            if (choice > 0 && choice < 6)
            {
                Console.WriteLine("Please write the percent value you would like to change it to");
                val = Convert.ToInt32(Console.ReadLine());
            }

            switch (choice)
            {
            case 1:
                c.CHANCEFOREXPIRED = val;
                break;

            case 2:
                c.CHANCEFORSEAL = val;
                break;

            case 3:
                c.CHANCEFORSTATE = val;
                break;

            case 4:
                c.CHANCEFORUNDERAGE = val;
                break;

            case 5:
                c.DRINKINGAGE = val;
                break;

            case 6:
                String stop = "";
                Console.WriteLine("Please enter a difficulty value");
                int words = Convert.ToInt32(Console.ReadLine());
                c.difficulty = words;
                while (!stop.Equals("stop"))
                {
                    c.Reinitialize();
                    Thread.Sleep(300);
                    Console.WriteLine("Generating ID card. Type \"stop\" to end and go edit percents, otherwise press any key and enter to continue. Type \"check\" to see if ID is valid or not.");
                    c.PrintCard();
                    stop = Console.ReadLine();

                    stop = stop.ToLower();
                    if (stop.Equals("check"))
                    {
                        Console.WriteLine("Is ID fake: {0}", c.GetFake());
                    }
                }
                break;
            }
            Console.Clear();
            Console.WriteLine("Change confirmed");
            MakeABunchOfID(c);
        }