Untitled
Never
class Scrabble { private String word; // a, b, c, d, e, f, g, h, i, j, k, l, m, private static final int[] points = {1, 3, 3, 2, 1, 4, 2, 4, 1, 8, 5, 1, 3, // n, o, p, q, r, s, t, u, v, w, x, y, z 1, 1, 3, 10, 1, 1, 1, 1, 4, 4, 8, 4, 10}; Scrabble(String word) { this.word = word; } int getScore() { int score = 0; if (word.length() == 0) return score; for (int i = 0; i < word.length(); i++) { score += points[Character.toLowerCase(word.charAt(i)) - 'a']; } return score; } /* For extensions, also pass in array of the board spaces the word uses * empty square - '0' * double word score - '1' * triple word score - '2' * double letter score - '3' * triple letter score - '4' * If I was implementing a full game of scrabble I would use a 2d array * of the board and pass in word position info but this will be fine to * demonstrate how it works */ int getScoreWithBoard(char[] board) { int score = 0; int wordMultiplier = 1; if (word.length() == 0) return score; for (int i = 0; i < word.length(); i++) { int s = points[Character.toLowerCase(word.charAt(i)) - 'a']; // Could have used a switch statement here instead if (board[i] == '1') { wordMultiplier *= 2; } else if (board[i] == '2') { wordMultiplier *= 3; } else if (board[i] == '3') { s *= 2; } else if (board[i] == '4') { s *= 3; } score += s; } return score * wordMultiplier; } }
Raw Text
-
my friend gave me a present
25 min ago
-
Fucking the boss's wife at a party to orgasm. She moans with pleasure and takes cum in her mout
54 min ago
-
https://go90-keto-gummies-get.company.site/
54 min ago
-
https://go90-keto-gummies-get.company.site/
54 min ago
-
weltowel
59 min ago
-
MA'e
1 hour ago
-
https://go90-keto-gummies-get.company.site/
1 hour ago
-
Abby and Bryana Lesbian Strap-On Fucking
1 hour ago
-
Just chill and fuck at home
1 hour ago
-
EVILANGEL Sexy Romanian Student Seduces Tutor into Anal Fuck - Alyssa Bounty
2 hours ago