8/1/2022

R Poker

56
[This article was first published on Modern Toolmaking, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here) Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

R Pokerstars

The latest tweets from @NutsrPoker. R/poker: Shuffle up and deal! Official subreddit for all things poker. Press J to jump to the feed. Press question mark to learn the rest of the keyboard shortcuts. Buster Banks is a new online casino for 2020 where casino fans can enjoy the advantages of Trustly’s Pay N R Poker Play payment service and benefit from no registration and instant withdrawals.

There’s already a lot of great posts out there about poker hand evaluators, so I’ll keep this short. Kenneth J. Shackleton recently released a very slick 5-card and 7-card poker hand evaluator called SpecialK. This evaluator is licensed under GPL 3, and is described in detail in 2 blog posts: part 1 and part 2. Since the provided code is open source, I felt free to hack around with it a bit, and ported the python source to R.


You can download my code from github, and save it to ~/SpecialK/R. Run the following script to initialize the evaluator and test it out. Higher numbers=better hands.

Welcome to PKR Poker. Welcome to the best online resource for information on PKR Poker, one of the world’s top online poker rooms with amazing 3D graphics.On this site, you’ll find all the information you need to get the most out of your online experience, including everything you need to know about PKR.com. 01:35:42.308 MSG Version 6.27: Win64: G6-24513 01:35:42.322 MSG Connecting to wss://www.realdealpokerh20.net:8088. 01:35:42.353 MSG WebSocket Connection Error 01.

My R code is almost identical to the python source, as all I did was change python classes to R lists and make the lists 1-indexed (R) rather than 0-indexed (python). I also used the wonderful bitops package for bitwise operations. Obviously this code should be vectorized, but I don’t have time to do that right now. I also used the “compiler” package to speed things up somewhat, but the “SevenEval” file still takes a long time to load.
Right now, I’m getting about 18,000 hands per second on my core i5 laptop, which is pretty crappy compared to the 250 million hands per second Shackleton reports for the C++ version. Vectorization should further increase performance, but I don’t think pure R is ever going to approach C++ in terms of raw speed. While this was a fun port to make, I think this code is an obvious candidate for a re-write using the Rcpp package.
I’m interested to see how far the pure R code can be optimized.

R/pokerrrr2


Related

To leave a comment for the author, please follow the link and comment on their blog: Modern Toolmaking.

R/pokerbros

R-bloggers.com offers Pokerdaily e-mail updates

R/poker

about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job. Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.
haeplansorta1986.netlify.com – 2021