Simple Game

I can't figure out what is wrong with my program. When you meet the S, and you have an instant kill, and you choose no, it automatically kills the enemy. Please help. The code is here, http://paste.ofcode.org/36YzxJUsyGaBhxNdXu3rd9J .
closed account (48T7M4Gy)
Which lines are relevant to the problem and what is the program supposed to do. You should be able to pinpoint those two aspects from having written the code. I think it would be better if you posted the snippet here. Thanks. :)
237 - 266 is where I think the source of the problem is, and the program is supposed to be a "dungeon crawl" game. I can't post it on here because it is too long.
line 240: the 2 conditions that you OR'ed together are identical. Why do you have it twice?

line 242 you ask for 'Y' input, but in line 244 you check against 'y'. You should be checking against both or checking tolower(r) == 'y'.

line 248: r is not initialized. The else relates to line 241, not 244.

line 249: The third expression in the statement doesn't actually do anything. You could leave it blank.

As far as your question, you enter 'N' at line 243, right? Are you saying that you are seeing the printout in line 245?

Last edited on
Topic archived. No new replies allowed.