convert a letter into a number in the range 0..51, or -1 if not a letter */
| 112 | |
| 113 | /* convert a letter into a number in the range 0..51, or -1 if not a letter */ |
| 114 | staticfn int |
| 115 | spell_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 */ |
| 129 | staticfn boolean |