Playing Cards on Blinks. Trivial, Possible, or Not Worth it?

Still wrestling with playing cards on Blinks.

I keep coming over the same “beginners programing” topic of shuffling a deck of playing cards, and how, for C++ it’s child’s play (Pun Intended).


If I tell my program to “Shuffle” with the above code, and make the appropriate changes / translations for Blinks… It doesn’t happen, does it?

If each blink gets their own copy the program, it would follow that they get their own set of Arrays, and their own Shuffle instruction.

And then each Blink will get its own, wholly separate deck of cards.

If that blink were to deal it self cards (Kingmaker has its roots in wanting to be Texas Hold Em, complete with a methodology for having two separate and distinct cards on each Blink, Face 1 and 5 being suit, Face 2 and 4 being Rank, Face 0 OFF and 3 being an ID color to provide orientation) … it could at most comfortably deal two cards, and, in theory deal 3 cards. It would be a mess of information, but it remains that 3 cards per blink is the maximum.

(I guess that Blinking of colors could be used, but that’s out of the frying pan, into the fire.)

But, after dealing those 2 or 3 cards, there is no guarantee, at all, that all of the other blinks will have removed from their decks, the cards that all the other blinks self dealt, is there?

Google informs me that there are 1326 different two card combinations you can be dealt as pocket cards in Texas Hold Em, … 169 combinations if suit is ignored. Send on Face comes up 100 short. We could use like a third of the deck, and approach an animal that is 10-K or 10-A, but Poker becomes decidedly less “Poker” if every hand essentially starts at a straight or worse even a straight flush, given that we already threw suits out.

I don’t know, I’ve spent too much time musing on this, I’ve changed the title of the post three times, and even deleted my previous draft, that just devolved (further) into me talking about my personal history with Kingmaker. Not sure that anyone really wants to see that, … and at the very least, not here, in this exact venue.

There was no code in your message at all. What “above code” are you referring to?

Generally speaking, this is where you need to use some form of communication between all game Blinks. You could have a single Blinks that would be the shuffler and then would distribute cards to other connected Blinks. A simple way would be to do that only to Blinks directly connected to it so it would go like this:

1 - One Blink is set as the shuffler. It holds the entire deck.
2 - You connect a non-shuffler blink to it/
3 - The shuffler deals one or more cards to the connected Blink, making sure to not the cards that were given away.
4 - Go back to step 2 unless you already have all Blinks with cards that you need.
5 - Run the game logic for the Blinks only taking into account the cards they were dealt.

A normal deck has 56 cards or so, correct? So you can transfer a single card using face values without problems. For 2 cards, you would need some form of signaling to indicate that you are sending one card or the other which complicates things a bit (also there are several possible ways to do that). If you can reduce your deck to 32 cards or less, then things get a bit simpler (you can signal the card you are sending in the same message you send the card). You can also use datagrams and send 2 bytes at once which would simplify things a lot in this case.

  1. I was referring to the common “Shuffle” program that all of those tutorials create. Rather, a placeholder for them. That strictly speaking Shuffling a deck of cards in C++ is entirely different from programing the same, Through Arduino, Through Blinks.

  2. This is non-ironically interesting, intriguing, even. I can think of two branches off here, each with pros and cons. Note, that while I am aware of them, and the theory, I’m not confident that I could code it. I think so far, I’ve had the complier NOT barf on me, exactly twice.

2A as we touched earlier, would this be Switch / Case … not unlike Widgets?

2B or would a wholly separate program / and blink running something like a Shoe Deck be better here?

This legit just blew my mind. … If the Variables match exactly, There is nothing stopping two separate programs from talking to each other, is there? … This needs development. — A step further than Hexenwood and Hexenwood AI, which is what I Was going to comment with here, … I am talking about two entire separate programs all together.

Like, Ok, if I make a full program that concerns itself with a “Shoe” of multiple decks, and it can shuffle those cards, and deal those cards, perhaps flash red at the “cut card” … and do a full suite of card dealing administration, AND THEN connect that blink to like, eight other blinks already running Texas hold em… If I keep all the variables the same, they should talk to each other, right?

Like, a blink physically on the table, doing its own program, supporting other blinks that run a different program, but maintain the same variables and the methods to Send and Receive…

Blinks, with Lock On Technology.

Blinks & Knuckles.

[You know, like the Lock On Tech cartridge SEGA did…](Lock-On Technology - Sega Retro]

32 Cards would the absolute minimum … That’s 6 and up, and that allows for Short Deck Hold em, an established Texas Hold Em variant.

1 Like

Yes. You can have different states in your program and each Blink might be in a different state,

The only reason you would need to do that is if you are running out of space. You might also want to do that to be able to provide “add-on” Blinks that would change a game somehow. In your specific case here, It would not be worth the effort to do that I guess.

Not variables. They need to agree on a protocol they know how to talk. Hexenwood and the Hexenwood AI ARE completely different programs (they do have a lot of code in common, but this will usually be the case for game AIs). They just know how to talk to each other.

As I said, they need to agree on a communication protocol. Having “the same variables” is not enough nor a requirement.

My ideas on this, at best are half baked. However, at present, I’m thinking about something like having one Blink run a program that SendsOnFace “10” “20” “30” “40” with each SingleClicked, DoubleClicked, MultiClicked, LongPressed that it receives.

Then, you could have a suite of programs that simply wait to receive 10 / 20 / 30 / 40 on face. Not entirely sure to what end, but Chess Promotion comes to mind, a Pokemon Style evolution / Rare Candy situation [[Edit, Ok, not Rare Candy, per se, but the stones that make Pokemon evolve immediately]] comes to mind. … If in a dexterity [Flinging / Crokinole] game it’s some kind of intergalactic oasis of some sort, that refuels water and gas…

But, yeah, it’s not “There” yet, and I so clearly see it as an extension of memory. … But, just … that, that interplay is possible and that Blinks could have game expansions in this exact manner… my head is still swimming. Perhaps not a good place, given my skills… but, well, here we are.