i was given an assignment to create a word construction game where the program will randomly picks a combination of vowels and consonants and the user will build as much words as possible from the choosen letters. my prog will check for the correctness of the words and gives the user points to each word built, with higher point given to words that use all the letters. i limited the number of letters to 4 or 5 letters only. i justtttt learned programming from the intro up to the string topic. so , i havee no idea how to create this game. can anyone help me with this ?

#include <stdio.h>
#include<stdlib.h>
#include<time.h>
#include<string.h>
#include<ctype.h>

void Question(int);
void PrintLine();
void Menu();
void Easy();
void Medium();
void Hard();
void Compareone(char[50][10],char[30][10]);
void CompareTwo(char[50][10],char[30][10]);
void CompareThree(char[50][10],char[30][10]);

char AnslistOne[30][10] = { "horse","shore","her","shoe","sore","hero","rose","so","hose","she","he","hoe","peach","cheap","cap","pace","hap","chap","ape","heap","pec","ache" };
char AnslistTwo[30][10]= { "wodge","dew","go","do","wed","dog","god","woe","doe","ode","cove","vet","veto","cot","cote","vote","evo","toe","covet" };
char AnslistThree[30][10]= { "pooch","hoop","hop","cop","coop","poo","poco","chop","anime","amine","mine","name","mean","in","am","man","men","him","min" };
char cont,Ans[50][10];
int level,num,i,v;
int main ()
{
    char name[50];
    system("color 05");
    PrintLine();
    printf("\n\t\t\tWelcome to Boggles\t\n");
    PrintLine();
    system("title Word Construction Game");

    printf("\t\t\tEnter name: "); //input user's name
    gets(name);


    do
    {
        system("cls");
        system("color 80"); 
        Menu();
        printf("\n\nHi %s, please select difficulty (1-3) :",name); //asking user to select the level of difficulty
        scanf(" %c",&level);
        Question(level);
        while( level == 1 && level == 2 && level == 3 )
        {
            printf("Sorry. we only have level 1 to level 3 only. Please re-enter: ");
            scanf(" %c",&level);
            Question(level);
        }
        printf("\n\nDo you want to continue? (Y-yes|N-no)"); //asking user to continue or not
        scanf(" %c", &cont);
        while(cont!='y'&&cont!='Y'&&cont!='n'&&cont!='N')
           {
              fflush(stdin);
              printf("Invalid input. Please re-enter. (Y-yes|N-no)");
              scanf(" %c", &cont);
           }        
    }while(cont=='y'||cont=='Y');



    system("pause");
    return 0;

}
void PrintLine ()
{
    printf("\n\t\t=======================================\n");
    return;
}
void Menu()
{
    printf("Level 1 - Easy\n");
    printf("Level 2 - Medium\n");
    printf("Level 3 - Hard\n");

}
void Question(level)
{
    switch (level)
    {
        case 1: Easy();
                break;
        case 2: Medium();
                break;
        case 3: Hard();
                break;                  

    }
}
void Easy()
{
       srand(time(NULL)); //to get random question

       int num = rand() % (2);
       switch(num)
       {
        case 1 : printf("\n\nConstruct as much word as you can from the letters below:\n");
                 printf("S E R O\n\n");
                 printf("Answers : \n");
                 scanf("%s",&Ans[50][10]); //user can enter as much words as they want
                 break;
        case 2 : printf("\n\nConstruct as much word as you can from the letters below:\n");
                 printf("E C H A P\n\n");
                 printf("Answers : \n");
                 scanf("%s",&Ans[50][10]); //user can enter as much words as they want
                 break;                  
       }
       CompareOne(Ans[50][10],AnslistOne[30][10]);
}
void Medium()
{
       srand(time(NULL)); //to get random question

       int num = rand() % (2);
       switch(num)
       {
        case 1 : printf("\n\nConstruct as much word as you can from the letters below:\n");
                 printf("D W O E G\n\n");
                 printf("Answers : \n");
                 scanf("%s",&Ans[50][10]); //user can enter as much words as they want
                 break;
        case 2 : printf("\n\nConstruct as much word as you can from the letters below:\n");
                 printf("V C T O E\n\n");
                 printf("Answers : \n");
                 scanf("%s",&Ans[50][10]); //user can enter as much words as they want
                 break;                  
       }
       CompareTwo(Ans[50][10],AnslistTwo[30][10]);
}
void Hard()
{
       srand(time(NULL)); //to get random question

       int num = rand() % (2);
       switch(num)
       {
        case 1 : printf("\n\nConstruct as much word as you can from the letters below:\n");
                 printf("O C O H P\n\n");
                 printf("Answers : \n");
                 scanf("%s",&Ans[50][10]); //user can enter as much words as they want
                 break;
        case 2 : printf("\n\nConstruct as much word as you can from the letters below:\n");
                 printf("M N E I A\n\n");
                 printf("Answers : \n");
                 scanf("%s",&Ans[50][10]); //user can enter as much words as they want
                 break;                  
       }
      CompareThree(Ans[50][10],AnslistThree[30][10]);
}
void CompareOne(char Ans[50][10],char AnslistOne[30][10])
{
    for (i=0;i<50;i++) //to check for the correctness of the word entered
    {
        if ((strcmpi(Ans[i],AnslistOne[30]))==0)
           printf("CORRECT! ^_^\n");
        else 
           printf("OOPS, SORRY! WORD NOT IN MY LIST\n");
    }
}
void CompareTwo (char Ans[50][10],char AnslistTwo[30][10])
{
    for (i=0;i<50;i++)  //to check for the correctness of the word entered
    {
        if ((strcmpi(Ans[i],AnslistTwo[30]))==0)
           printf("CORRECT! ^_^\n");
        else 
           printf("OOPS, SORRY! WORD NOT IN MY LIST\n");
    }   
}
void CompareThree (char Ans[50][10],char AnslistThree[30][10])
{
    for (i=0;i<50;i++) //to check for the correctness of the word entered
    {
        if ((strcmpi(Ans[i],AnslistThree[30]))==0)
           printf("CORRECT! ^_^\n");
        else 
           printf("OOPS, SORRY! WORD NOT IN MY LIST\n");
    }   
}

If you want to store some kind of string, use a string. So those arrays of char arrays shouldn't exist. Just use an array of string. Or even better, a vector of string.

printf? scanf? This is C++. Use cout and cin.

What's going on with your headers? Are you from the year 1995? This should be:

    #include <cstdio>
    #include <cstdlib>
    #include <ctime>
    #include <string>
    #include <cctype>

No namespaces? Wait, are you programming with a 25 year old compiler? Seriously, what are you doing this with? Are you using tools older than you are?

idk that's what my lecturer taught me and i have to finish this assignment using printf, scanf, puts and gets. not cout and cin. i'm currently using dev c++ 5.5.3

okay i guess i've asked this question in the wrong section . should ask this question in the c section not c++ hahaha i'm sorry my baddd

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.