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

Function getNumberForNthLetter

src/gamesbyexample/hexapawn.py:117–120  ·  view source on GitHub ↗

Returns the integer form of a letter. The integer of 'A' is 0, the integer of 'B' is 1, the integer of 'C' is 2, and so on.

(letter)

Source from the content-addressed store, hash-verified

115
116
117def getNumberForNthLetter(letter):
118 """Returns the integer form of a letter. The integer of 'A' is 0,
119 the integer of 'B' is 1, the integer of 'C' is 2, and so on."""
120 return ord(letter) - 65 # The ASCII value of 'A' is 65.
121
122
123def displayBoard(board):

Callers 1

doPlayerMoveFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected