Difference between revisions of "Add a Help command to display a list of possible commands"

From TRCCompSci - AQA Computer Science
Jump to: navigation, search
(Created page with "=The Examine method= There is already a method to examine the inventory or an item so find this code: <syntaxhighlight lang=c#> private static void help() {...")
(No difference)

Revision as of 11:25, 18 December 2018

The Examine method

There is already a method to examine the inventory or an item so find this code:

        private static void help()
        {
            Console.WriteLine("Commands: \n Get \n Use \n Go \n Read \n Examine \n Open \n Close \n Move \n Playdice \n Attack \n Quit");
            Console.ReadLine();
        }

Add more commands into the list as you make them. Then put the code below in the switch case:

                    case "help":
                        help();
                        break;