Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Advanced level school Python programming. need helps. Your task is to implement the Choose your own ending adventure game using socket programming. In this game,

Advanced level school Python programming. need helps.

image text in transcribed

image text in transcribed

Your task is to implement the "Choose your own ending adventure" game using socket programming. In this game, the server program sends the adventure scena and 2 possible options to the client program. The server program then sends the next adventure scenario based on the option chosen by the client program. The scenario used by the server program can be found in "Task2b.txt". Each line in the file consists of an adventure scenario and two options in the following format. -, -, - For example, the first three lines of "Task2b.txt" are as follows. 1-You arrive at the jungle and start walking. You come across a fork in the road.,2Take the left path,3-Take the right path 2-You take the left path and come across a river.,4-Try to swim across,5-Look for a bridge 3-You take the right path and come across a cave.,6-Enter the cave,9-Keep walkin The server program begins the game using the first line. It sends the following scenario and options to the client. Scenario "You arrive at the jungle and start walking. You come across a fork in the road." Options "Take the left path" "Take the right path" If the client chooses "Take the left path", the server program will go to line 2 and send the following scenario and options to the client. Scenario "You take the left path and come across a river." Options "Try to swim across" "Look for a bridge" If the client chooses "Take the right path", the server program will go to line 3 and send the following scenario and options to the client. Scenario "You take the right path and come across a cave." Options "Enter the cave" "Keep walking" The server program repeats the above until the client chooses the option - "Give up". Then both server and client program quit successfully. Save your server and client program as Task2b_server.ipynb and Task2b_client.ipynb A screenshot of the client program of 1 possible outcome is below. You arrive at the jungle and start walking. You come across a fork in the road. 1) Take the left path 2) Take the right path Choose 1 or 2: 2 You take the right path and come across a cave. 1) Enter the cave 2) Keep walking Choose 1 or 2: 2 Your adventure ends with no excitment. 1) Start Over 2) Give Up Choose 1 or 2: 2 Quitted

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions