Question: Having trouble writing this code. Have to fix errors and have code match output example. *ITALICIZED part of code works but second had errors. Code
Having trouble writing this code. Have to fix errors and have code match output example.
*ITALICIZED part of code works but second had errors.
Code was too long to upload. Web link to code.
MY CODE:
http://txt.do/18utm
ERRORS:
MY OUTPUT BEFORE ERRORS:

OUTPUT SHOULD BE:

Line abc E0065 199 205 abc E0137 abc E0137 211 217 abc E0137 abc E0137 222 240 Code Description expected a ';' expression must be a modifiable lvalue expression must be a modifiable lvalue expression must be a modifiable lvalue expression must be a modifiable Ivalue X C2106 '=': left operand must be l-value C2107 illegal index, indirection not allowed X C2106 '=': left operand must be l-value > C2106 '=': left operand must be l-value X C2106 '=': left operand must be l-value C2143 syntax error: missing )' before 'l' C2059 syntax error: ')' C2059 syntax error: '}' 246 246 252 257 266 266 270 ===== SURVIVAL! ====== Enter player symbol: @ # of Cures: 0 Please enter from 2 - 10! # of Cures: 11 Please enter from 2 - 10! # of Cures: 3 Set length of Map (5 multiple from 15-35): 9 5 multiple from 15-35!!! Set length of Map (5 multiple from 15-35): 41 5 multiple from 15-35!!! Set length of Map (5 multiple from 15-35): 19 5 multiple from 15-35!!! Set length of Map (5 multiple from 15-35): 20 # of Steps: 2 From 3 - 14 # of Steps: 16 From 3 - 14 # of Steps: 10 Enter the poison placement (sets of 5) 1 = poison = No poison. Spaces between each er (i.e 1 0 0 11 Positions [ 1- 5]: 1 0 0 1 1 Positions [ 6-10]: 1 100 Positions (11-15]: 0 0 1 1 1 Positions [16-20]: 1000 Enter the food placements (sets of 5) 1 = food @ = NO food. Spaces between each entry (i.e 1 0 0 1 1) Positions [ 1- 5]: 0 1 1 0 0 Positions [ 6-10]: 00 Positions [11-15]: 1 1 0 0 1 Positions [16-20]: 0 1 1 1 1 Symbol : @ Cure : 3 Food : [READY] History : [Ready] Map Length: 20 Poison : 10011110000011110000 Food : 01100000001100101111 ===== SURVIVAL! ====== Enter player symbol: @ # of Cures: 0 Please enter from 2 - 10! # of Cures: 11 Please enter from 2 - 10! # of Cures: 3 Set length of Map (5 multiple from 15-35): 9 5 multiple from 15-35!!! Set length of Map (5 multiple from 15-35): 41 5 multiple from 15-35!!! Set length of Map (5 multiple from 15-35): 19 5 multiple from 15-35!!! Set length of Map (5 multiple from 15-35): 20 # of Steps: 2 From 3 - 14 # of Steps: 16 From 3 - 14 # of Steps: 10 Enter the poison placement (sets of 5) 1 = poison = No poison. Spaces between each er (i.e 1 0 0 11 Positions [ 1- 5]: 1 0 0 1 1 Positions [ 6-10]: 1 100 Positions (11-15]: 0 0 1 1 1 Positions [16-20]: 1000 Enter the food placements (sets of 5) 1 = food @ = NO food. Spaces between each entry (i.e 1 0 0 1 1) Positions [ 1- 5]: 0 1 1 0 0 Positions [ 6-10]: 00 Positions [11-15]: 1 1 0 0 1 Positions [16-20]: 0 1 1 1 1 Symbol : @ Cure : 3 Food : [READY] History : [Ready] Map Length: 20 Poison : 10011110000011110000 Food : 01100000001100101111 ======== |||||||||1|||||||||2 12345678901234567890 Cure: 3 Foods: 0 Steps: 10 ============ Next Step [1-20]: 0 Too Little Steps!!! Next Step [1-20]: 21 Too Many Steps!!! Next Step [1-20]: 8 Sorry Nothing @ |||||||2 12345678901234567890 ======= Cure: 3 | Foods: | Steps: 9 Next Step [1-20]: 10 Sorry Nothing @ ||1|||||||||2 12345678901234567890 =========== Cure: 3 Foods: | Steps: 8 ============ =========== Next Step [1-20]: 1 You ate POISON @ ||1|||||||||2 12345678901234567890 ========= Cure: 2 | Foods: | Steps: 7 ========== Next Step [1-20]: 15 You ate POISONIOUS FOOD |1|||||||||2 12345678901234567890 Cure: 1 | Foods: 1 | Steps: 6 Next Step [1-20]: 20 You Found FOOD! 12345678901234567890 ======= Cure: 1 | Foods: 2 Steps: 5 Next Step [1-20]: 8 You've checked here! @ -&----$ IIII|||||2 12345678901234567890 ======== Cure: 1 | Foods: 2 | Steps: 5 Next Step [1-20]: 3 You found FOOD! @ -&- - $ 12345678901234567890 ===== Cure: 1 Foods: 3 | Steps: 4 Next Step [1-20]: 5 You ate POISONNo more LIVES remaining! @ !-$-!. |1|||||||||2 12345678901234567890 =========== Cure: | Foods: 3 Steps: 3 ======= =========== GAME OVER
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
