Exemple #1
0
        public static async Task Main()
        {
            global glob;

            glob.food   = 0;
            glob.money  = 10000;
            glob.plantc = 0;

            int plantcount = 9;

            IPlant[] plantnew1 = new plant1[plantcount];
            IPlant[] plantnew2 = new plant2[plantcount];
            IPlant[] plantnew3 = new plant3[plantcount];

            for (int i = 0; i < 9; i++)
            {
                plantnew1[i] = new plant1();
                plantnew2[i] = new plant2();
                plantnew3[i] = new plant3();
            }

            Thread t1 = (new Thread(() =>
            {
                while (true)
                {
                    for (int i = 0; i < 9; i++)
                    {
                        if (plantnew1[i].har() == true)
                        {
                            globals.plant1coun = i;
                        }
                        if (plantnew2[i].har() == true)
                        {
                            globals.plant2coun = i;
                        }
                        if (plantnew3[i].har() == true)
                        {
                            globals.plant3coun = i;
                        }
                    }
                }
            })); t1.Start();

            _ = Task.Delay(60000).ContinueWith(_ =>
            {
                globals.i++;
                PostMessage(ConsoleWindowHnd, WM_KEYDOWN, VK_RETURN, 0);
                lock (globals.seclocking)
                {
                    lock (globals.locking)
                    {
                        globals.i--;
                        Console.WriteLine("The day is Over!");
                        Console.WriteLine("1. Harvest");

                        int inx = 99;
                        while (inx == 99)
                        {
                            inx = globals.read();
                        }

                        if (inx == 1)
                        {
                            int originalfood = glob.food;
                            for (int coun = 0; coun < 9; coun++)
                            {
                                if (plantnew1[coun].ready() == true)
                                {
                                    glob.food += plantnew1[coun].worth();
                                    plantnew1[coun].harvest();
                                }
                                if (plantnew2[coun].ready() == true)
                                {
                                    glob.food += plantnew2[coun].worth();
                                    plantnew2[coun].harvest();
                                }
                                if (plantnew3[coun].ready() == true)
                                {
                                    glob.food += plantnew3[coun].worth();
                                    plantnew3[coun].harvest();
                                }
                            }
                            int finalgain = glob.food - originalfood;
                            Console.WriteLine("All plants have been harvested! You gained " + finalgain + " food");
                        }

                        glob.food = farmer.check(glob.food);
                        if (farmer.alive() == false)
                        {
                            Console.WriteLine("uh oh! your farmer has died! Game over!");
                            while (true)
                            {
                                //infinite loop bc famer ded
                            }
                        }
                        else
                        {
                            globals.repeat++;
                            int lives = farmer.checkliv();
                            Console.WriteLine("Congraluations! You survived day " + globals.days + " !, your farmer still has " + lives + "lives left");
                            globals.days++;
                        }
                        farmer.livecalc();
                    }
                }
            });

            Console.WriteLine("Welcome to the Farming game! To get started, choose an option.");
start:
            Console.WriteLine("1. Seed");
            Console.WriteLine("2. Harvest");
            Console.WriteLine("3. Go to market");
            Console.WriteLine("4. View Plants");
            Console.WriteLine("(To make a selection, input the coresponding number)");

            int inp = 99;

            while (inp == 99)
            {
                lock (globals.locking)
                {
                    if (globals.repeat == 1)
                    {
                        Console.WriteLine("1. Seed");
                        Console.WriteLine("2. Harvest");
                        Console.WriteLine("3. Go to market");
                        Console.WriteLine("4. View Plants");
                        Console.WriteLine("(To make a selection, input the coresponding number)");
                        globals.repeat--;
                    }
                    else if (globals.rep == 1)
                    {
                        Console.WriteLine("1. Seed");
                        Console.WriteLine("2. Harvest");
                        Console.WriteLine("3. Go to market");
                        Console.WriteLine("4. View Plants");
                        Console.WriteLine("(To make a selection, input the coresponding number)");
                        globals.rep--;
                    }
                    inp = globals.read();
                }
                await Task.Delay(5);
            }

            switch (inp)
            {
            case 1:


                int i = 0;
                while (i == 0)
                {
                    Console.WriteLine("Which plant would you like to seed?");
                    Console.WriteLine("1. plant1");
                    Console.WriteLine("2. plant2");
                    Console.WriteLine("3. plant3");
                    Console.WriteLine("4. return to main menu");

                    int inp1 = 99;
                    while (inp1 == 99)
                    {
                        lock (globals.locking)
                        {
                            if (globals.repeat == 1)
                            {
                                Console.WriteLine("Which plant would you like to seed?");
                                Console.WriteLine("1. plant1");
                                Console.WriteLine("2. plant2");
                                Console.WriteLine("3. plant3");
                                Console.WriteLine("4. return to main menu");
                                globals.repeat--;
                            }
                            else if (globals.rep == 1)
                            {
                                Console.WriteLine("Which plant would you like to seed?");
                                Console.WriteLine("1. plant1");
                                Console.WriteLine("2. plant2");
                                Console.WriteLine("3. plant3");
                                Console.WriteLine("4. return to main menu");
                                globals.rep--;
                            }
                            inp1 = globals.read();
                        }
                        await Task.Delay(5);
                    }

                    switch (inp1)
                    {
                    case 1:
                        if (globals.plotleft != 0)
                        {
                            Console.WriteLine("the plant number for plant1 is " + globals.plant1coun);
                            int rand1 = rand();
                            plantnew1[globals.plant1coun].needwater(rand1);
                            plantnew1[globals.plant1coun].set();
                            globals.plotleft--;
                            Console.WriteLine("plant1 has been seeded! You have" + globals.plotleft + "plots left");
                            i++;
                            break;
                        }
                        else
                        {
                            Console.WriteLine("You have used up all your plots!");
                        }
                        break;

                    case 2:
                        if (glob.plantc == 1 || glob.plantc == 3 && globals.plotleft != 0)
                        {
                            Console.WriteLine("the plant number for plant2 is " + globals.plant1coun);
                            int rand2 = rand();
                            plantnew2[globals.plant2coun].needwater(rand2);
                            plantnew2[globals.plant1coun].set();
                            globals.plotleft--;
                            Console.WriteLine("plant1 has been seeded! You have" + globals.plotleft + "plots left");
                            i++;
                            break;
                        }
                        if (glob.plantc == 0)
                        {
                            Console.WriteLine("You haven't unlocked this plant yet!");
                        }
                        if (globals.plotleft == 0)
                        {
                            Console.WriteLine("You have used up all your plots!");
                        }
                        break;

                    case 3:
                        if (glob.plantc == 2 || glob.plantc == 3 && globals.plotleft != 0)
                        {
                            Console.WriteLine("the plant number for plant3 is " + globals.plant1coun);
                            int rand3 = rand();
                            plantnew3[globals.plant3coun].needwater(rand3);
                            plantnew3[globals.plant1coun].set();
                            globals.plotleft--;
                            Console.WriteLine("plant1 has been seeded! You have" + globals.plotleft + "plots left");
                            i++;
                            break;
                        }
                        if (glob.plantc == 1 || glob.plantc == 0)
                        {
                            Console.WriteLine("You haven't unlocked this plant yet!");
                        }
                        if (globals.plotleft == 0)
                        {
                            Console.WriteLine("You have used up all your plots!");
                        }
                        break;

                    case 4:
                        goto start;

                    default:
                        Console.WriteLine("Invalid input, try again.");
                        break;
                    }
                }
                break;

            case 2:
                for (int coun = 0; coun < 9; coun++)
                {
                    if (plantnew1[coun].ready() == true)
                    {
                        while (true)
                        {
                            Console.WriteLine(plantnew1[coun].name() + " is ready to harvest! Would you like to harvest?");
                            Console.WriteLine("1. Yes");
                            Console.WriteLine("2. Return to main menu");

                            int inp2 = 99;
                            while (inp2 == 99)
                            {
                                lock (globals.locking)
                                {
                                    if (globals.repeat == 1)
                                    {
                                        Console.WriteLine("1. Yes");
                                        Console.WriteLine("2. Return to main menu");
                                        globals.repeat--;
                                    }
                                    else if (globals.rep == 1)
                                    {
                                        Console.WriteLine("1. Yes");
                                        Console.WriteLine("2. Return to main menu");
                                        globals.rep--;
                                    }
                                    inp2 = globals.read();
                                }
                                await Task.Delay(5);
                            }

                            if (inp2 == 1)
                            {
                                glob.food += plantnew1[coun].worth();
                                plantnew1[coun].harvest();
                                break;
                            }
                            else if (inp2 == 2)
                            {
                                goto start;
                            }
                            else
                            {
                                Console.WriteLine("Invalid input");
                            }
                        }
                    }
                    if (plantnew2[coun].ready() == true)
                    {
                        while (true)
                        {
                            Console.WriteLine(plantnew2[coun].name() + " is ready to harvest! Would you like to harvest?");
                            Console.WriteLine("1. Yes");
                            Console.WriteLine("2. Return to main menu");

                            int inp3 = 99;
                            while (inp3 == 99)
                            {
                                lock (globals.locking)
                                {
                                    if (globals.repeat == 1)
                                    {
                                        Console.WriteLine("1. Yes");
                                        Console.WriteLine("2. Return to main menu");
                                        globals.repeat--;
                                    }
                                    else if (globals.rep == 1)
                                    {
                                        Console.WriteLine("1. Yes");
                                        Console.WriteLine("2. Return to main menu");
                                        globals.rep--;
                                    }
                                    inp3 = globals.read();
                                }
                                await Task.Delay(5);
                            }

                            if (inp3 == 1)
                            {
                                glob.food += plantnew2[coun].worth();
                                plantnew2[coun].harvest();
                                break;
                            }
                            else if (inp3 == 2)
                            {
                                goto start;
                            }
                            else
                            {
                                Console.WriteLine("Invalid input");
                            }
                        }
                    }
                    if (plantnew3[coun].ready() == true)
                    {
                        while (true)
                        {
                            Console.WriteLine(plantnew3[coun].name() + " is ready to harvest! Would you like to harvest?");
                            Console.WriteLine("1. Yes");
                            Console.WriteLine("2. Return to main menu");

                            int inp4 = 99;
                            while (inp4 == 99)
                            {
                                lock (globals.locking)
                                {
                                    if (globals.repeat == 1)
                                    {
                                        Console.WriteLine("1. Yes");
                                        Console.WriteLine("2. Return to main menu");
                                        globals.repeat--;
                                    }
                                    else if (globals.rep == 1)
                                    {
                                        Console.WriteLine("1. Yes");
                                        Console.WriteLine("2. Return to main menu");
                                        globals.rep--;
                                    }
                                    inp4 = globals.read();
                                }
                                await Task.Delay(5);
                            }

                            if (inp4 == 1)
                            {
                                glob.food += plantnew3[coun].worth();
                                plantnew3[coun].harvest();
                                break;
                            }
                            else if (inp4 == 2)
                            {
                                goto start;
                            }
                            else
                            {
                                Console.WriteLine("Invalid input");
                            }
                        }
                    }
                }
                Console.WriteLine("nothing is ready to harvest yet!");
                break;

            case 3:
                Console.WriteLine("Welcome to the market!");
                Console.WriteLine("1. sell food");
                Console.WriteLine("2. buy plant");
                Console.WriteLine("3. buy levels");
                Console.WriteLine("4. Return to main menu");

                int inp5 = 99;
                while (inp5 == 99)
                {
                    lock (globals.locking)
                    {
                        if (globals.repeat == 1)
                        {
                            Console.WriteLine("Welcome to the market!");
                            Console.WriteLine("1. sell food");
                            Console.WriteLine("2. buy plant");
                            Console.WriteLine("3. buy levels");
                            Console.WriteLine("4. Return to main menu");
                            globals.repeat--;
                        }
                        else if (globals.rep == 1)
                        {
                            Console.WriteLine("Welcome to the market!");
                            Console.WriteLine("1. sell food");
                            Console.WriteLine("2. buy plant");
                            Console.WriteLine("3. buy levels");
                            Console.WriteLine("4. Return to main menu");
                            globals.rep--;
                        }
                        inp5 = globals.read();
                    }
                    await Task.Delay(5);
                }

                switch (inp5)
                {
                case 1:
                    Console.WriteLine("How much food would you like to sell? (10 food = $1 Minimum)");

                    int inp6 = 99;
                    while (inp6 == 99)
                    {
                        lock (globals.locking)
                        {
                            if (globals.repeat == 1)
                            {
                                Console.WriteLine("How much food would you like to sell? (10 food = $1 Minimum)");
                                globals.repeat--;
                            }
                            else if (globals.rep == 1)
                            {
                                Console.WriteLine("How much food would you like to sell? (10 food = $1 Minimum)");
                                globals.rep--;
                            }
                            inp6 = globals.read();
                        }
                        await Task.Delay(5);
                    }

                    if (inp6 >= 10 && inp6 <= glob.food)
                    {
                        glob.food -= inp6;
                        double value = Convert.ToDouble(inp6);
                        glob.money += value / 10;
                        Console.WriteLine("Congratuations! you now have $" + glob.money);
                    }
                    else
                    {
                        Console.WriteLine("Invalid input or insufficient funds");
                        goto start;
                    }
                    break;

                case 2:
                    Console.WriteLine("Which plant would you like to purchase?");
                    Console.WriteLine("1. plant2");
                    Console.WriteLine("2. plant3");

                    int inp7 = 99;
                    while (inp7 == 99)
                    {
                        lock (globals.locking)
                        {
                            if (globals.repeat == 1)
                            {
                                Console.WriteLine("Which plant would you like to purchase?");
                                Console.WriteLine("1. plant2");
                                Console.WriteLine("2. plant3");
                                globals.repeat--;
                            }
                            else if (globals.rep == 1)
                            {
                                Console.WriteLine("Which plant would you like to purchase?");
                                Console.WriteLine("1. plant2");
                                Console.WriteLine("2. plant3");
                                globals.rep--;
                            }
                            inp7 = globals.read();
                        }
                        await Task.Delay(5);
                    }

                    if (glob.plantc == 0 && inp7 == 1)
                    {
                        double a = glob.money;
                        glob.money = market.buyplant2(glob.money);
                        if (glob.money != a)
                        {
                            glob.plantc++;
                        }
                    }
                    else if (glob.plantc == 1 && inp7 == 2 || glob.plantc == 0 && inp7 == 2)
                    {
                        double b = glob.money;
                        glob.money = market.buyplant3(glob.money);
                        if (glob.money != b)
                        {
                            glob.plantc += 2;
                        }
                    }
                    else
                    {
                        Console.WriteLine("Invalid option");
                        goto start;
                    }
                    break;

                case 3:
                    Console.WriteLine("for what plant would you like to buy levels for?");
                    Console.WriteLine("1. plant1");
                    Console.WriteLine("2. plant2");
                    Console.WriteLine("3. plant3");

                    int inp8 = 99;
                    while (inp8 == 99)
                    {
                        lock (globals.locking)
                        {
                            if (globals.repeat == 1)
                            {
                                Console.WriteLine("for what plant would you like to buy levels for?");
                                Console.WriteLine("1. plant1");
                                Console.WriteLine("2. plant2");
                                Console.WriteLine("3. plant3");
                                globals.repeat--;
                            }
                            else if (globals.rep == 1)
                            {
                                Console.WriteLine("for what plant would you like to buy levels for?");
                                Console.WriteLine("1. plant1");
                                Console.WriteLine("2. plant2");
                                Console.WriteLine("3. plant3");
                                globals.rep--;
                            }
                            inp8 = globals.read();
                        }
                        await Task.Delay(5);
                    }

                    if (inp8 == 1)
                    {
                        double cec = glob.money;
                        Console.WriteLine("how many levels would you like to buy?");

                        int inp9 = 99;
                        while (inp9 == 99)
                        {
                            lock (globals.locking)
                            {
                                if (globals.repeat == 1)
                                {
                                    Console.WriteLine("how many levels would you like to buy?");
                                    globals.repeat--;
                                }
                                else if (globals.rep == 1)
                                {
                                    Console.WriteLine("how many levels would you like to buy?");
                                    globals.rep--;
                                }
                                inp9 = globals.read();
                            }
                            await Task.Delay(5);
                        }

                        glob.money = market.upgrade1(glob.money, inp9);

                        if (glob.money != cec)
                        {
                            plant1.addfood(inp9);
                        }
                    }
                    else if (inp8 == 2 && glob.plantc == 1 || glob.plantc == 3)
                    {
                        double cec = glob.money;
                        Console.WriteLine("how many levels would you like to buy?");

                        int inp10 = 99;
                        while (inp10 == 99)
                        {
                            lock (globals.locking)
                            {
                                if (globals.repeat == 1)
                                {
                                    Console.WriteLine("how many levels would you like to buy?");
                                    globals.repeat--;
                                }
                                else if (globals.rep == 1)
                                {
                                    Console.WriteLine("how many levels would you like to buy?");
                                    globals.rep--;
                                }
                                inp10 = globals.read();
                            }
                            await Task.Delay(5);
                        }

                        glob.money = market.upgrade2(glob.money, inp10);

                        if (glob.money != cec)
                        {
                            plant2.Addfood(inp10);
                        }
                    }
                    else if (inp8 == 3 && glob.plantc == 2 || glob.plantc == 3)
                    {
                        double cec = glob.money;
                        Console.WriteLine("how many levels would you like to buy?");

                        int inp11 = 99;
                        while (inp11 == 99)
                        {
                            lock (globals.locking)
                            {
                                if (globals.repeat == 1)
                                {
                                    Console.WriteLine("how many levels would you like to buy?");
                                    globals.repeat--;
                                }
                                else if (globals.rep == 1)
                                {
                                    Console.WriteLine("how many levels would you like to buy?");
                                    globals.rep--;
                                }
                                inp11 = globals.read();
                            }
                            await Task.Delay(5);
                        }

                        glob.money = market.upgrade1(glob.money, inp11);

                        if (glob.money != cec)
                        {
                            plant1.addfood(inp11);
                        }
                    }
                    else
                    {
                        Console.WriteLine("Invalid option");
                        goto start;
                    }
                    break;



                default:
                    goto start;
                }
                break;
            }
            goto start;
        }
Exemple #2
0
        public static void Main()
        {
            global glob;

            glob.food   = 0;
            glob.money  = 0;
            glob.plantc = 0;

            int plantcount = 9;

            IPlant[] plantnew1 = new plant1[plantcount];
            IPlant[] plantnew2 = new plant2[plantcount];
            IPlant[] plantnew3 = new plant3[plantcount];

            for (int i = 0; i < 9; i++)
            {
                plantnew1[i] = new plant1();
                plantnew2[i] = new plant2();
                plantnew3[i] = new plant3();
            }

            Console.WriteLine("Welcome to the Farming game! To get started, choose an option.");

start:
            Console.WriteLine("1. Seed");
            Console.WriteLine("2. Harvest");
            Console.WriteLine("3. Go to market");
            Console.WriteLine("(To make a selection, input the coresponding number)");

            int num1 = 0;

            while (true)
            {
                if (globals.i == 0)
                {
                    string input1 = Console.ReadLine();
                    num1 = int.Parse(input1);
                    break;
                }
            }


            switch (num1)
            {
            case 1:

                int i = 0;
                while (i == 0)
                {
                    Console.WriteLine("Which plant would you like to seed?");
                    Console.WriteLine("1. plant1");
                    Console.WriteLine("2. plant2");
                    Console.WriteLine("3. plant3");
                    Console.WriteLine("4. return to main menu");

                    int num2 = 0;
                    while (true)
                    {
                        if (globals.i == 0)
                        {
                            string input2 = Console.ReadLine();
                            num2 = int.Parse(input2);
                            break;
                        }
                    }

                    switch (num2)
                    {
                    case 1:
                        int rand1 = rand();
                        plantnew1[0].needwater(rand1);
                        int plotleft = plot.useplot();
                        Console.WriteLine("plant1 has been seeded! You have" + plotleft + "plots left");
                        i++;
                        break;

                    case 2:
                        if (glob.plantc == 1 || glob.plantc == 3)
                        {
                            int rand2 = rand();
                            plantnew2[0].needwater(rand2);
                            int plotleft1 = plot.useplot();
                            Console.WriteLine("plant1 has been seeded! You have" + plotleft1 + "plots left");
                            i++;
                            break;
                        }
                        else
                        {
                            Console.WriteLine("You haven't unlocked this plant yet!");
                        }
                        break;

                    case 3:
                        if (glob.plantc == 2 || glob.plantc == 3)
                        {
                            int rand3 = rand();
                            plantnew3[0].needwater(rand3);
                            int plotleft2 = plot.useplot();
                            Console.WriteLine("plant1 has been seeded! You have" + plotleft2 + "plots left");
                            i++;
                            break;
                        }
                        else
                        {
                            Console.WriteLine("You haven't unlocked this plant yet!");
                        }
                        break;

                    case 4:
                        goto start;

                    default:
                        Console.WriteLine("Invalid input, try again.");
                        break;
                    }
                }
                break;

            case 2:
                for (int coun = 0; coun < 9; coun++)
                {
                    if (plantnew1[coun].ready() == true)
                    {
                        while (true)
                        {
                            Console.WriteLine(plantnew1[coun].name() + " is ready to harvest! Would you like to harvest?");
                            Console.WriteLine("1. Yes");
                            Console.WriteLine("2. Return to main menu");

                            int inp2 = 0;
                            while (true)
                            {
                                if (globals.i == 0)
                                {
                                    string input2 = Console.ReadLine();
                                    inp2 = int.Parse(input2);
                                    break;
                                }
                            }

                            if (inp2 == 1)
                            {
                                glob.food += plantnew1[coun].worth();
                                break;
                            }
                            else if (inp2 == 2)
                            {
                                goto start;
                            }
                            else
                            {
                                Console.WriteLine("Invalid input");
                            }
                        }
                    }
                    else if (plantnew2[coun].ready() == true)
                    {
                        while (true)
                        {
                            Console.WriteLine(plantnew2[coun].name() + " is ready to harvest! Would you like to harvest?");
                            Console.WriteLine("1. Yes");
                            Console.WriteLine("2. Return to main menu");

                            int inp3 = 0;
                            while (true)
                            {
                                if (globals.i == 0)
                                {
                                    string input2 = Console.ReadLine();
                                    inp3 = int.Parse(input2);
                                    break;
                                }
                            }

                            if (inp3 == 1)
                            {
                                glob.food += plantnew2[coun].worth();
                                break;
                            }
                            else if (inp3 == 2)
                            {
                                goto start;
                            }
                            else
                            {
                                Console.WriteLine("Invalid input");
                            }
                        }
                    }
                    else if (plantnew3[coun].ready() == true)
                    {
                        while (true)
                        {
                            Console.WriteLine(plantnew3[coun].name() + " is ready to harvest! Would you like to harvest?");
                            Console.WriteLine("1. Yes");
                            Console.WriteLine("2. Return to main menu");

                            int inp4 = 0;
                            while (true)
                            {
                                if (globals.i == 0)
                                {
                                    string input2 = Console.ReadLine();
                                    inp4 = int.Parse(input2);
                                    break;
                                }
                            }

                            if (inp4 == 1)
                            {
                                glob.food += plantnew3[coun].worth();
                                break;
                            }
                            else if (inp4 == 2)
                            {
                                goto start;
                            }
                            else
                            {
                                Console.WriteLine("Invalid input");
                            }
                        }
                    }
                }
                Console.WriteLine("nothing is ready to harvest yet!");
                break;

            case 3:
                Console.WriteLine("Welcome to the market!");
                Console.WriteLine("1. sell food");
                Console.WriteLine("2. buy plant");
                Console.WriteLine("3. buy levels");
                Console.WriteLine("4. Return to main menu");

                int inp5 = 0;
                while (true)
                {
                    if (globals.i == 0)
                    {
                        string input2 = Console.ReadLine();
                        inp5 = int.Parse(input2);
                        break;
                    }
                }

                switch (inp5)
                {
                case 1:
                    Console.WriteLine("How much food would you like to sell? (10 food = $1 Minimum)");

                    int inp6 = 0;
                    while (true)
                    {
                        if (globals.i == 0)
                        {
                            string input2 = Console.ReadLine();
                            inp6 = int.Parse(input2);
                            break;
                        }
                    }

                    if (inp6 >= 10 && inp6 <= glob.food)
                    {
                        double value = Convert.ToDouble(inp6);
                        glob.money = value / 10;
                        Console.WriteLine("Congratuations! you now have $" + glob.money);
                    }
                    else
                    {
                        Console.WriteLine("Invalid input or insufficient funds");
                        goto start;
                    }
                    break;

                case 2:
                    Console.WriteLine("Which plant would you like to purchase?");
                    Console.WriteLine("1. plant2");
                    Console.WriteLine("2. plant3");

                    int inp7 = 0;
                    while (true)
                    {
                        if (globals.i == 0)
                        {
                            string input2 = Console.ReadLine();
                            inp7 = int.Parse(input2);
                            break;
                        }
                    }

                    if (glob.plantc == 0 && inp7 == 1)
                    {
                        double a = glob.money;
                        glob.money = market.buyplant2(glob.money);
                        if (glob.money != a)
                        {
                            glob.plantc++;
                        }
                    }
                    else if (glob.plantc == 1 && inp7 == 2 || glob.plantc == 0 && inp7 == 2)
                    {
                        double b = glob.money;
                        glob.money = market.buyplant3(glob.money);
                        if (glob.money != b)
                        {
                            glob.plantc += 2;
                        }
                    }
                    else
                    {
                        Console.WriteLine("Invalid option");
                        goto start;
                    }
                    break;

                case 3:
                    Console.WriteLine("for what plant would you like to buy levels for?");
                    Console.WriteLine("1. plant1");
                    Console.WriteLine("2. plant2");
                    Console.WriteLine("3. plant3");

                    int inp8 = 0;
                    while (true)
                    {
                        if (globals.i == 0)
                        {
                            string input2 = Console.ReadLine();
                            inp8 = int.Parse(input2);
                            break;
                        }
                    }

                    if (inp8 == 1)
                    {
                        double cec = glob.money;
                        Console.WriteLine("how many levels would you like to buy?");

                        string input9 = Console.ReadLine();
                        int    inp9   = int.Parse(input9);

                        glob.money = market.upgrade1(glob.money, inp9);

                        if (glob.money != cec)
                        {
                            plant1.addfood(inp9);
                        }
                    }
                    else if (inp8 == 2)
                    {
                        double cec = glob.money;
                        Console.WriteLine("how many levels would you like to buy?");

                        string input10 = Console.ReadLine();
                        int    inp10   = int.Parse(input10);

                        glob.money = market.upgrade2(glob.money, inp10);

                        if (glob.money != cec)
                        {
                            plant2.Addfood(inp10);
                        }
                    }
                    else if (inp8 == 3)
                    {
                        double cec = glob.money;
                        Console.WriteLine("how many levels would you like to buy?");

                        string input11 = Console.ReadLine();
                        int    inp11   = int.Parse(input11);

                        glob.money = market.upgrade1(glob.money, inp11);

                        if (glob.money != cec)
                        {
                            plant1.addfood(inp11);
                        }
                    }
                    else
                    {
                        Console.WriteLine("Invalid option");
                        goto start;
                    }
                    break;

                default:
                    goto start;
                }
                break;
            }

            goto start;
        }