Playing cards: Difference between revisions

→‎{{header|C++}}: unicode version
(→‎{{header|C++}}: unicode version)
Line 1,224:
 
=={{header|C++}}==
=== Text version ===
<lang cpp>#include <deque>
#include <algorithm>
Line 1,311 ⟶ 1,312:
return 0;
}</lang>
 
=== Unicode version ===
{{Works with|Unicode|6 and above}}
<lang cpp>#include <algorithm>
#include <iostream>
#include <string>
#include <vector>
 
const std::vector<std::string> cards = { "🂡", "🂱", "🃁", "🃑",
"🂢", "🂲", "🃂", "🃒",
"🂣", "🂳", "🃃", "🃓",
"🂤", "🂴", "🃄", "🃔",
"🂥", "🂵", "🃅", "🃕",
"🂦", "🂶", "🃆", "🃖",
"🂧", "🂷", "🃇", "🃗",
"🂨", "🂸", "🂸", "🂸",
"🂩", "🂩", "🃉", "🃙",
"🂪", "🂺", "🃊", "🃚",
"🂫", "🂻", "🃋", "🃛",
"🂭", "🂽", "🃍", "🃝",
"🂮", "🂾", "🃎", "🃞"
};
 
int main(int argc, const char* args[]) {
auto deck(cards);
std::random_shuffle(deck.begin(), deck.end());
uint i = 1;
for (auto &card: deck) {
std::cout << card;
if (i++ % 13 == 0)
std::cout << std::endl;
}
 
return 0;
}</lang>
{{out}}
<pre>🂢🃞🃓🃔🂧🃙🂵🂪🃇🃎🂩🃚🃕
🃁🃝🂾🂷🃅🂩🂫🂲🂶🃒🂤🃄🃋
🃗🃂🂽🂭🂸🃊🂴🂺🃑🂥🂸🃛🂳
🃆🂣🃖🂦🃉🂱🃃🂸🂡🃍🂻🂮🂨</pre>
 
=={{header|Ceylon}}==
Anonymous user