Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Re: python coding contest

Reply
Thread Tools

Re: python coding contest

 
 
Simon Hengel
Guest
Posts: n/a
 
      12-25-2005
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

> I'm envisioning lots of convoluted one-liners which
> are more suitable to a different P-language...

I feel that python is more beautiful and readable, even if you write
short programs.

> How about """best compromize between shortness and readibility
> plus elegance of design"""?

I would love to choose those criteria for future events. But I'm not
aware of any algorithm that is capable of creating a ranking upon them.
Maybe we can come up with a solution. Any ideas?

Cheers, Simon.

- --
python coding contest - http://www.pycontest.net/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFDrtFhd4QlweXdn3ERAn7tAJ9PEpOdqyfDhvHo7+TVy7 RravwA/QCg4g9g
TdCYEDqOsL5qxQarsUI7jow=
=/KN6
-----END PGP SIGNATURE-----
 
Reply With Quote
 
 
 
 
Steven D'Aprano
Guest
Posts: n/a
 
      12-26-2005
On Sun, 25 Dec 2005 18:05:37 +0100, Simon Hengel wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
>> I'm envisioning lots of convoluted one-liners which
>> are more suitable to a different P-language...

> I feel that python is more beautiful and readable, even if you write
> short programs.
>
>> How about """best compromize between shortness and readibility
>> plus elegance of design"""?

> I would love to choose those criteria for future events. But I'm not
> aware of any algorithm that is capable of creating a ranking upon them.



What is your algorithm for determining "shortest" program? Are you
counting tokens, lines or characters? Does whitespace count?


--
Steven.

 
Reply With Quote
 
 
 
 
rbt
Guest
Posts: n/a
 
      12-26-2005
Steven D'Aprano wrote:
> On Sun, 25 Dec 2005 18:05:37 +0100, Simon Hengel wrote:
>
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA1
>>
>>> I'm envisioning lots of convoluted one-liners which
>>> are more suitable to a different P-language...

>> I feel that python is more beautiful and readable, even if you write
>> short programs.
>>
>>> How about """best compromize between shortness and readibility
>>> plus elegance of design"""?

>> I would love to choose those criteria for future events. But I'm not
>> aware of any algorithm that is capable of creating a ranking upon them.

>
>
> What is your algorithm for determining "shortest" program? Are you
> counting tokens, lines or characters? Does whitespace count?
>
>

If whitespace and var names count, these things are going to be ugly
 
Reply With Quote
 
Steven D'Aprano
Guest
Posts: n/a
 
      12-26-2005
On Sun, 25 Dec 2005 19:14:43 -0500, rbt wrote:

> Steven D'Aprano wrote:
>> On Sun, 25 Dec 2005 18:05:37 +0100, Simon Hengel wrote:
>>
>>> -----BEGIN PGP SIGNED MESSAGE-----
>>> Hash: SHA1
>>>
>>>> I'm envisioning lots of convoluted one-liners which
>>>> are more suitable to a different P-language...
>>> I feel that python is more beautiful and readable, even if you write
>>> short programs.
>>>
>>>> How about """best compromize between shortness and readibility
>>>> plus elegance of design"""?
>>> I would love to choose those criteria for future events. But I'm not
>>> aware of any algorithm that is capable of creating a ranking upon them.

>>
>>
>> What is your algorithm for determining "shortest" program? Are you
>> counting tokens, lines or characters? Does whitespace count?
>>
>>

> If whitespace and var names count, these things are going to be ugly


Yes, but the question is, is two lines and 347 characters ugly enough to
win?



--
Steven.

 
Reply With Quote
 
Simon Hengel
Guest
Posts: n/a
 
      12-26-2005
> What is your algorithm for determining "shortest" program? Are you
> counting tokens, lines or characters? Does whitespace count?


like:
$wc -c seven_seg.py

At the moment we have to live with characters, and yes whitespace
characters do count. Sorry for that.

Have fun,

Simon Hengel

--
python coding contest - http://www.pycontest.net/
 
Reply With Quote
 
