title: Scrabble Point Counter
body: <p>I am working on a scrabble program that generates 7 letters, then allows the user to enter words and see if they are valid and what the point value would be. As soon as I started doing the values is when I started having problems. </p>
  
  <p>I am calling the function wordvalue like this, and wanting to store the result into value.
  The users word is stored into userword[8].</p>
  
  <pre><code>int value = wordvalue(userword[8]);
  </code></pre>
  
  <p>Here is my code to figure out what letter is in the array cell, then add. I am not sure what is wrong with it but it crashes every time at this step. </p>
  
  <pre><code>int wordvalue (char userword[8]){
  
      int m;
      int currentvalue = 0;
  
      for (m=0; m &lt; 8; m++){
  
          switch (userword[m]){
  
          case 'A':
          case 'E':
          case 'I':
          case 'L':
          case 'N':
          case 'O':
          case 'R':
          case 'S':
          case 'T':
          case 'U':
              currentvalue = currentvalue + 1;
              break;
          case 'D':
          case 'G':
              currentvalue = currentvalue + 2;
              break;
          case 'B':
          case 'C':
          case 'M':
          case 'P':
              currentvalue = currentvalue + 3;
              break;
          case 'F':
          case 'H':
          case 'V':
          case 'W':
          case 'Y':
              currentvalue = currentvalue + 4;
              break;
          case 'K':
              currentvalue = currentvalue + 5;
              break;
          case 'J':
          case 'X':
              currentvalue = currentvalue + 8;
              break;
          case 'Q':
          case 'Z':
              currentvalue = currentvalue + 10;
              break;
  
          }
  
  
      }
  
      //printf("%d", currentvalue);
      return currentvalue;
  }
  </code></pre>