MCPcopy Create free account
hub / github.com/asweigart/PythonStdioGames / getNthLetter

Function getNthLetter

src/gamesbyexample/hexapawn.py:111–114  ·  view source on GitHub ↗

Returns the "nth" letter, where nth is an integer. The 0th letter is 'A', the 1st letter is 'B', the 2nd letter is 'C', and so on.

(nth)

Source from the content-addressed store, hash-verified

109
110
111def getNthLetter(nth):
112 """Returns the "nth" letter, where nth is an integer. The 0th letter
113 is 'A', the 1st letter is 'B', the 2nd letter is 'C', and so on."""
114 return chr(nth + 65) # The ASCII value of 'A' is 65.
115
116
117def getNumberForNthLetter(letter):

Callers 2

displayBoardFunction · 0.85
getValidMovesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected