Note that there are some explanatory texts on larger screens.

plurals
  1. POHow do I code a grid-like function into Java?
    text
    copied!<p>Problem: ACL Scrabble is a lettered tile game played on a grid game board. The board for this program will be 4 x 10. The grid squares are numbered as below:</p> <pre><code> 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 </code></pre> <p>The squares that are every other multiple of 3 (3, 9, 15...) are Double Letter score squares.</p> <p>The squares that are multiples of 5 and not used above are Triple Letter score squares.</p> <p>The squares that are multiples of 7 and not used above are Double Word score squares.</p> <p>The squares that are multiples of 8 and not used above are Triple Word score squares.</p> <p>Letter values will come from the following chart:</p> <pre><code> A, E - 1 point D, R - 2 points B, M - 3 points V, Y - 4 points J, X - 8 points </code></pre> <p>INPUT: There will be 6 lines of input. The first line will give the letters of the word. The word will always have 4 letters. The remaining 5 lines will be starting locations for the word and a direction: horizontal (H) or vertical (V). </p> <p>OUTPUT: For each starting location, print the total points scored by the word. No word will have more than one word score multiplier</p> <pre><code> SAMPLE INPUT SAMPLE OUTPUT 1. J, A, V, A 1. 18 2. 1, V 2. 17 3. 2, H 3. 42 4. 6, V 4. 30 5. 12, H 5. 66 6. 21, H </code></pre> <p>My question: How would I go about doing such a task? What's the most efficient way? Should I assign each letter to a number and just code in a bunch of if statements or is there another way? Thank you in advance.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload