View mode: basic / threaded / horizontal-split · Log in · Help
April 16, 2012
D scored well in the Google CodeJam Qualification Round
Although there was very few D contestants (only 15 out of 18365
contestants used D), D scored number 1.

http://go-hero.net/jam/?repost2012

It was only the qualification round, and admittedly, 3 out of 4 problems
were not extremely interesting.

Still, congrats to hos.lyric, - whoever that is (Kenji ?) -, who managed
to submit a perfect solution in 1h55, more than 46 mn before the rank 2.
April 16, 2012
Re: D scored well in the Google CodeJam Qualification Round
On Mon, 16 Apr 2012 09:31:34 -0400, Somedude <lovelydear@mailmetrash.com>  
wrote:

> Although there was very few D contestants (only 15 out of 18365
> contestants used D), D scored number 1.
>
> http://go-hero.net/jam/?repost2012
>
> It was only the qualification round, and admittedly, 3 out of 4 problems
> were not extremely interesting.
>
> Still, congrats to hos.lyric, - whoever that is (Kenji ?) -, who managed
> to submit a perfect solution in 1h55, more than 46 mn before the rank 2.
>

This is cool!  I still have my google code jam T-shirt from '03 when it  
was done through TopCoder.

I'm glad D is getting some traction there.  I would caution however, from  
my past experience, that looking at how well one language does vs. another  
is extremely subjective -- really good coders can do really well no matter  
what language they use.  But what *is* important is that a really good  
coder chose D for his/her language.  That gets people interested.

-Steve
April 16, 2012
Re: D scored well in the Google CodeJam Qualification Round
IMHO this is worth D.announce :)
April 16, 2012
Re: D scored well in the Google CodeJam Qualification Round
Somedude:
> Although there was very few D contestants (only 15 out of 18365
> contestants used D), D scored number 1.

This is very good advertisement for D.

A D user (group) has to reach a good score in the ICFP 
Programming Contest too :-)

And why is D so popular in Japan? :-)

Bye,
bearophile
April 16, 2012
Re: D scored well in the Google CodeJam Qualification Round
On Monday, 16 April 2012 at 14:02:21 UTC, bearophile wrote:
> Somedude:
>> Although there was very few D contestants (only 15 out of 18365
>> contestants used D), D scored number 1.
>
> This is very good advertisement for D.
>
> A D user (group) has to reach a good score in the ICFP 
> Programming Contest too :-)
>
> And why is D so popular in Japan? :-)
>
> Bye,
> bearophile

I dunnow, but Japan Superior when it comes to speed coding. Last 
year's winner was a Japanese, and here, the two top contenders 
are also Japanese.
Looking at last year's stats, hos.lyric didn't fare too badly, 
but he failed to get to the final. Hope he'll continue to bear 
the D colors high, the Force is strong in this one. :)
April 16, 2012
Re: D scored well in the Google CodeJam Qualification Round
Le 16/04/2012 15:51, Steven Schveighoffer a écrit :
> On Mon, 16 Apr 2012 09:31:34 -0400, Somedude
> <lovelydear@mailmetrash.com> wrote:
> 
>> Although there was very few D contestants (only 15 out of 18365
>> contestants used D), D scored number 1.
>>
>> http://go-hero.net/jam/?repost2012
>>
>> It was only the qualification round, and admittedly, 3 out of 4 problems
>> were not extremely interesting.
>>
>> Still, congrats to hos.lyric, - whoever that is (Kenji ?) -, who managed
>> to submit a perfect solution in 1h55, more than 46 mn before the rank 2.
>>
> 
> This is cool!  I still have my google code jam T-shirt from '03 when it
> was done through TopCoder.
> 
> I'm glad D is getting some traction there.  I would caution however,
> from my past experience, that looking at how well one language does vs.
> another is extremely subjective -- really good coders can do really well
> no matter what language they use.  But what *is* important is that a
> really good coder chose D for his/her language.  That gets people
> interested.
> 
> -Steve

