Пример #1
0
        public static void winSequence(string name, string type, Data1 esx)
        {
            if (rank == 1)
            {
                Console.WriteLine("Admin: Well, " + name + " and you have proved your competence to work as a team. Congratulations, you have earned a place at Ching Technologies. You have earned the position of " + getJob(rank) + ". Would you like to try again with someone else and attempt to achieve a higher rank? I will let you know it will be more difficult.");
            }
            else if (rank == 2)
            {
                Console.WriteLine("Admin: Well, " + name + " and you've proven yourself once again. You have earned the position of " + getJob(rank) + ". Would you like to try again to secure an even better position?");
            }
            else if (rank == 3)
            {
                Console.WriteLine("Admin: Wow, you've really climbed up the ladders and have secured the position of " + getJob(rank) + "! Well done, we will definitely prosper under your leadership! Make yourself at home!");
                exitSequence();
            }
            string wants2TryAgain = Console.ReadLine();

            if (wants2TryAgain == "Yes" || wants2TryAgain == "yes")
            {
                tryAgain(name, type, esx);
            }
            else
            {
                Console.WriteLine("Alright, have fun with your position as " + getJob(rank) + "!");
            }
        }
Пример #2
0
        public sofDev(string name, string type, Data1 esx)
        {
            int  accuracy = Intro(60, 80, name, type, esx);
            bool didWin   = Tools.hasWonGame(accuracy);

            hasBeenDone = true;
            if (didWin)
            {
                Tools.winSequence(name, type, esx);
            }
            else
            {
                Tools.loseSequence(name);
            }
        }
Пример #3
0
        public gameDev(string name, string type, Data1 esx)
        {
            int  accuracy = Intro(0, 20, name, type, esx);
            bool didWin   = Tools.hasWonGame(accuracy);

            hasBeenDone = true;

            if (didWin)
            {
                Console.WriteLine("*Admin enters*");
                Tools.winSequence(name, type, esx);
            }
            else
            {
                Tools.loseSequence(name);
            }
        }
Пример #4
0
        public static void tryAgain(string nameDone, string typeDone, Data1 esx)
        {
            rank++;
            string name2 = "";

            if (rank == 2)
            { // if 2 of them are left
                Console.WriteLine("So which person would you like to choose next? " + esx.names[0] + " or " + esx.names[1] + "?");
                name2 = Console.ReadLine();
            }
            else if (rank == 3)   // if only one of them is left
            {
                Console.WriteLine("Well, you only have " + esx.names[0] + " left.");
                name2 = esx.names[0];
            }

            esx.names.Remove(name2);
            string type2 = "";

            if (rank == 1)
            {
                Console.WriteLine("And so which one do you think " + name2 + " does? " + esx.types[0] + " or " + esx.types[1] + "?");
                type2 = Console.ReadLine();
            }
            else if (rank == 2)
            {
                Console.WriteLine("And the only thing he could be doing is " + esx.types[0] + ".");
                type2 = esx.types[0];
            }
            System.Tuple <int, int> numRange = getNumRange(type2);
            int accuracy2 = thing(name2, type2, numRange.Item1, numRange.Item2);

            esx.types.Remove(type2);
            if (accuracy2 == 3) // Win sequence is executed again
            {
                winSequence(nameDone, typeDone, esx);
            }
            else
            {
                loseSequence(nameDone);
            }
        }
Пример #5
0
        public static int Intro(int lower, int higher, string name, string type, Data1 esx)
        {
            string devType  = type;
            int    accuracy = 0;


            Console.WriteLine("Correct! You're a lucky one, eh.");
            Thread.Sleep(2000);
            Tools.getNumRange(type);
            Console.WriteLine("Since you chose " + name + ", and got " + type + ", you can choose numbers from " + lower + "-" + higher + ". You will now be asked to enter in a number");
            int[]     insertedLuckyNum = new int[5];
            ArrayList insLuckyNum      = new ArrayList();

            try
            {
                for (int i = 0; i < 5; i++)
                {
                    Console.Write("Please enter a number: ");
                    insertedLuckyNum[i] = Convert.ToInt32(Console.ReadLine());
                    insLuckyNum.Add(insertedLuckyNum[i]);
                }
            }
            catch {
                Tools.destroyInterview();
            }
            Console.WriteLine("Okay, now your partner, " + name + ", will have to guess one of the numbers right. They have 3 chances. " + name + " has chosen...");
            // User actually has very high chance of winning
            Random chance  = new Random();
            int    rChance = chance.Next(0, 100);
            Random corVal  = new Random();

            corVal.Next(0, 4);


            Random rGuess = new Random();

            int ii = 1;

            while (ii > 0 && ii <= 3)
            {
                int  guess   = insertedLuckyNum[0];
                bool isArray = true;
                if (rChance == 56)
                {
                    while (isArray && guess >= lower && guess <= higher)
                    {
                        if (guess == insertedLuckyNum[0] || guess == insertedLuckyNum[1] || guess == insertedLuckyNum[2] || guess == insertedLuckyNum[3] || guess == insertedLuckyNum[4])
                        {
                            guess = rGuess.Next(lower, higher);
                        }
                        else
                        {
                            isArray = false;
                        }
                    }
                    Thread.Sleep(3000);
                    Console.WriteLine(name + ": I think I will choose " + guess);
                    Thread.Sleep(2000);
                    Console.WriteLine("Oh wow, they guessed it wrong!");
                    Thread.Sleep(2000);
                    accuracy--;
                }
                else
                {
                    int randGuess = corVal.Next(insLuckyNum.Count);
                    guess = Convert.ToInt32(insLuckyNum[randGuess]);
                    insLuckyNum.RemoveAt(randGuess);
                    Thread.Sleep(3000);
                    Console.WriteLine(name + ": I think I will choose " + guess);
                    Thread.Sleep(4000);
                    Console.WriteLine("Oh wow, they guessed it right!");
                    Thread.Sleep(4000);
                    accuracy++;
                }
                ii++;
            }
            Console.WriteLine("They got " + accuracy + " right!");

            return(accuracy);
        }
        static void Main(string[] args)
        { //Introduction
            //  ArrayList types = new ArrayList();
            //ArrayList names = new ArrayList();
            Data1 esx   = new Data1();
            Tools tools = new Tools();

            Tools.increase();
            Console.WriteLine("Welcome to the game user. This is a roleplay luck-based game. You'll see where the luck part comes in later.");
            Thread.Sleep(6000);
            Console.Write("You've finally woken up. ");
            Thread.Sleep(1000);
            Console.Write("Finally.");
            Thread.Sleep(3000);
            Console.WriteLine(" You're applying to Ching technologies.");
            Thread.Sleep(2000);
            Console.WriteLine("The interview will commence soon. ");
            Thread.Sleep(4000);
            Console.WriteLine("Good luck.");
            Thread.Sleep(2000);
            Console.WriteLine("Admin: You're applying to Ching Techonologies as well?");
            Thread.Sleep(3000);
            Console.WriteLine("Admin: Hmm. Cool. Lets see if you can answer some basic questions.");
            Thread.Sleep(2000);
            Console.WriteLine("Admin: You answer one question stupidly and you're out.");
            Thread.Sleep(5000);
            Console.WriteLine("Admin: So whats your name?");
            string name = Console.ReadLine();

            Console.WriteLine("Admin: Well, hi " + name + ", they told me you were gonna arrive soon. What's your SECOND name?");
            string secName = Console.ReadLine();

            Console.WriteLine("Admin: Cool name.");
            Thread.Sleep(3000);
            string shorName = string.Concat(Tools.convertTo2Chars(name, secName, 0, 0));

            Console.WriteLine("Admin: Hope you don't mind me just calling you " + shorName + ". I just don't like wasting time saying peoples names.");
            Thread.Sleep(3000);
            // Not entering numbers exception handling
            try
            {
                Console.WriteLine("Admin: So when were you born, " + shorName + "? (Write in DDMMYYYY format)");
                string birthDate    = Console.ReadLine();
                int    birthDateNum = Convert.ToInt32(birthDate);
                string monthborn    = Tools.convertToMonth(Convert.ToInt32((Tools.convertTo2Chars1W(birthDate, 2, 3))));
                Console.WriteLine("Admin: So you were born in " + monthborn + "? Same as me.");
                Thread.Sleep(3000);
            }
            catch {
                Tools.destroyInterview();
            }
            Console.WriteLine("Admin: You think you're good enough to be a developer?");
            string isDev = Console.ReadLine();

            if (isDev == "Yes" || isDev == "yes" || isDev == "Yeah" || isDev == "yeah" || isDev == "yuh")
            {
                Console.WriteLine("Admin: Huh, good to see some confidence from you," + shorName + ". Let's see if you're actually good enough.");
                Thread.Sleep(2000);
            }
            else if (isDev == "No" || isDev == "no")
            {
                Tools.destroyInterview();
            }
            Console.WriteLine("*door opens*");
            Thread.Sleep(3000);
            Console.WriteLine("Admin: Oh, thats Uand, Reda and Khaban, the controllers. Ones a web developer, ones a game developer and the other is a software developer.");
            Thread.Sleep(5000);
            Console.WriteLine("Admin: This is where your task is introduced " + shorName + ".");
            Thread.Sleep(3000);
            Console.WriteLine("*Admin leaves*");
            // User doesn't actually have to guess the right profession for the right person.
            Thread.Sleep(1000);
            Console.WriteLine("System: You choose one person out of Uand, Reda and Khaban. You will then have to guess which one is their profession. You have to get lucky when guessing which kind of developer they are. You will not be tested on your ability to code and make programs but rather your competence and your ability to work with others.");
            Thread.Sleep(8000);
            Console.WriteLine("System: Once you choose one of them and their right profession, you will be asked to think of 5 different numbers between a certain range. The partner you've chosen will have to guess right 3 times. The more answers your partner guesses right increases your chances of being accepted.");
            Thread.Sleep(5000);
            Console.WriteLine("System: Which one would you like to pick? Uand, Reda or Khaban?");
            string chosen1 = Console.ReadLine();

            Console.WriteLine("System: What kind of development do you think " + chosen1 + " does? Web, software or game development? (You can just enter \"Web\" or \"Game\" or \"Soft\")."); // Using \ lets you include "" in the string without messing it up. (Because string are defined with whatever goes inside the "").
            string ctype  = Console.ReadLine();
            string c1type = Tools.getType(ctype);

            System.Tuple <int, int> range = Tools.getNumRange(c1type);
            esx.names.Remove(chosen1);
            esx.types.Remove(c1type);
            // Decides which one to use
            // User will choose numbers based on a certain range, the certain range changes depending on the type of development User chose.
            if (c1type == "Software Development")
            {
                sofDev SD = new sofDev(chosen1, c1type, esx);
            }
            else if (c1type == "Web Development")
            {
                webDev WD = new webDev(chosen1, c1type, esx);
            }
            else if (c1type == "Game Development")
            {
                gameDev GD = new gameDev(chosen1, c1type, esx);
            }
            else
            {
                Tools.destroyInterview();
            }

            Console.ReadLine();
        }