Computer Science Canada This game i made for a project it wont stop reapting stuff can some one please help fast and the tank part is messed up |
Author: | Jesse Kazemi [ Tue Jun 17, 2014 11:44 am ] | ||
Post subject: | This game i made for a project it wont stop reapting stuff can some one please help fast and the tank part is messed up | ||
What is it you are trying to achieve? <Replace all the <> with your answers/code and remove the <>> What is the problem you are having? <Answer Here> % Game Variables %Game made by Jerry Tam and Jesse Kazemi % var name : string var health : int := 50 var skill1 : int := 0 var skill2 : int := 0 var skill3 : int := 0 var skill4 : int := 0 var n1 : string var c1 : string var c2 : string var c3 : string var c3a : string var c3ah : int := 0 var c4 : string var c4a : string var c5 : string put "Welcome to D-day!" put "What is your surname?" get name cls put "Name: ", name put "Health: ", health loop put "Choose your specialty: A= Rifleman, B=Grenadier, C=Sharpshooter,D= Machine Gunner, E= Combat Medic" get c1 if c1 = 'A' or c1 = 'a' then put "You chose rifleman, Marksmanship +50,Explosives +40, Heavy weapons +30, Medical +30" skill1 := skill1 + 40 skill2 := skill2 + 40 skill3 := skill3 + 40 skill4 := skill4 + 30 elsif c1 = 'B' or c1 = 'b' then put "You chose grenadier, Marksmanship +30, Explosives +60, Heavy Weapons +40, Medical +30" skill1 := skill1 + 30 skill2 := skill2 + 60 skill3 := skill3 + 40 skill4 := skill4 + 30 elsif c1 = 'C' or c1 = 'c' then put "You chose sharpshooter, Marksmanship +60, Explosives +30, Heavy Weapons +40, Medical +30" skill1 := skill1 + 60 skill2 := skill2 + 30 skill3 := skill3 + 40 skill4 := skill4 + 30 elsif c1 = 'D' or c1 = 'd' then put "You chose machine gunner, Marskmanship +40, Explosives +30, Heavy Weapons +60, Medical +30" skill1 := skill1 + 40 skill2 := skill2 + 30 skill3 := skill3 + 60 skill4 := skill4 + 30 elsif c1 = 'E' or c1 = 'e' then put " You chose combat medic, Marksmanship +40, Explosives +30, Heavy Weapons +30, Medical +60" else put "Invalid Choice" end if exit when c1 = 'A' or c1 = 'a' or c1 = 'B' or c1 = 'b' or c1 = 'C' or c1 = 'c' or c1 = 'D' or c1 = 'd' or c1 = 'E' or c1 = 'e' end loop put "Type anything and press enter to continue" get n1 cls put "Name: ", name put "Health: ", health put "Marksmanship: ", skill1 put "Explosives: ", skill2 put "Heavy Weapons: ", skill3 put "Medical: ", skill4 loop exit when health <= 0 put "It was a foggy morning. The date was June 6, 1944, and it was the day you invade Normandy." put "You were on the boat and it was rocking around, making you and some of the others sea sick." put "Then, Boom!" put "Type Anything and hit enter" get n1 cls put "Health: ", health put "Marksmanship: ", skill1 put "Explosives: ", skill2 put "Heavy Weapons: ", skill3 put "Medical: ", skill4 put "You were pushed underwater by the force of the explosion." put "What do you do?" put "A: This is a sign that I shouldn't be here. I am not going to try and get back to the surface" put "B: The water is shallow enough for me to walk to the surface, I do just that." put "C: I should stay underwater for a few seconds so that I don't get caught in an explosion." get c3 if c3 = 'A' or c3 = 'a' then put "You Drowned" health := health - 50 elsif c3 = 'B' or c3 = 'b' then put "You walked to the surface" elsif c3 = 'C' or c3 = 'c' then for io : 1 .. 3 put "You stayed under water do you want to continue staying under water" put "A: Stay under water" put "B: Walk to the surface" get c3a if c3a = 'A' or c3a = 'a' then c3ah := c3ah + 1 if c3ah = 4 then put "You drowned" else put "You stayed underwater." end if c3ah := c3ah + 1 if c3ah = 4 then health := health - 50 end if elsif c3a = 'B' or c3a = 'b' then put "You walked out of the water" end if exit when c3a = 'B' or c3a = 'b' end for else put "Invalid choice" end if exit when health <= 0 cls put "Name: ", name put "Health: ", health put "Marksmanship: ", skill1 put "Explosives: ", skill2 put "Heavy Weapons: ", skill3 put "Medical: ", skill4 put "You rise to the surface to see a beach littered with dead bodies, and all you hear is the sounds of explosions and machine gun fire," put "What do you do next?" put "A: You take cover by lying on the ground." put "B: You take cover at a near by tank." put "C: You run up the beach looking for a more defensible position." get c4 if c4 = 'A' or c4 = 'a' then put "You lay on the ground as bullets fly past your head" elsif c4 = 'B' or c4 = 'b' then put "You run to the nearby tank and take cover. As soon as you reach the tank a missile flies toward it," put "and it explodes in a giant gout of flame consuming you in the furious flames." health := health - 50 elsif c4 = 'C' or c4 = 'c' then put "You run forward and look for better cover, you see a small hill, but the way across is exposed to machine gun fire." put "Do you run toward it?" put "Y/N" get c4a if c4a = 'Y' or c4a = 'y' then put "You run toward the hill constantly under fire. A bullet grazes your side." health := health - 10 elsif c4a = 'N' or c4a = 'n' then put "You lie down behind a dead body, and realized that it was your best friend who you hid behind." put "You nearly throw up at the shear horror of what you just witnessed." end if end if put "Type 'a' and press enter to continue" exit when n1 = 'a' end loop put "Check Point" loop cls put "Name: ", name put "Health: ", health put "Marksmanship: ", skill1 put "Explosives: ", skill2 put "Heavy Weapons: ", skill3 put "Medical: ", skill4 if c4 = 'A' or c4 = 'a' then put "'Hey!' Yells the sergeant. 'Get the hell over here we are charging the hill!' " elsif c4 = 'C' or c4 = 'c' then put "A sergeant and his sqaud runs over to your location." put "The sergeant asks what squad you are from." put "You tell him what squaud you from." put "'Oh', says the sergeant 'son I am ungrateful to say this but you are the last remaining person from your squad.'" put "You look on in shock and sadness and anger all mixed in together." put "'Son you are now with us' says the sergeant in a less gruff voice. the squad members have just welcomed you in with them." put "As you guys are talking a mortar explodes and a few members of the squad dies. 'goddammit', yells the sergeant 'Alright we are going to charge the hill!'" put "What do you do?" put "A: Charge the hill with the squad" put "B: 'This is not worth living through', you shoot yourself in the head" put "C: Lay down suppressing fire for the squad." get c5 if c5 = 'A' or c5 = 'a' then put "You have been shot in the stomach. You bleed to death." health := health - 50 elsif c5 = 'B' or c5 = 'b' then put "You shoot yourself." health := health - 50 elsif c5 = 'C' or c5 = 'c' then put "As you lay down supressive fire you charge into the enemies and kill six people. Then you get shot in the head." end if end if exit when c5= 'A' or c5= 'a' or c5= 'B' or c5= 'b' or c5= 'C' or c5= 'c' end loop put "Game Over" if health <= 0 then put "You Died" end if Describe what you have tried to solve this problem <Answer Here> Post any relevant code (You may choose to attach the file instead of posting the code if it is too long) <Answer Here>
Please specify what version of Turing you are using <Answer Here> |
Author: | Jesse Kazemi [ Tue Jun 17, 2014 2:33 pm ] |
Post subject: | Re: This game i made for a project it wont stop reapting stuff can some one please help fast and the tank part is messed |
18 views and no replies |
Author: | jesse kazomi [ Tue Jun 17, 2014 4:23 pm ] |
Post subject: | Re: This game i made for a project it wont stop reapting stuff can some one please help fast and the tank part is messed |
i think its because u did not close some loops and other stuff |
Author: | jesse kazomi [ Tue Jun 17, 2014 5:52 pm ] |
Post subject: | Re: This game i made for a project it wont stop reapting stuff can some one please help fast and the tank part is messed |
Ummm okay then |