Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

For this project, you will recreate the game Wordle. First, your program should pick a random 5-letter word from the list of words. After that,

For this project, you will recreate the game Wordle. First, your program should pick a random 5-letter word from the list of words. After that, the user begins guessing.

For each guess, first check if it is a 5-letter word in the list of words. If not, tell the user that their guess is invalid. If the guess is valid, print it back with incorrect letters replaced by hyphens, correct letter in the incorrect location in lowercase, and correct letters in the correct location in uppercase.

Special Case: If a letter appears in a guess more times than it appears in the answer, only print the letter as many times as it occurs in the answer. Give priority first to letters in the correct location and then to letters earlier in the guess.

The game ends once the user answers correctly. - Answer in JAVA language. Example of output:

Enter a guess: llama l-a--

Enter a guess: bagel -A--l

Enter a guess: egret -----

Enter a guess: spurt S----

Enter a guess: sails SA-l

Enter a guess: salad SAL--

Enter a guess: salty SAL--

Enter a guess: salon SALo

Enter a guess: salvo

SALVO

"wordlist.txt" file words:

abaca

abacas

abacate

abacaxi

abacay

abaci

abacinate

abacination

abacisci

abaciscus

abacist

aback

abacli

abacot

abacterial

abactinal

abactinally

abaction

abactor

abaculi

abaculus

abacus

abacuses

abada

abaddon

abadejo

abadengo

abadia

abaff

abaft

abaisance

abaised

abaiser

abaisse

abaissed

abaka

abakas

abalation

abalienate

abalienated

abalienating

abalienation

abalone

abalones

abamp

abampere

abamperes

abamps

aband

abandon

abandonable

abandoned

abandonedly

abandonee

abandoner

abandoners

abandoning

abandonment

abandonments

abandons

abandum

abanet

abanga

abannition

abapical

abaptiston

abaptistum

abarthrosis

abarticular

abarticulation

abas

abase

abased

abasedly

abasedness

abasement

abasements

abaser

abasers

abases

abash

abashed

abashedly

abashedness

abashes

abashing

abashless

abashlessly

abashment

abashments

abasia

abasias

abasic

abasing

abasio

abask

abassi

abastard

abastardize

abastral

abatable

abatage

abate

abated

abatement

abatements

abater

abaters

abates

abatic

abating

abatis

abatised

abatises

abatjour

abatjours

abaton

abator

abators

abattage

abattis

abattised

abattises

abattoir

abattoirs

abattu

abattue

abature

abaue

abave

abaxial

abaxile

abay

abayah

abaze

abb

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

Recommended Textbook for

Learning MySQL Get A Handle On Your Data

Authors: Seyed M M Tahaghoghi

1st Edition

0596529465, 9780596529468

More Books

Students also viewed these Databases questions

Question

Explain the factors influencing consumer behaviour.

Answered: 1 week ago