Indeed, some really good coders could do it in any language. From reddit,

"I submitted a polyglot program in vim, dc, brainfuck, bash, bc, php,
whitespace, c, c++, befunge-98, golfscript, python3 and ruby. The first
seven languages were for the contest problems, befunge doesn't do much,
and the mainstream languages (+golfscript) are all quines.

http://www.go-hero.net/jam/12/name/Nabb
"
And this guy still managed to rank 73rd.
April 16, 2012
Re: D scored well in the Google CodeJam Qualification Round
Steven Schveighoffer:

> I would caution however, from my past experience, that looking 
> at how well one language does vs. another is extremely 
> subjective -- really good coders can do really well no matter 
> what language they use.

But the "Hall of Mirrors"-large Haskell solution by tmoHaskell is 
elegant:
http://codepad.org/bxf3CYwW
http://www.go-hero.net/jam/12/name/tmoHaskell

That contains simple usage of pattern matching on values:

nextCell :: Hall -> (Int,Int) -> (Int,Int) -> (Ratio Int,Ratio 
Int)
            -> Maybe ((Int,Int), (Int,Int), (Ratio Int,Ratio Int))
nextCell hall (vx,vy) (ix,iy) (x,y) = do
    ((vx',ix',x'),(vy',iy',y')) <- case (x,y) of
        (0,0) -> corner (-1) (-1)
        (0,1) -> corner (-1)   1
        (1,0) -> corner   1  (-1)
        (1,1) -> corner   1    1
        (0,_) -> hitHorizontal (-1)
        (1,_) -> hitHorizontal 1
        (_,0) -> hitVertical (-1)
        (_,1) -> hitVertical 1
    return ((vx',vy'),(ix',iy'),(x',y'))


Switch on structs are useful:
http://d.puremagic.com/issues/show_bug.cgi?id=596

(1,_) -> hitHorizontal 1

becomes something like:

case tuple(1,void): r = hitHorizontal(1); break;

Or:
case tuple(1,_): r = hitHorizontal(1); break;

------------------------

One Scala solution to the "Speaking in Tongues" contains:

val map = new TreeMap[Char, Char]
    " abcdefghijklmnopqrstuvwxyz".zip(" 
yhesocvxduiglbkrztnwjpfmaq").foreach(x => map.put(x._1, x._2))


That in Python you write with just:

>>> dict(zip(" abcdefghijklmnopqrstuvwxyz", " 
>>> yhesocvxduiglbkrztnwjpfmaq"))
{' ': ' ', 'a': 'y', 'c': 'e', 'b': 'h', 'e': 'o', ...

It's handy to have a similar AssociativeArray from pairs iterable 
in Phobos too (or even in object).

Bye,
bearophile
April 16, 2012
Re: D scored well in the Google CodeJam Qualification Round
On Monday, 16 April 2012 at 13:31:32 UTC, Somedude wrote:
> Although there was very few D contestants (only 15 out of 18365
> contestants used D), D scored number 1.
>
> http://go-hero.net/jam/?repost2012

http://www.go-hero.net/jam/12/name/Soultaker
lol, COBOL
April 16, 2012
Re: D scored well in the Google CodeJam Qualification Round
Somedude:
> Although there was very few D contestants (only 15 out of 18365
> contestants used D), D scored number 1.

This D solution of the "hall of mirrors" (modified from C++ code) 
is about 3.5 times faster on the large dataset than hos.lyric 
solution. No GC required, stack allocation wins:
http://codepad.org/TZwGLGjV

Bye,
bearophile
April 17, 2012
Re: D scored well in the Google CodeJam Qualification Round
On Monday, 16 April 2012 at 13:31:32 UTC, Somedude wrote:
> Although there was very few D contestants (only 15 out of 18365
> contestants used D), D scored number 1.
>
> http://go-hero.net/jam/?repost2012

A direct link to the problems: 
https://code.google.com/codejam/contest/1460488/dashboard

David
« First   ‹ Prev
1 2
Top | Discussion index | About this forum | D home