function scrabble = ch_to_scrabble ( ch ) %% CH_TO_SCRABBLE returns the Scrabble index of a character. % % Discussion: % % 'A' through 'Z' have indices 1 through 26, and blank is index 27. % Case is ignored. All other characters return index -1. % % Modified: % % 02 April 2006 % % Author: % % John Burkardt % % Parameters: % % Input, character CH, the character. % % Output, integer SCRABBLE, the Scrabble index of the character. % if ( ch == ' ' ) scrabble = 27; return end ch = ch_cap ( ch ); ic = a_to_i ( ch ); if ( 1 <= ic & ic <= 26 ) scrabble = ic; else scrabble = -1; end