S
Subvertir
Rising Star
Bronze Level
Hey guys,
I'm currently developing a port of the PokerEval library to Objective-C as well as a set of MacRuby bindings to accompany that project. My goal is to make the easiest-to-use and fastest poker utility library available by taking advantage of MacOS-specific features like Grand Central Dispatch. I'm also focused on developing features for less popular games that I prefer playing, like no limit 2-7 single/triple draw and badugi.
Nothing is in a state where it'd be usable to non-programmers, but it's non-commercial and 100% free to play around with.
Both projects are available under the GPLv3 at:
http://github.com/erudified/RubyGrinder
http://github.com/erudified/ObjectiveEval
They're very young, under a month old, but they're rapidly becoming usable. I'm trying to create Ruby on Rails like API for dealing with poker games - check out this example to see what I mean.
When ran in a terminal, this code will output (edited slightly for formatting):
I'm currently developing a port of the PokerEval library to Objective-C as well as a set of MacRuby bindings to accompany that project. My goal is to make the easiest-to-use and fastest poker utility library available by taking advantage of MacOS-specific features like Grand Central Dispatch. I'm also focused on developing features for less popular games that I prefer playing, like no limit 2-7 single/triple draw and badugi.
Nothing is in a state where it'd be usable to non-programmers, but it's non-commercial and 100% free to play around with.
Both projects are available under the GPLv3 at:
http://github.com/erudified/RubyGrinder
http://github.com/erudified/ObjectiveEval
They're very young, under a month old, but they're rapidly becoming usable. I'm trying to create Ruby on Rails like API for dealing with poker games - check out this example to see what I mean.
Code:
#!/usr/bin/env macruby
require "../lib/rubygrinder"
# Create and enumerate ev for all hands in a 9-handed texas holdem game
# These hashes represent our players
albert = { :pstar_name => "Albert", :ftilt_name => "Albert", :stack => 1000 }
bob = { :pstar_name => "Bob ", :ftilt_name => "Bob ", :stack => 1000 }
carol = { :pstar_name => "Carol ", :ftilt_name => "Carol ", :stack => 1000 }
dave = { :pstar_name => "Dave ", :ftilt_name => "Dave ", :stack => 1000 }
edward = { :pstar_name => "Edward", :ftilt_name => "Edward", :stack => 1000 }
fred = { :pstar_name => "Fred ", :ftilt_name => "Fred ", :stack => 1000 }
gerald = { :pstar_name => "Gerald", :ftilt_name => "Gerald", :stack => 1000 }
hiro = { :pstar_name => "Hiro ", :ftilt_name => "Hiro ", :stack => 1000 }
iota = { :pstar_name => "Iota ", :ftilt_name => "Iota ", :stack => 1000 }
full_opts = {
# cards are dealt to players in seats
# the players perform actions on each round of betting
:seats => [
{ :cards => ['9d','9h'], :person => albert },
{ :cards => ['2h','7s'], :person => bob },
{ :cards => ['Ad','7d'], :person => carol },
{ :cards => ['2d','9c'], :person => dave },
{ :cards => ['3d','8c'], :person => edward },
{ :cards => ['As','Ac'], :person => fred },
{ :cards => ['8s','8h'], :person => gerald },
{ :cards => ['7h','6h'], :person => hiro },
{ :cards => ['6d','Qc'], :person => iota }
],
:board => {
:flop => ['6s','8d', 'Qh'],
:turn => ['Kh'],
:river => ['Qd']
},
# The button is on carol
:button_position => 2
}
# create a game instance
game = RubyGrinder::Poker::Games::Holdem.new(full_opts)
puts "Instantiated Holdem..." if game
# Take a look at what we've done so far
puts "Dealt #{game.deck.dealt.num_cards} hole cards..."
(0..game.seat.length-1).each{|i|
puts "#{game.seat[i].pstar_name} has cards: #{game.seat[i].cm}"
}
puts "All dealt cards : #{game.deck.dealt}"
puts "Remaining cards : #{game.deck.remaining}"
}
Code:
amnesiac:examples alex$ ./test.rb
Instantiated Holdem...
Dealt 18 hole cards...
Albert has cards: 9d 9h
Bob has cards: 7s 2h
Carol has cards: Ad 7d
Dave has cards: 2d 9c
Edward has cards: 3d 8c
Fred has cards: As Ac
Gerald has cards: 8s 8h
Hiro has cards: 7h 6h
Iota has cards: 6d Qc
All dealt cards : As 8s 7s Ad 9d 7d 6d 3d 2d Ac Qc 9c 8c 9h 8h 7h 6h 2h
Remaining cards : Ks Qs Js Ts 9s 6s 5s 4s 3s 2s Kd Qd Jd Td 8d 5d 4d Kc Jc Tc 7c 6c 5c 4c 3c 2c Ah Kh Qh Jh Th 5h 4h 3h