6 ms·
Wow, thanks for sharing my Deck.of.Cards project! Just to let you guys know, this one is the old version. Newer version is in the root https://deck.of.cards htt
by pkstn 3y ago
Wow, thanks for sharing my Deck.of.Cards project! Just to let you guys know, this one is the old version. Newer version is in the root https://deck.of.cards https://deck.of.cards
Old one has nicer animation treats, but the new one has multiplayer as well :)
- phailhaus 3y agoVery cool! How did you implement multiplayer?
- pkstn 3y agoIt's using socket.io, pretty simple stuff.. Here's the car.js.org server-side as simple example: https://github.com/pakastin/car-ws/blob/master/server/index.js https://github.com/pakastin/car-ws/blob/master/server/index....
- BaRRaKID 3y agoBit of a nitpicking but the "sort" order is wrong. New decks come ordered Ace of Spades - King of Spades, Ace of Diamonds - King of Diamonds, King of Clubs - Ace of Clubs, King of Hearts - Ace of Hearts. The deck should start and end with Aces, and have two kings next to each other in the middle.
- pkstn 3y agoThat is true, i could actually finally fix that..
- ogab 3y agoAny idea why this is the order?
- BaRRaKID 3y agoNo idea, but it seems like it's intentionally made so that no matter the orientation of the deck (face up or face down), the first card you see (not counting jokers and ad cards) will always de an ace. The two suits of those aces are just the two most liked suits (ace and hearths). The curious part is that this order doesn't mean anything for card players, in fact it would probably be better for most games if the decks where printed in random order, but for magicians this order is really important for many effects. For example, if you perfectly shuffle the deck 8 times it will go back to it's original order.
- Awelton 3y agoI found out that if you add about 60 decks and then hit shuffle it breaks physics, space, and time. I am using it to play solitaire now and it works well.
- perth 3y agoOld one has better mobile support too
- zamnos 3y agoI couldn't get multiplayer to work for me and I'm not sure why not. Chrome + Incognito Chrome.
- pkstn 3y agoMight be overloaded because of HN, i'll check and add capacity..
- graderjs 3y agoI love the table color and look of the cards here. Also the animations are really cool! I sort of get the feeling this would be a great side-quest in an isometric RPG / world explorer! Without looking at the code...can I ask you a question? Is the "randomness" "real like a real deck" -- as in, "after shuffle the cards have a certain definite order, which then is unchanged as you select from the deck?" or is the randomness more like a "computerized version", as in, "shuffle is just for show, selecting from the deck just randomly picks 1 out of the set of remaining cards and subtracts that card, in other words-- these is no persistent order?"
- pkstn 3y agoIt's fisher-yates with multiple iterations, so should be pretty random
- graderjs 3y agoOh, I don't care how random it is. My interest is when is it random. Do you only shuffle the deck when "shuffle" is performed, and then the shuffled order is preserved until: cards are (re-)moved; deck is shuffled again; etc? (I.e "real world" model). Or do you shuffle the remaining hidden deck multiple times (so, not when shuffle is explicitly performed, but on other occasions, for example; at intervals; or, after someone pics the top card; etc)?
- pkstn 3y agoOh, only when pressing shuffle. In the new version in multiplayer mode the order is kept on server-side so that players can't cheat..
- globuous 3y agoIt looks like the randomness is generated at shuffle time and then maintained. You can check by hitting « fan » and then « flip » multiple times. It always returns the same card order between shuffles which seems to imply that it’s maintained.