Welcome to Anything Forums! We are a general discussion forum that believes in freedom of expression and aim to provide a low moderation (within reasonable means) environment to discuss any topic. If you want to join, simply click HERE to be taken to our account management system where you can make an account. If you had an account at iceteks.com, anythingforums.com, uovalor.com or uogateway.com in the past it has been transfered over and you can simply do a password reset.
Computer builds, hardware and software discussion or troubleshooting, including peripherals. Essentially a general place to talk about desktop computers.
Okay, for turing posts, please include your variables. It's hard to tell how a program works without knowing the variables (and procedures by the way). From the looks of it, you're repeating the process of the blanks for no reason. When you guess a letter, it goes through your process and outputs *c*****. Now, what you're doing, is RE-DOING the process, so when you're placing your asterisks, you're not taking into account that there's already a letter there. What you need is some kiind of conditional statement that checks to see if the LETTER in LENGTH of STRING was chosen. What you need to do is check to see if the letter was chosen. This can be done by varifying if the letter in your word is an asterisk or not. I would create a variable that stores how many characters your word is, and converts it to asterisks. So if the word is ICETEKS, there are 7 letters, so the new variable would be like this:
NOTE: "You'll need to figure out how to get it so that the variable can store whatever length of asterisks that are needed":
blanks := "*******"
So, in your conditional statement, you'll just need to check to see if the LETTER'S space in BLANK is taken. Here's what I mean:
for i: 1..LENGTH OF YOUR WORD
if LETTER = STRING IN THIS POSITION OF YOUR WORD (i) then
blank (POSITION OF I) := LETTER
end if
end for
so basically, this program will TAKE the letter you chose, find in the WORD where the letter belongs (EX: in ICETEKS, C is the second letter). Then, if there's a match, the position in the variable BLANK is changed to THAT letter (So in blank *******, the second letter will become a C.) In doing this, there's no way that the variable BLANK will be erased and seeing as the letters are stored in a variable, they cannot be erased. Hopefully this helps you out.
Archived topic from Iceteks, old topic ID:2923, old post ID:23832
why dont you post the question too that might help, are you trying to get the people to guess a letter, kinda like hangman? i have no idea what you want lol so post the whole thing and i'll be able to help better
Archived topic from Iceteks, old topic ID:2923, old post ID:23899