Live data from Hacker News

Slack Poker Bot

github.com

41–50 of 100 posts

Re: Slack Poker Bot

#42

The title confused me for a minute. In IRC chat circles, "bot" means a persistent software entity running in the channel, performing some task. In online poker circles, "bot" means software that automatically plays for you.

This has support for both!

Re: Slack Poker Bot

#43
post #23

Earlier quoted context omitted.

why not use a generic chatbot like errbot ( http://errbot.net [shameless plug alert]) and get all the backends (hipchat, IRC, XMPP etc...) for free ? there are existing poker AIs in python to integrate with: https://github.com/mikaelbr/AI-Poker-Player

Because the fun part was writing the game logic, not the glue code. ;)

it was re:the comment, not the OP. I totally understand :)

Re: Slack Poker Bot

#44

Earlier quoted context omitted.

Just a way better interface on it. Searchable history, multiple rooms inside rooms effectively. File sharing, lots of niceties that are probably possible in IRC but would take a lot of work. It has changed the way our team communicates, for me I am the only remote guy on a team of 6ish devs. I can pick and choose my hours, work when other guys are off, and still see all the comms that happened while I wasn't at my ma…

> I can pick and choose my hours, work when other guys are off, and still see all the comms that happened while I wasn't at my machine. I'm sure are features IRC cannot duplicate, but all that's necessary for that is a bouncer.

True, and I use a bouncer myself, but it's something you have to set up explicitly - Slack already does it for you. Notifications as well - you can get emails, or texts, or the app on your phone can ping you.

And sure, a bouncer with some plugins could do it, but you'd have to set it all up. I've had "have bouncer email me when I'm mentioned in a channel" as a mental to-do for the past five years, and it's never been a high-enough priority for me to sit down and expend the minimum of two hours it would take (and likely much more.)

Re: Slack Poker Bot

#46
Am I correct in saying that the shuffle algorithm is flawed? It looks to me like it swaps each card iteratively with a random card in the deck. This means that some cards are likely shuffled more times that others, and some sequences are then more common than others.

https://github.com/CharlieHess/slack-poker-bot/blob/master/s...

Re: Slack Poker Bot

#47

Am I correct in saying that the shuffle algorithm is flawed? It looks to me like it swaps each card iteratively with a random card in the deck. This means that some cards are likely shuffled more times that others, and some sequences are then more common than others. https://github.com/CharlieHess/slack-poker-bot/blob/master/s...

Yes, you're correct. It should swap with cards that are strictly at later positions in the deck:

Deck.getRandomInt(index+1, numberOfCards)

instead of

Deck.getRandomInt(0, numberOfCards)

Re: Slack Poker Bot

#49
Tried it - it crashed for both games we tried. Then again, installing node on my box was a mess - we have some sort of proxy on apt-get that insisted on installing an old version. I probably screwed up somehow.

Edit: https://github.com/CharlieHess/slack-poker-bot/issues/14 https://github.com/CharlieHess/slack-poker-bot/issues/22

Glad I'm not the only one.

Re: Slack Poker Bot

#50

Am I correct in saying that the shuffle algorithm is flawed? It looks to me like it swaps each card iteratively with a random card in the deck. This means that some cards are likely shuffled more times that others, and some sequences are then more common than others. https://github.com/CharlieHess/slack-poker-bot/blob/master/s...

Thanks for spotting that! Fixed here: https://github.com/CharlieHess/slack-poker-bot/commit/332f39...
Post reply on HN