Friday Fun Problem: Floor Plans With Perl

David Cantrell david at cantrell.org.uk
Fri Dec 5 12:54:53 GMT 2008


On Fri, Dec 05, 2008 at 08:26:15AM +0000, Greg McCarroll wrote:

> So say my room is like this
> 
>     B
>    /|
>   A |
>   | |
>   D-C
> 
> I might end up with a set of measurements
> 
>   A-B 5
>   B-C 4
>   C-D 3  
>   D-A 4

There are a very large number of shapes with those edge lengths.  You
need an angle too.  And in a lot of houses, they're not *quite* 90
degrees in the corners.  I *think* that in general for an N sided shape
you need N-3 angles along with all the edge lengths.  Some Greek dude
probably proved this 2000 years ago so I'm not going to bother to try.

> However my problem comes when you think of fire places
> 
>   A-----B
>   |     |
>   |     |
>   | F-E |
>   | | | | 
>   H-G D-C
> 
> If I could indicate that CDE was a right turn, could this then be
> solved easily?

That sounds like you want Logo.  I see there are Language::Logo and
Tk::CanvasLogo on the CPAN.

-- 
David Cantrell | http://www.cantrell.org.uk/david

THIS IS THE LANGUAGE POLICE
PUT DOWN YOUR THESAURUS
STEP AWAY FROM THE CLICHE


More information about the london.pm mailing list