[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Re: [QUIZ] Chess960 (#106

Gavin Kistner

12/18/2006 4:19:00 PM

From: Dave Burt [mailto:dave@burt.id.au]
> <<-END
> a b c d e f g h
> +-----------------+
> 8 | #{ top_row } | 8
> 7 | p p p p p p p p | 7
> 6 | | 6
> 5 | | 5
> 4 | | 4
> 3 | | 3
> 2 | P P P P P P P P | 2
> 1 | #{ bottom_row } | 1
> +-----------------+
> a b c d e f g h
> END

Just gotta say, that's pretty brain-dead tricky. To produce the same
output, I'm sure I would have some a bunch of mapping and joining and
iterating and thought I was tricky when I wrote "P "*8.

I particularly like how you've used extra whitespace inside the
interpolation block to preserve the monospace markup. Well done! :)

1 Answer

James Gray

12/18/2006 4:27:00 PM

0

On Dec 18, 2006, at 10:19 AM, Gavin Kistner wrote:

> From: Dave Burt [mailto:dave@burt.id.au]
>> <<-END
>> a b c d e f g h
>> +-----------------+
>> 8 | #{ top_row } | 8
>> 7 | p p p p p p p p | 7
>> 6 | | 6
>> 5 | | 5
>> 4 | | 4
>> 3 | | 3
>> 2 | P P P P P P P P | 2
>> 1 | #{ bottom_row } | 1
>> +-----------------+
>> a b c d e f g h
>> END
>
> Just gotta say, that's pretty brain-dead tricky. To produce the same
> output, I'm sure I would have some a bunch of mapping and joining and
> iterating and thought I was tricky when I wrote "P "*8.
>
> I particularly like how you've used extra whitespace inside the
> interpolation block to preserve the monospace markup. Well done! :)

Yeah, I thought that was darn clever as well.

James Edward Gray II