🎁BACK-TO-SCHOOL DEAL. Subscribe Now to get 40% OFF at only 8.49 USD/month, only valid until Sep 30th, 2024

Question

Question
Stratego: The object of the game is to capture the flag or capture/defeat all your opponent's pieces. Rank Piece No. per player Special properties B Bomb 6 Defeats any piece except Miner 1 Marshal 1 Can be defeated by the Spy General 1 2. 3 Colonel IN 4 Major 3 5 Captain 4. 6 Lieutenant 4 7 Sergeant 4 Miner 5 Can defuse bombs 8 9 Scout 8 S Spy 1 Can defeat the General or Marshal F Flag 1 Its capture ends the game Please create a Python program simulating a game of Stratego Program must include Object/Class that creates the game pieces • Game will randomly generate 2 pieces (Player-1 vs. Player-2), winner of play determined by chart above (think the card game "War") • Although pieces are randomly generated, game should respect the odds/ratio of getting a particular piece • Game ends when one player captures the flag of their opponent

Asked By LightningStrike50 at

Answered By Expert

Bill

Expert · 5.4k answers · 5k people helped

Answer

Pgnon\nSolr\nimpolt turtle\nimport math\nimport random\nwn- turtle. Screeni)\nwn. bg color (black)\nwn. title (A Maze Game)\nsetuself gold\ngros\ndet\n90-up (sel):\n# calculate the spot to move to\nmove-to- self. xcore)\nmove to 4\nself. Ycore) 1246\n# check it\neg no:\nselt penupc?\nself. direction - random choice ([up, down cett\nb = self. Y Corch-other. Yor()\ndistance\nmath.sqrt (lpy coa\n==  left:\ndx=0\ndy = 24\nelit golf, direction == down:\ndx=0\ndy = 24\nelif self direction\ndx = -24\ndy = 0\nselt. shape Cturtle. intimen (self.move , t randon.randint (100,300),\nit (move to move to y not in walls:\nAgnos\nselt.golo cmove toux, movePg no: 0\nbreasures. append (Treasure (Screen-x, seveen\n& Add a treasures list\ntreasures (\n# Add enemies list\nenemies\n# Add maPanor\nPen = pench\nPlayer players\nI create wall coordinate list\nwalls []\nsetup-mare Elevels ti]) (# set up the love))\n# KeyboaPg mot\nPrint (Player dies!)\n# update screen\nwn.update (\n

 

If any queries please let me know in the comments

please give me a like it means a lot

I hope you understand thank you..! 

🧑‍🏫 More Questions