Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Studying Blackjack (#151)

Path: g2news1.google.com!news4.google.com!feeder3.cambrium.nl!feed.tweaknews.nl!83.80.28.12.MISMATCH!multikabel.net!newsfeed10.multikabel.net!news.astraweb.com!border1.a.newsrouter.astraweb.com!feed.xsnews.nl!border-1.ams.xsnews.nl!217.145.39.3.MISMATCH!talisker.lacave.net!lacave.net!not-for-mail
From: James Gray <ja...@grayproductions.net>
Newsgroups: comp.lang.ruby
Subject: Re: [QUIZ] Studying Blackjack (#151)
Date: Wed, 9 Jan 2008 22:36:54 -0500
Organization: Service de news de lacave.net
Lines: 26
Message-ID: <5921330A-8179-44F3-BC87-D8A1AE64255A@grayproductions.net>
References: <20080104130437.GOQY129.eastrmmtao101.cox.net@eastrmimpo02.cox.net> <dab969790801060742x8ce965cqa859df9c0c9ac221@mail.gmail.com> <D47802D2-6BB9-43EC-B276-75FE37EB4202@grayproductions.net> <dab969790801091552r5563d78en2794cf60603297b8@mail.gmail.com>
NNTP-Posting-Host: bristol.highgroove.com
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
X-Trace: talisker.lacave.net 1199936233 5533 65.111.164.187 (10 Jan 2008 03:37:13 GMT)
X-Complaints-To: abuse@lacave.net
NNTP-Posting-Date: Thu, 10 Jan 2008 03:37:13 +0000 (UTC)
In-Reply-To: <dab969790801091552r5563d78en2794cf60603297b8@mail.gmail.com>
X-Received-From: This message has been automatically forwarded from the ruby-talk mailing list by a gateway at comp.lang.ruby. If it is SPAM, it did not originate at comp.lang.ruby. Please report the original sender, and not us. Thanks! For more details about this gateway, please visit: http://blog.grayproductions.net/categories/the_gateway 
X-Mail-Count: 286900
X-Ml-Name: ruby-talk
X-Rubymirror: Yes
X-Ruby-Talk: <5921330A-8179-44F3-BC87-D8A1AE642...@grayproductions.net>

On Jan 9, 2008, at 5:52 PM, Sander Land wrote:

> On Jan 9, 2008 9:10 PM, James Gray <ja...@grayproductions.net> wrote:
>> On Jan 6, 2008, at 9:42 AM, Sander Land wrote:
>>
>>> class Array
>>> def score
>>>   sort.inject(0){|s,c| s+c > 21 && c==11 ? s+1 : s+c }
>>> end
>>> end
>>
>> That has the some bug Eric found in Dennis's code:
>>
>>>> [10, 11, 11].score
>> => 22
>
> Thanks. I should have thought of this considering Dennis' results  
> matched mine.
> Here's my corrected solution. I renamed the ace to "1" for a more
> elegant solution.  :)

Neat.  Just know that I wrote tomorrow's summary before you did  
this.  ;)

James Edward Gray II