1. We have moved from vBulletin to XenForo and you are viewing the site in the middle of the move. Though the functional aspect of everything is working fine, we are still working on other changes including the new design on Xenforo.
    Dismiss Notice

new to programming ..need help wit this question

Discussion in 'C' started by Jehllo876, Mar 14, 2010.

  1. Jehllo876

    Jehllo876 New Member

    Design a game that will allow the user to choose from a group of words, depending on the word choosen compare with the word with an word generated by the computer if the words are the same issue one point to the user if not the pont goes to the computer.

    You are required to create an array of string size 10 for the user to choose from. make sure words are no greater than 3 characters.


  2. xpi0t0s

    xpi0t0s Mentor

    How far have you got and where are you stuck? Try writing the code a bit at a time and make sure each bit works before moving onto the next bit. Do you fully understand the assignment?
  3. Jehllo876

    Jehllo876 New Member

    yea i do...barely .....i get stuck at where the user is suppose to choose a word from the array and compare it with the computers word
  4. xpi0t0s

    xpi0t0s Mentor

    What code have you got so far?
    How will the user choose a word from the array: will you display the words and ask them to pick one, and how will they identify the word: will they type the word itself in or identify it some other way? If the former what if there is a typo?
  5. Jehllo876

    Jehllo876 New Member

    yea....the array will be displayed n the user is to choose the word
  6. virxen

    virxen New Member

    steps to follow
    1) create group of words
    -find the words you want
    -put them in a char array--->char words[N][M]
    where N is how many words and M the maximum length of a word.

    2) computer word
    -calculate a random number from 0...N-1
    -find the word for this random number --->words[random]

    3) print words on computer screen
    one , two, ..........

    4) get user input

    5) compare the user input with computer word
    -strcmp for example
    -if (success...) human++ else computer++

    now write your code and post it here for debugging.
    Last edited: Mar 16, 2010

Share This Page