Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

. . . . . Exercise #5: Write a guessing game. The goal of the game is to guess a list of Strings in a

image text in transcribed
. . . . . Exercise #5: Write a guessing game. The goal of the game is to guess a list of Strings in a file for the strings: Assume the length of each string is 4. Each String is a sequence of English letters. These letters are a subset from the set (A, B, C, D, E, F). Each line represents a sequence String. The number of sequences does not have a specific limit. For the players: Two players and guesses are looping between them. The guess is a sequence String. The sequence is a subset from the set {A, B, C, D, E, F}. The player can keep entering guesses unit the exit request (this can give the ability for competition) To count the points: The player gets 100 points for each exact match with one of the sequences. An exact match means the guess and the game sequence have the same letters and the same order. The player gets 50 points for each semi-match with one of the sequence s. Semi-match means the guess and the game sequence have the same letters but in a different order. The player gets 20 points to guess if at least one letter from the guess has the same existence and order of one of the game sequences. The player gets 10 points for a guess if at least one letter from the guess has the same existence but differ in the order of one of the game sequence. . . . . Sample input file: ABCD FDEA EBAF ABFD BCDF CDFE EABC Sample input/output: Player 1. Please enter your guess : ABCD Score of player 1 is: 180 Player 2. Please enter your guess EFAB Score of player 2 is: 120 Do you want to exit the game (Y/N)?N Player 1. Please enter your guess FECD Score of player 1 is: 140 Player 2. Please enter your guess: DCBA Score of player 2 is: 140 Do you want to exit the game (Y/N)?Y

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_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

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

Get Started

Recommended Textbook for

Visual C# And Databases

Authors: Philip Conrod, Lou Tylee

16th Edition

1951077083, 978-1951077082

Students also viewed these Databases questions

Question

What does stickiest refer to in regard to social media

Answered: 1 week ago

Question

What are Decision Trees?

Answered: 1 week ago

Question

What is meant by the Term Glass Ceiling?

Answered: 1 week ago