Advertisement
Guest User

Untitled

a guest
Apr 23rd, 2014
36
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. for (int i = 0; i <= answer.Length; i++) //answer is a string "theword"
  2. {
  3. if (answer[i] == passMe) //passMe is "A" for example
  4. {
  5. hiddenWord = hiddenWord.Remove(i, 1);
  6. hiddenWord = hiddenWord.Insert(i, passMe);
  7. }
  8. }
  9.  
  10. if (answer[i] == passMe[0])
  11.  
  12. for (int i = 0; i < answer.Length; i++)
  13.  
  14. for (int i = 0; i <= answer.Length; i++) //answer is a string "theword"
  15. {
  16. if (answer[i] == passMe[0]) //passMe is "A" for example
  17. {
  18. hiddenWord = hiddenWord.Remove(i, 1);
  19. hiddenWord = hiddenWord.Insert(i, passMe);
  20. }
  21. }
  22.  
  23. hiddenWord = new String(hiddenWord.Zip(answer, (a, b) => b==passMe[0] ? b : a).ToArray());
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement