Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8523923
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T07:32:50+00:00 2026-06-11T07:32:50+00:00

I am working on a scrabble program that generates 7 letters, then allows the

  • 0

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.

I am calling the function wordvalue like this, and wanting to store the result into value.
The users word is stored into userword[8].

int value = wordvalue(userword[8]);

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.

int wordvalue (char userword[8]){

    int m;
    int currentvalue = 0;

    for (m=0; m < 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;
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T07:32:51+00:00Added an answer on June 11, 2026 at 7:32 am
    int value = wordvalue(userword[8]);
    

    This call looks wrong.

    Assuming userword is an array of char you are passing a char where a pointer to char is expected.

    You probably wanted to do:

    int value = wordvalue(userword);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I m working on a word scramble game which allows user to move the
Working on a project that parses a log of events, and then updates a
Working with an undisclosed API, I found a function that can set the number
I am currently working on a simple Scrabble implementation for a college project. I
Working on an extension that use the new experimental devtools apis. How do you
Working with a Lucene index, I have a standard document format that looks something
I'm an inexperienced JavaScript user working through the book CoffeeScript: Accelerated JavaScript Development ,
working on xcode I realized that if I create a non-void method, I call
Working with C#. I have an abstract class that I use to read/write settings
Working on an application where we would like the user to be able to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.