From 336a323071e6ff8f09853bab8e56f00b5a0148da Mon Sep 17 00:00:00 2001 From: Fudgerboy <91767657+Fudgerboy@users.noreply.github.com> Date: Wed, 6 Dec 2023 04:50:44 +0000 Subject: Tue, Dec 5, 2023, 8:50 PM -08:00 --- wk2/sect2/scrabble/scrabble.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 wk2/sect2/scrabble/scrabble.c (limited to 'wk2') diff --git a/wk2/sect2/scrabble/scrabble.c b/wk2/sect2/scrabble/scrabble.c new file mode 100644 index 0000000..b682df2 --- /dev/null +++ b/wk2/sect2/scrabble/scrabble.c @@ -0,0 +1,27 @@ +#include +#include +#include +#include + +// 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 +} -- cgit v1.2.3