Difference between revisions of "Count the number of player instructions"

From TRCCompSci - AQA Computer Science
Jump to: navigation, search
(Created page with "Player instruction counter in order to create a player instruction counter we will first need to define a variable to count this in an area of the program which does not loop...")
(No difference)

Revision as of 10:57, 18 December 2018

Player instruction counter

in order to create a player instruction counter we will first need to define a variable to count this in an area of the program which does not loop e.g. (int instructions = 0;) you then need to increment and output it. (instructions++) and (Console.Writeline("you have used " + instructions + " moves")) I chose to put this in the PlayGame method of the program