MCPcopy Index your code
hub / github.com/NetHack/NetHack / invletter_value

Function invletter_value

src/invent.c:390–399  ·  view source on GitHub ↗

'$'==1, 'a'-'z'==2..27, 'A'-'Z'==28..53, '#'==54, catchall 55 */

Source from the content-addressed store, hash-verified

388
389/* '$'==1, 'a'-'z'==2..27, 'A'-'Z'==28..53, '#'==54, catchall 55 */
390staticfn int
391invletter_value(char c)
392{
393 return ('a' <= c && c <= 'z') ? (c - 'a' + 2)
394 : ('A' <= c && c <= 'Z') ? (c - 'A' + 2 + 26)
395 : (c == '$') ? 1
396 : (c == '#') ? 1 + invlet_basic + 1
397 : 1 + invlet_basic + 1 + 1; /* none of the above
398 * (shouldn't happen) */
399}
400
401/* qsort comparison routine for sortloot() */
402staticfn int QSORTCALLBACK

Callers 1

sortloot_cmpFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected