[Purdue-pm] Possible February Challenge

Dave Jacoby jacoby at purdue.edu
Tue Jan 19 12:03:14 PST 2010


This is one I heard on NPR quite some time ago.

Take the phrase "Pre-Christmas Sale". Break it up into a 4x4 block.

	P R E C
	H R I S
	T M A S
	S A L E

The challenge was to find the longest word you can find within this 
block. You can go up-down, left-right or diagonally. You cannot reuse a 
letter, but you can "cross the stream". Meaning, if there was such a 
word as "AESL", assuming "P" as element[0][0] of this array of arrays,
that would be [3,3], [4,4], [3,4], [4,3] (or vice versa, depending on 
how you count) and perfectly legitimate. Basically, we're programming 
the computer to play Boggle.

Using my canon, there are 6 eight-letter words and no nine-letter words.
Running `time scramble.pl` on my desktop, I got this:
	real	6m21.935s
	user	2m54.799s
	sys	0m1.620s

Anyone up for this challenge?

-- 
Dave Jacoby                         Address: WSLR S049
Genomics Core Programmer            Mail:    jacoby at purdue.edu
Purdue University                   Jabber:  jacoby at jabber.org
                                     Phone:   765.49.67368


More information about the Purdue-pm mailing list