diff options
author | Fudgerboy <91767657+Fudgerboy@users.noreply.github.com> | 2023-12-07 05:44:34 +0000 |
---|---|---|
committer | Fudgerboy <91767657+Fudgerboy@users.noreply.github.com> | 2023-12-07 05:44:34 +0000 |
commit | 7d45bd49582ad610670cce7fdfbcee172952518f (patch) | |
tree | 9e2025da70d127d62100873ec9a8e848280711af /wk2/lab2/scrabble | |
parent | 9580214fabf0d9a2849acf38beeedcb50d4c0bba (diff) |
Wed, Dec 6, 2023, 9:44 PM -08:00
Diffstat (limited to 'wk2/lab2/scrabble')
-rw-r--r-- | wk2/lab2/scrabble/scrabble.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/wk2/lab2/scrabble/scrabble.c b/wk2/lab2/scrabble/scrabble.c new file mode 100644 index 0000000..5674efe --- /dev/null +++ b/wk2/lab2/scrabble/scrabble.c @@ -0,0 +1,28 @@ +#include <ctype.h>
+#include <cs50.h>
+#include <stdio.h>
+#include <string.h>
+
+// Points assigned to each letter of the alphabet
+int POINTS[] = {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};
+
+int compute_score(string word);
+
+int main(void)
+{
+ // Get input words from both players
+ string word1 = get_string("Player 1: ");
+ string word2 = get_string("Player 2: ");
+
+ // Score both words
+ int score1 = compute_score(word1);
+ int score2 = compute_score(word2);
+
+ // TODO: Print the winner
+}
+
+int compute_score(string word)
+{
+ // TODO: Compute and return score for string
+
+}
|