Difference between revisions of "DisplayTileValues"

From TRCCompSci - AQA Computer Science
Jump to: navigation, search
(Created page with "This is quite the simple method, but I'll explain it nonetheless. The method loops through each KeyValuePair in the TileDictionary; A Dictionary which if u recall stores the c...")
(No difference)

Revision as of 14:16, 21 September 2017

This is quite the simple method, but I'll explain it nonetheless. The method loops through each KeyValuePair in the TileDictionary; A Dictionary which if u recall stores the character point associations of the program. Note when iterating through a dictionary u don't iterate through the value or the keys but u instead recieve an association between the two in a datatype struct KeyValuePair<TKey, TValue>. To access the key from this struct u simple use object notation and the identifier Key and for the value u use the same and identifier Value. Once the iteration has begon, the program outputs the character (the key) and it's corresponding point score (the value).