Re: [mad-railers] Ruby Quiz

From: Brian S.
Sent on: Thursday, September 6, 2012 7:34 PM
Hey Chris, cool idea and I spent way too much time playing with blackjack simulators instead of working :)


I implemented a strategy object that we can swap out to control the rules that each player plays by.  It's pretty cool to see a real strategy beat the socks off of just randomly hitting or standing:

Xandra:rubyquiz-blackjack bsamson$ ruby play.rb[masked] RandomStrategy
Using strategy: RandomStrategy

====== Done! ======
Games played: [masked]
Games won: 29831
Win rate: [masked]%

Xandra:rubyquiz-blackjack bsamson$ ruby play.rb[masked] WikipediaStrategy

Using strategy: WikipediaStrategy

====== Done! ======
 Games played:  100000
 Games won:  43175
 Win rate:  [masked]%


I do feel like the strategies are limited until we have betting, because the games rely on 3:2 payouts and doubling down and such in order to get closer to a break-even game. I'd love to see someone pick up where I left off.

Cheers, 
Brian

On Thu, Sep 6, 2012 at 8:09 AM, Chris Johnson <[address removed]> wrote:
Here is my solution so far.
https://github.com/johnsonch/rubyquiz-blackjack  I got to spend most
of my time working on this at the lake with no internet access, which
in my opinion was a great way to work on this.

-CJ

On Thu, Sep 6, 2012 at 8:06 AM, Chris Johnson <[address removed]> wrote:
> It looks like you have to send these messages via the email account
> you have hooked up with meetup.com.  Below is the ruby quiz (I know
> it's late) for this week, powered by Damon.
>
> -CJ
>
> First off, I'd like to welcome MadRailers to our (usually) weekly Ruby
> Quiz! Per last Monday's meeting, I've been "assigning" a quiz to to
> coworkers, which we then discuss the following Wednesday at lunch. If
> you're interested in solving the problem, please feel free to discuss
> it or post your solution to the list.
>
> On to this week's challenge, which was suggested by Chris Johnson: Blackjack!
>
> Simple enough. Write a program where you, the user, are up against the
> house in as many hands of blackjack as you are interested in playing.
> How closely you wish to hew to casino-style play (i.e., using a
> multi-deck shoe) is up to you.
>
> Good luck!
>
> ~Damon
>
>
>
> --
> Please Note: If you hit "REPLY", your message will be sent to everyone on this mailing list ([address removed])
> http://www.meetup.com/Mad-Railers/
> This message was sent by Chris Johnson ([address removed]) from Mad-Railers.
> To learn more about Chris Johnson, visit his/her member profile: http://www.meetup.com/Mad-Railers/members/8960662/
> Set my mailing list to email me
>
> As they are sent
> http://www.meetup.com/Mad-Railers/list_prefs/?pref=1
>
> In one daily email
> http://www.meetup.com/Mad-Railers/list_prefs/?pref=2
>
> Don't send me mailing list messages
> http://www.meetup.com/Mad-Railers/list_prefs/?pref=0
> Meetup, PO Box 4668 #37895 New York, New York[masked] | [address removed]
>



--
Please Note: If you hit "REPLY", your message will be sent to everyone on this mailing list ([address removed])
http://www.meetup.com/Mad-Railers/
This message was sent by Chris Johnson ([address removed]) from Mad-Railers.
To learn more about Chris Johnson, visit his/her member profile: http://www.meetup.com/Mad-Railers/members/8960662/
Set my mailing list to email me

As they are sent
http://www.meetup.com/Mad-Railers/list_prefs/?pref=1

In one daily email
http://www.meetup.com/Mad-Railers/list_prefs/?pref=2

Don't send me mailing list messages
http://www.meetup.com/Mad-Railers/list_prefs/?pref=0
Meetup, PO Box 4668 #37895 New York, New York[masked] | [address removed]


Sign up

Meetup members, Log in

By clicking "Sign up" or "Sign up using Facebook", you confirm that you accept our Terms of Service & Privacy Policy