Fun with Boggle

2007-12-06 Thread Brad Greenlee
I haven't written any Perl for fun in a while, but I recently entertained myself a bit by writing a Boggle puzzle solver in Ruby: http://blog.footle.org/2007/12/05/cheating-for-fun/ I'm not sure if this particular puzzle has come up before in FWP, but I was curious as to how closely this yak

Re: P2P in 15 lines

2004-12-16 Thread Brad Greenlee
Doh! Somebody beat me to it. Didn't use IO::Socket either: http://developers.slashdot.org/article.pl?sid=04/12/15/1953227&tid=95&tid=156&tid=1 -b Sven Neuhaus wrote: Can we beat them (in perl)? http://www.freedom-to-tinker.com/tinyp2p.html

Re: P2P in 15 lines

2004-12-16 Thread Brad Greenlee
Right...I had a version that used crypt on the password at one point, but then realized that was silly; it was no different than just using a plaintext password that looked like gobbleygook. The original python version never actually sends the password in any form; I believe it just uses it to

Re: P2P in 15 lines

2004-12-16 Thread Brad Greenlee
Text::Wrap Time::Local Time::localtime User::grent User::pwent -b On Wed, 15 Dec 2004 22:58:07 -0800 Brad Greenlee <[EMAIL PROTECTED]> wrote: Sorry, forgot to mention that I worked under the assumption that if I used any modules, they had to be part of the standard Perl distribution.

Re: P2P in 15 lines

2004-12-15 Thread Brad Greenlee
Sorry, forgot to mention that I worked under the assumption that if I used any modules, they had to be part of the standard Perl distribution. The only thing that's really lacking compared to the python version is some kind of digest algorithm to avoid sending the password over the wire. -b

Re: P2P in 15 lines

2004-12-15 Thread Brad Greenlee
files, the pattern would be \\.mp3$ The result: 9 lines. If better golfers than I want to try to cut it down, please do. Just be forewarned that mistakes in the code can cause all kinds of garbage to be written to your filesystem. Pasting it below and attaching it. -b # tinyp2p.pl 1.0 by Brad Gre

Re: Dynamically creating a hash for keys()

2004-10-19 Thread Brad Greenlee
PerlMonks is a great place for questions like this: http://www.perlmonks.org/index.pl?node_id=30013 -b Jason Foster wrote: Can anyone help me to understand why this code refuses to compile? Even better, can anyone help fix it :) %hash = qw( fred filntstone barney rubble tom delong ); pri

[golf] Tangled Tale Results

2004-06-29 Thread Brad Greenlee
PROTECTED]&&print"@_ ";([EMAIL PROTECTED])-1||f(@_,$a[$b-1][$_])for 0..1}$,=" ";[EMAIL PROTECTED],[$_&15,($_>>4)+1]for unpack"C*","¸ÈñéËëµîÄòw¶ª";f(1) Brad Greenlee (157) sub f{my($n,$s)[EMAIL PROTECTED];[EMAIL PROTECTED]>30?print"@

[golf] Tangled Tale Leaderboard

2004-06-28 Thread Brad Greenlee
http://www.xs4all.nl/~thospel/golf/rules.html Here are the current standings: 1. Georg Moritz - 150 2. Terje Kristensen - 156 3. Brad Greenlee- 158 4. Tobias Gödderz - 162 I've copied the challenge below in case you don't know what I'm talking about. Once again, I encourage peo

Re: Golf challenge: Tangled Tale

2004-06-26 Thread Brad Greenlee
You're all right. My bad, but as I said, it's been a long time since I've been on this list. My apologies. We'll finish up this little contest and then leave the golfing for the official site. How about 11:59pm GMT on Monday the 28th as the deadline? Send your scores to me, and I'll send out on

Re: error handling in perl modules

2004-06-25 Thread Brad Greenlee
Take a look at Exception::Class http://search.cpan.org/~drolsky/Exception-Class-1.19/lib/Exception/Class.pm -b Babichev Dmitry wrote: Hello, fwp. Could anybody provide the best practices of implementation the error handling in perl modules? Thank you in advance. Dmitry.

Re: Golf challenge: Tangled Tale

2004-06-24 Thread Brad Greenlee
ked them with the initial rules which is not much fun :) sorry for the the off-topic. P! Vladi. On Mon, 21 Jun 2004 00:34:39 +0200 Brad Greenlee <[EMAIL PROTECTED]> wrote: [rejoining this list after a too-long absence...forgive me if by some bizarre chance this or something similar has

Re: Golf challenge: Tangled Tale

2004-06-24 Thread Brad Greenlee
Bowden wrote: On Thu, Jun 24, 2004 at 04:40:29AM +0200, Tobias G?dderz wrote: On Wed, 2004-06-23 at 20:15, Brad Greenlee wrote: First, my current code is down to 221. I got mine down to 213 now. I got mine down to 16. I also think that it's more exiting without knowing the solutions of th

Re: Golf challenge: Tangled Tale

2004-06-23 Thread Brad Greenlee
ly, is any golf happening on this list anymore, or is all the action at http://terje2.perlgolf.org/~pgas/score.pl?func=front ? Cheers, -b A. Pagaltzis wrote: * Brad Greenlee <[EMAIL PROTECTED]> [2004-06-21 00:37]: Golf anyone? My opening shot is 288. * Tobias Gödderz <[EMAIL PROTECTED]

Golf challenge: Tangled Tale

2004-06-20 Thread Brad Greenlee
[rejoining this list after a too-long absence...forgive me if by some bizarre chance this or something similar has already appeared] Hey all... The following has consumed most of my evening, so I thought I'd share the joy. I just came across this puzzle: http://scottkim.com/newmedia/tangledtal

Re: Possible improvements for the next golf apocalypse

2001-12-09 Thread Brad Greenlee
> 4. Hole Difficulty I agree that in general you want "easy" holes, although it might be interesting to throw one or two more difficult ones in there. > 8. Fairness > > I think the key to a fair game is a really tight test program > on day one (tsanta.pl had too many holes). It is ideal if you >

RE: The Santa Claus Golf Apocalypse

2001-12-05 Thread Brad Greenlee
What's really stumping me is that there has to be a shorter solution for wc.pl (mine is 23), but I haven't been able to get past the need for printf (at least, not for a shorter solution). Has anyone managed to do it without it? I also vote that we close this soon and unveil the winners. I have a

RE: The Santa Claus Golf Apocalypse

2001-12-03 Thread Brad Greenlee
Here's a question of fair play: does each program have to work for any given text file, or is it ok if it just works on the test cases presented by tsanta? I can shorten my mid.pl by one stroke, and it still passes all the tests, but it will eventually fail when the file reaches a certain size. (

RE: The Santa Claus Golf Apocalypse

2001-12-03 Thread Brad Greenlee
Not to crush anyone's spirits, but I'm pretty sure my 28-stroke mid.pl is still very far away from the likes of Eugene's. I had to send my results (105) in just so I could try to get it off my mind and get some work done...damn you, Santa! -b > -Original Message- > From: Ala Qumsieh [m