Sha256: f778bd41cc841962f61ce30a391b7fc103aa8ae46f0ee1da1a654196c168e4e2
Contents?: true
Size: 444 Bytes
Versions: 228
Compression:
Stored size: 444 Bytes
Contents
#include "scrabble_score.h" #include <ctype.h> static unsigned int score_book[] = { 1, 3, 3, 2, 1, 4, 2, 4, 1, 8, 5, 1, 3, 1, 1, 3, 10, 1, 1, 1, 1, 4, 4, 8, 4, 10 }; unsigned int score(const char *word) { char c; unsigned int word_score = 0; while ((c = tolower(*word++)) != '\0') { word_score += score_book[c - 'a']; } return word_score; }
Version data entries
228 entries across 228 versions & 1 rubygems