report - ask user for another probe repeatedly if the probe...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
Project 5—Computer Science 31 Ahmad El-Arabi The one problem I really had difficulties solving was within the playOneRound function. I was unable to understand why I wasn’t given a chance to enter a word for the probe, but then came to realize that I did not include the statement: cin . ignore ( 100000 , '\n' ); Once I inserted this one line, everything else fell into place. Other than this minimal problem, everything else was relatively simple to code for. Psuedocode: playOneRound: if maxwords or wordnum is less than zero, return negative one. if wordnum is larger or equal that maxwords, return negative one. repeatedly: ask user for probe. if length of probe is not between 4 to 6 letter long, ask user for another probe. if probe does not only contain lower case letters,
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: ask user for another probe. repeatedly: if the probe is found in array of words, break. if not found, ask user for another probe. repeatedly: count how many letters from probe are in the secret word. if the probe is the secret word, return the number of probes entered. increase count of probes by one. main: fill the wordlist array. ask user how many rounds they want to play. if the number of rounds entered is not positive, output an error message. repeatedly: print out the round number. generate a random number. tell the user how many letters are in secret word. tell user in how many guesses they got the secret word in. compute the: average. minimum. maximum. print out all the above scores....
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online