1. Home
  2. Computing & Technology
  3. C / C++ / C#

Programming Challenge 5 - Solve A Crossword

Now Completed

By David Bolton, About.com

Programming Challenge 5
This time you have a ten x ten grid and a list of 14 words. The challenge is to write a program in C, C++ or C# that fits the words together in the grid, i.e. like a crossword puzzle.

The winning entry must fit the words in so that the number of blanks is maximized. There are 68 letters in the words which are listed below but they only occupy 52 squares in my grid so there are 48 blanks. You don't have to get this answer but the one which occupies the least squares (i.e. has the highest number of blanks) is the winner.

  • As
  • Be
  • Cover
  • Elderly
  • Evil
  • Fire
  • Hen
  • Invalid
  • Merry
  • Railway
  • Recovery
  • Roads
  • Tred
  • Worry
Words run left to right or top to bottom. Words can start or end in other words, BUT you cannot have two words next to each other horizontally or vertically.
Evil
l
d
e
r
l
y
Is ok, but
EEvil
l
d
e
r
l
y
is not.
EE
vl
id
le
r
l
y
is not allowed either.
However,
 Evil
E
l
d
e
r
l
y
is ok. The two Es are not next to each other horizontally or vertically.

Entering This Programming Challenge

You have to submit your application's source code to cplus.guide@about.com?subject=Programming Challenge 5.

The program (either GUI or Command line is ok) should print out the ten x ten grid of words and show the number of squares occupied by your letters and the number of unused (ie blank). It might look like this.

Total Grid Squares used = 52
Blanks Squares = 48

Rules

This is for glory only. About.com does not permit prizes to be given.

Please submit your source code to the cplus.guide@about.com?subject=Programming Challenge 5 email address with the subject line Programming Challenge 5. It must compile with Open Watcom, Microsoft Visual C++ 2005 Express Edition/Microsoft Visual Studio 2003/2005 or Borland Turbo C++ Explorer, Microsoft Visual C# 2005 Express Edition. If it doesn't compile, it can't be run so is automatically disqualified

Please include your name, age (optional), blog/website url (optional) and country. Your email address will not be kept, used or displayed except to acknowledge your challenge entry. You can submit as many entries as you like before the deadline which is October 31 2007.

The ten entries with the highest number of blanks will be listed. A condition of entry is that you allow your source code to be published on this website, with full credits to you as the author.

Have fun!

More Programming Challenges

Explore C / C++ / C#

More from About.com

  1. Home
  2. Computing & Technology
  3. C / C++ / C#
  4. Projects
  5. Programming Challenges
  6. Programming Challenge 5 - Solve A Crossword

©2008 About.com, a part of The New York Times Company.

All rights reserved.