[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

[FWP] Brief Coding Methods



Hi,

[ A week or two ago I posted something similar to the following to the main
Perl for Win-32 list. I got a few intersting responses but it was suggested
that I send this to the Fun with Perl list instead. I subscribed a week ago
and lurked to ensure that my post wasn't likely to be out-of-line. Seeing as
all seems quiet, I'll post it now. My apologies if this is an general issue
you people have done to death ]

The weekly circular contained a little puzzle. Find a 4 digit number ABCD
and a five digit number EFGHI such that:
	 ABCD / EFGHI = 1 / 66 
such that numbers 1 through 9 are all represented as digits in ABCD and
EFGHI. 

It's not a very interesting puzzle but a colleague taunted that he had
solved it in one line from the command prompt of his HPUX box. I, stuck on a
pesky NT workstation, believed that I could at least get Perl to give the
answer in less characters. My best solution so far weighs in at 74
characters.  Another list Perl for Win32 member has sent me a much improved
73 characters. My work colleague claims he will do better. [He may have the
power Unix; but I have internet email to the desktop, heh  ...] So I'd like
to ask you if you can help improve this. The "rules" appear to be that it
must print the answer by some method that could allow the "66" constant to
be replaced by any other number to yield a similar result (eg "1452/98736 =
1/68"). 

Bonus style points are in order if your code deduces that no such solution
exists (eg "67"). 

Do any obfuscate programmers out there have any tips for me?

If anyone thinks this an interesting question, I'll post my solution and the
current best in a day or two. 

Alistair
--------------------------------------------------------------------
Alistair McGlinchy,         alistair.mcglinchy@marks-and-spencer.com
Sizing and Performance, Central IT  ext. 5012, ph +44 0 171-268-5012
Marks and Spencer (Stockley Park)              fx +44 0 171-268-5721
1SW, 3 Longwalk Rd, Stockley Park, Uxbridge UB11 1AW, United Kingdom


**********************************************************************
This email and any files transmitted with it are confidential and 
intended solely for the use of the individual or entity to whom they   
are addressed. If you have received this email in error please notify 
the system manager.

This footnote also confirms that this email message has been swept by 
MIMEsweeper for the presence of computer viruses.

www.mimesweeper.com
**********************************************************************

==== Want to unsubscribe from Fun With Perl?  Well, if you insist...
==== Send email to <fwp-request@technofile.org> with message _body_
====   unsubscribe