Question: Objective: Write a program that takes a 5x5 array of characters and detects how many words, 2 to 5 letters in length, can be found.

Objective:

Write a program that takes a 5x5 array of characters and detects how many words, 2 to 5 letters in length, can be found. From each letter it is possible to reach every other neighboring letter, but each letter at a given location can only be used once. Check each combination of letters against this simple dictionary.

Example:

Example Dialog:

R A H J M

Y U W W K

R X N F M

Q G E E B

E O A P E

Starting 0 0

Found Word: RAY

Found Word: RAW

Found Word: RUN

Found Word: RUNWAY

Found Word: RUNG

Found Word: RUNGE

Found Word: RUNGE

Found Word: RUNE

Found Word: RUNE

Starting 0 1

Found Word: AR

Found Word: AH

Found Word: AWN

Starting 0 2

Found Word: HA

Found Word: HAY

Found Word: HAW

Found Word: HUN

Found Word: HUNG

Found Word: HUNGRY

Starting 0 3

Starting 0 4

Starting 1 0

Found Word: YAH

Found Word: YAW

Found Word: YAWN

Found Word: YUH

Starting 1 1

Found Word: URGE

Found Word: URGE

Found Word: UN

Starting 1 2

Found Word: WA

Found Word: WAR

Found Word: WARY

Found Word: WAH

Found Word: WAY

Found Word: WU

Starting 1 3

Starting 1 4

Starting 2 0

Found Word: RUN

Found Word: RUNWAY

Found Word: RUNG

Found Word: RUNGE

Found Word: RUNGE

Found Word: RUNE

Found Word: RUNE

Starting 2 1

Starting 2 2

Found Word: NU

Found Word: NW

Found Word: NW

Found Word: NE

Found Word: NEE

Found Word: NEAP

Found Word: NE

Found Word: NEE

Found Word: NEAP

Found Word: NEE

Starting 2 3

Found Word: FM

Found Word: FE

Found Word: FEE

Found Word: FE

Found Word: FEE

Found Word: FEB

Found Word: FEE

Starting 2 4

Found Word: ME

Found Word: MEN

Found Word: MENU

Starting 3 0

Starting 3 1

Found Word: GNU

Found Word: GE

Found Word: GENE

Found Word: GEE

Found Word: GE

Found Word: GO

Found Word: GOA

Found Word: GA

Found Word: GAO

Found Word: GAP

Found Word: GAPE

Found Word: GAPE

Found Word: GAPE

Starting 3 2

Found Word: EX

Found Word: EN

Found Word: ENG

Found Word: EGO

Found Word: EPA

Starting 3 3

Found Word: EN

Found Word: ENG

Found Word: EM

Found Word: EPA

Starting 3 4

Found Word: BMW

Found Word: BE

Found Word: BEN

Found Word: BEE

Found Word: BEEN

Found Word: BEEF

Found Word: BEEP

Found Word: BEE

Found Word: BEEP

Found Word: BP

Found Word: BE

Found Word: BEE

Found Word: BEEN

Found Word: BEEF

Found Word: BEEP

Starting 4 0

Found Word: EGO

Starting 4 1

Starting 4 2

Found Word: AGE

Found Word: AGEE

Found Word: AGE

Found Word: AGO

Found Word: APE

Found Word: APEX

Found Word: APE

Found Word: APE

Starting 4 3

Found Word: PEN

Found Word: PENURY

Found Word: PENURY

Found Word: PEG

Found Word: PEE

Found Word: PEA

Found Word: PEN

Found Word: PENURY

Found Word: PENURY

Found Word: PEE

Found Word: PEA

Found Word: PEE

Found Word: PA

Found Word: PAGE

Found Word: PAGE

Found Word: PEE

Starting 4 4

Found Word: EBEN

Found Word: EPA

dictionary:

10th 1st 2nd 3rd 4th 5th 6th 7th 8th 9th a AAA AAAS Aarhus Aaron AAU ABA Ababa aback abacus abalone abandon abase abash abate abater abbas abbe abbey abbot Abbott abbreviate abc abdicate abdomen abdominal abduct Abe abed Abel Abelian Abelson Aberdeen Abernathy aberrant aberrate abet abetted abetting abeyance abeyant abhorred abhorrent abide Abidjan Abigail abject ablate ablaze able ablution Abner abnormal Abo aboard abode abolish abolition abominable abominate aboriginal aborigine aborning abort abound about above aboveboard aboveground abovementioned abrade Abraham Abram Abramson abrasion abrasive abreact abreast abridge abridgment abroad abrogate abrupt abscess abscissa abscissae absence absent absentee absenteeism absentia absentminded absinthe absolute absolution absolve absorb absorbent absorption absorptive abstain abstention abstinent abstract abstracter abstractor abstruse absurd abuilding abundant abusable abuse abusive abut abutted abutting abysmal abyss Abyssinia AC academe academia academic academician academy Acadia acanthus Acapulco accede accelerate accelerometer accent accentual accentuate accept acceptant acceptor access accessible accession accessory accident accidental accipiter acclaim acclamation acclimate accolade accommodate accompaniment accompanist accompany accomplice accomplish accord accordant accordion accost account accountant Accra accredit accreditate accreditation accretion accrual accrue acculturate accumulate accuracy accurate accusation accusative accusatory accuse accustom ace acerbic acerbity acetate acetic acetone acetylene ache achieve Achilles aching achromatic acid acidic acidulous Ackerman Ackley acknowledge acknowledgeable ACM acme acolyte acorn acoustic acquaint acquaintance acquiesce acquiescent acquire acquisition acquisitive acquit acquittal acquitting acre acreage acrid acrimonious acrimony acrobacy acrobat acrobatic acronym acropolis across acrylate acrylic ACS act Actaeon actinic actinide actinium actinolite actinometer activate activation activism Acton actor actress Acts actual actuarial actuate acuity acumen acute acyclic ad Ada adage adagio Adair Adam adamant Adams Adamson adapt adaptation adaptive add added addend addenda addendum addict Addis Addison addition additional additive addle address addressee Addressograph adduce 
buckeye buckhorn buckle Buckley Bucknell buckshot buckskin buckthorn buckwheat bucolic bud Budapest Budd Buddha Buddhism Buddhist buddy budge budget budgetary Budweiser Buena Buenos buff buffalo buffet bufflehead buffoon bug 

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!