=?UTF-8?B?QW5kcsOp?= Malo
Guest
Posts: n/a
 
      12-26-2005
* Steven D'Aprano wrote:

> is two lines and 347 characters ugly enough to win?


Nope. 3 lines / 179 chars here >:->
Yes, it's quite unreadable.

(The problem is that I need to find an internet cafe on 28/29th in order to
be able to submit)

nd
--
my @japh = (sub{q~Just~},sub{q~Another~},sub{q~Perl~},sub{q~H acker~});
my $japh = q[sub japh { }]; print join #########################
[ $japh =~ /{(.)}/] -> [0] => map $_ -> () # André Malo #
=> @japh; # http://www.perlig.de/ #
 
Reply With Quote
 
Tim Hochberg
Guest
Posts: n/a
 
      12-26-2005
Steven D'Aprano wrote:
> On Sun, 25 Dec 2005 19:14:43 -0500, rbt wrote:
>
>
>>Steven D'Aprano wrote:
>>
>>>On Sun, 25 Dec 2005 18:05:37 +0100, Simon Hengel wrote:
>>>
>>>
>>>>-----BEGIN PGP SIGNED MESSAGE-----
>>>>Hash: SHA1
>>>>
>>>>
>>>>>I'm envisioning lots of convoluted one-liners which
>>>>>are more suitable to a different P-language...
>>>>
>>>>I feel that python is more beautiful and readable, even if you write
>>>>short programs.
>>>>
>>>>
>>>>>How about """best compromize between shortness and readibility
>>>>>plus elegance of design"""?
>>>>
>>>>I would love to choose those criteria for future events. But I'm not
>>>>aware of any algorithm that is capable of creating a ranking upon them.
>>>
>>>
>>>What is your algorithm for determining "shortest" program? Are you
>>>counting tokens, lines or characters? Does whitespace count?
>>>
>>>

>>
>>If whitespace and var names count, these things are going to be ugly

>
>
> Yes, but the question is, is two lines and 347 characters ugly enough to
> win?
>


No. I have 8 lines and 175 chars at present. And, I expect that's gonna
get beaten.

-tim

 
Reply With Quote
 
Tim Hochberg
Guest
Posts: n/a
 
      12-26-2005

Is it necessary to keep the input parameter as 'input'? Reducing that to
a single character drops the length of a program by at least 8
characters. Technically it changes the interface of the function, so
it's a little bogus, but test.py doesn't check. (Personally I prefer
that if be illegal, but if it's legal I'll have to do it).

-tim

 
Reply With Quote
 
rbt
Guest
Posts: n/a
 
      12-26-2005
Tim Hochberg wrote:
>
> Is it necessary to keep the input parameter as 'input'? Reducing that to
> a single character drops the length of a program by at least 8
> characters. Technically it changes the interface of the function, so
> it's a little bogus, but test.py doesn't check. (Personally I prefer
> that if be illegal, but if it's legal I'll have to do it).
>
> -tim
>


isn't the word 'input' a special word anyway???
 
Reply With Quote
 
Simon Hengel
Guest
Posts: n/a
 
      12-26-2005
> Is it necessary to keep the input parameter as 'input'? Reducing that to
> a single character drops the length of a program by at least 8
> characters. Technically it changes the interface of the function, so
> it's a little bogus, but test.py doesn't check. (Personally I prefer
> that if be illegal, but if it's legal I'll have to do it).


You may change input to something more short, like x. Everything that
passes the test, has a good chance to be accepted.

Cheers,

Simon Hengel

--
python coding contest - http://www.pycontest.net/
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
python coding contest Simon Hengel Python 23 01-02-2006 07:45 AM
Re: python coding contest Jean-Paul Calderone Python 2 12-28-2005 02:49 PM
Re: python coding contest Tim Peters Python 0 12-26-2005 03:28 AM
Re: python coding contest Christian Tismer Python 4 12-26-2005 02:54 AM
Re: python coding contest Tim Hochberg Python 3 12-26-2005 02:54 AM



Advertisments