MCPcopy Create free account
hub / github.com/NetHack/NetHack / spell_let_to_idx

Function spell_let_to_idx

src/spell.c:114–126  ·  view source on GitHub ↗

convert a letter into a number in the range 0..51, or -1 if not a letter */

Source from the content-addressed store, hash-verified

112
113/* convert a letter into a number in the range 0..51, or -1 if not a letter */
114staticfn int
115spell_let_to_idx(char ilet)
116{
117 int indx;
118
119 indx = ilet - 'a';
120 if (indx >= 0 && indx < 26)
121 return indx;
122 indx = ilet - 'A';
123 if (indx >= 0 && indx < 26)
124 return indx + 26;
125 return -1;
126}
127
128/* TRUE: book should be destroyed by caller */
129staticfn boolean

Callers 1

getspellFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected