Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

BRACKEYS - Solution to C# Tutorial 01 Challenge

2»

Comments

  • LSG_MarkLSG_Mark Member
    edited April 28

    My Submission for the Assignment 01:

    using System;

    namespace My_Awsome_Program

    {

        class Program

        {

            static void Main(string[] args)

            {

                //Create name var


                string name;

                //Change the appearance of the console


                Console.Title = "Bad Jokes";

                Console.ForegroundColor = ConsoleColor.DarkYellow;

                Console.WindowHeight = 40;

                Console.WindowWidth = 120;

                

                //Get users name


                Console.WriteLine("Hello, What's your Name");


                Console.ForegroundColor = ConsoleColor.White;

                name = Console.ReadLine();


                //Start Knock Knock joke

                Console.ForegroundColor = ConsoleColor.DarkYellow;

                Console.WriteLine("Knock, Knock");

                

                Console.ForegroundColor = ConsoleColor.White;

                Console.ReadLine();

                

                Console.ForegroundColor = ConsoleColor.DarkYellow;

                Console.WriteLine("Roach");


                Console.ForegroundColor = ConsoleColor.White;

                Console.ReadLine();


                Console.ForegroundColor = ConsoleColor.DarkYellow;

                Console.WriteLine("Roach you an email last week " + name + " Still waiting for your response!");


                Console.ForegroundColor = ConsoleColor.Red;

                Console.WriteLine("HA, HA, HA, HA!");



                Console.ReadKey();

            }

        }

    }


    Output:


  • MY solution I made.



    using System;


    namespace My_First_Project

    {

        class Program

        {

            static void Main(string[] args)

            {

            // Setting Things Up

            Console.Title = ("A short Story");

            Console.WindowHeight = 40;

            // Printing the Story out

            Console.WriteLine("A giant dragon is descending upon the castle, You are a Knight, and you must defend against the Dragon \nWhat is your name?");

            Console.ReadLine();

            Console.WriteLine("You slash the dragon with...");

            Console.ReadLine();

            Console.WriteLine("It does nothing! The dragon rains firey breath upon the castle. \nWhat do you use to block the fire from burning you?");

            Console.ReadLine();

            Console.ForegroundColor = ConsoleColor.Red;

            Console.WriteLine("The Fire is so hot it melts everything, even the rocky castle turns into lava.\nIt Melts your item you used, and you die.");

            Console.WriteLine("\n\n\n\n\n\n\n\n\n\n\n\n\n THE END ");

            Console.ReadKey();

             }

        }

    }

Sign In or Register to comment.