Slack Poker Bot
github.com
github.com
The only reason to make a bet is because of the antes, otherwise you will only play AA, as should everyone else.
Uploading to Imgur for displaying card images to users seems like a strange choice, though. Why not have the bot serve its own images up over HTTP and attach URLs to itself? I could even imagine a badges.io style image preparation microservice that could be shared by several playing-card based bot apps.
On the other hand, preparing hands as a single image seems a bad way of doing this; Does the slack API only allow a single image per conversation? I agree with your preparation microservice idea - There should be (and probably are several) a service that allows you to specify a poker hand as a query string and get back an image of the hand. More simply, though: A webfont and https://en.wikipedia.org/wiki/Playing_cards_in_Unicode
> preparing hands as a single image seems a bad way of doing this
I don't believe there's another way to display them inline?Unicode has playing card codepoints (the full 52) and playing card house codepoints (️, ️, ️, ️).
Edit: What the hell? Hacker News stripped the Unicode characters?! https://news.ycombinator.com/item?id=10156894
https://github.com/CharlieHess/slack-poker-bot/blob/master/s...
Deck.getRandomInt(index+1, numberOfCards)
instead of
Deck.getRandomInt(0, numberOfCards)
I can look into doing this myself and submitting a PR after I get home, as well.
It's random but some results are overrepresented so more likely to occur. If you knew this and bet on this over time you would gain an advantage
Shuffling, by swapping each card with any of the 52 other spots produces 52^52 (i.e. 52 * 52 * 52 * ...) arrangements. How can this be when there are only 52! (i.e. 52 * 51 * 50 * ...) possible arrangements. The answer is than many of the arrangements generated by this shuffling technique end up with the cards in the same order. This follows from the pigeon-hole theorem since 52^52 > 52!
Furthermore, we know that 52^52 is not a multiple of 52! (to see this realize that, for example, 11 divides 52! but not 52^52). Therefore, some bad shuffle generated arrangements will occur more than others and, consequently, that bad shuffle algorithm does not produce a "fair" shuffle.
I'm sure are features IRC cannot duplicate, but all that's necessary for that is a bouncer.
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.)
And, most importantly: I don't have to manage the damned server ;)
But we have shit to build! :)
We have a jira integration set up and every ticket consumes five lines plus plenty of whitespace - a few of those and there's no real comms visible on the page. Every integration I've see consumes gobs of space. Similarly, flagging announcements by assigning a colour is almost worthless - the colour bar isn't very visible (I prefer hipchat's method, where the entire chatline gets the background colour set). Then there's the problem of people's actual chat messages being the least visible thing on the page - smaller and less noticable than names, integration notifications, what have you. But the onboarding is so easy, it just sucks users up.
Being able to see a conversation instead of bells and whistles? I miss that... but plain text scares regular users...
Shoot, I'll just do it myself.
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.
Why not define a bunch of custom emoji, one for each card, and use those instead of the big graphics at each turn? Would save massive bandwidth.
Number guess, blackjack, this, now maybe battleship...
Run "npm install" in the folder directory where the package.json is visible. In this case, if you cloned or extracted this project, it would be in the slack-poker-bot folder.
Hope that helps!