Stilllegung des Forums
Das Forum wurde am 05.06.2023 nach über 20 Jahren stillgelegt (weitere Informationen und ein kleiner Rückblick).
Registrierungen, Anmeldungen und Postings sind nicht mehr möglich. Öffentliche Inhalte sind weiterhin zugänglich.
Das Team von spieleprogrammierer.de bedankt sich bei der Community für die vielen schönen Jahre.
Wenn du eine deutschsprachige Spieleentwickler-Community suchst, schau doch mal im Discord und auf ZFX vorbei!
Werbeanzeige
Zitat von »"Faule Socke"«
Ist das n Insider Mikkie?
C-/C++-Quelltext |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 |
void CPokerCard::create_deck() { resetVector(); // std::cout << "shuffle cards" << std::endl; player1_card1_siut = ((rand()%3+1)); player1_card1_value = ((rand()%12+1)); player1_card2_siut = ((rand()+1237)%3+1); player1_card2_value = (((rand()+7123)%12+1)); if (player1_card2_value == player1_card1_value && player1_card2_siut == player1_card1_siut) player1_card2_value++; player2_card1_siut = ((rand()+456)%3+1); player2_card1_value = (((rand()+456)%12+1)); if (player2_card1_value == player1_card1_value && player2_card1_siut == player1_card1_siut) player2_card1_value++; if (player2_card1_value == player1_card2_value && player2_card1_siut == player1_card2_siut) player2_card1_value++; player2_card2_siut = ((rand()+456)%3+1); player2_card2_value = (((rand()+456)%12+1)); if (player2_card2_value == player2_card1_value && player2_card2_siut == player2_card1_siut) player2_card2_value++; if (player2_card2_value == player1_card1_value && player2_card2_siut == player1_card1_siut) player2_card2_value++; if (player2_card2_value == player1_card2_value && player2_card2_siut == player2_card2_siut) player2_card2_value++; //-------------------------------------------------- flop1_siut = ((rand()%3+1)); flop1_value = ((rand()%12+1)); if (flop1_value == player1_card1_value && flop1_siut == player1_card1_siut) flop1_value++; if (flop1_value == player2_card1_value&& flop1_siut == player2_card1_siut) flop1_value++; if (flop1_value == player1_card2_value && flop1_siut == player1_card2_siut) flop1_value++; if (flop1_value == player2_card2_value && flop1_siut == player2_card2_siut) flop1_value++; flop2_siut = (((rand()+123)%3+1)); flop2_value = (((rand()+123)%12+1)); if (flop2_value == player1_card1_value && flop2_siut == player1_card1_siut) flop2_value++; if (flop2_value == player2_card1_value && flop2_siut == player2_card1_siut) flop2_value++; if (flop2_value == player1_card2_value && flop2_siut == player1_card2_siut) flop2_value++; if (flop2_value == player2_card2_value && flop2_siut == player2_card2_siut) flop2_value++; if (flop2_value == flop1_value && flop2_siut == flop1_siut) flop2_value++; flop3_siut = (((rand()+456)%3+1)); flop3_value = (((rand()+456)%12+1)); if (flop3_value == player1_card1_value && flop3_siut == player1_card1_siut) flop3_value++; if (flop3_value == player2_card1_value && flop3_siut == player2_card1_siut) flop3_value++; if (flop3_value == player1_card2_value && flop3_siut == player1_card2_siut) flop3_value++; if (flop3_value == player2_card2_value && flop3_siut == player2_card2_siut) flop3_value++; if (flop3_value == flop2_value && flop3_siut == flop2_siut) flop3_value++; if (flop3_value == flop1_value && flop3_siut == flop1_siut) flop3_value++; //-------------------------------------------------- turn_value = ((rand()%12+1)); turn_siut = ((rand()%3+1)); if (turn_value == player1_card1_value && turn_siut == player1_card1_siut) turn_value++; if (turn_value == player2_card1_value && turn_siut == player2_card1_siut) turn_value++; if (turn_value == player1_card2_value && turn_siut == player1_card2_siut) turn_value++; if (turn_value == player2_card2_value && turn_siut == player2_card2_siut) turn_value++; if (turn_value == flop2_value && turn_siut == flop2_siut) turn_value++; if (turn_value == flop1_value && turn_siut == flop1_siut) turn_value++; if (turn_value == flop3_value && turn_siut == flop3_siut) turn_value++; //----------------------------------------------- river_value = ((rand()%12+1)); river_siut = ((rand()%3+1)); if (river_value == player1_card1_value && river_siut == player1_card1_siut) river_value++; if (river_value == player2_card1_value && river_siut == player2_card1_siut) river_value++; if (river_value == player1_card2_value && river_siut == player1_card2_siut) river_value++; if (river_value == player2_card2_value && river_siut == player2_card2_siut) river_value++; if (river_value == flop2_value && river_siut == flop2_siut) river_value++; if (river_value == flop1_value && river_siut == flop1_siut) river_value++; if (river_value == flop3_value && river_siut == flop3_siut) river_value++; if (river_value == turn_value && river_siut == turn_siut) river_value++; //------------------------------------------------ getcards.push_back(player1_card1_siut); getcards.push_back(player1_card1_value); getcards.push_back(player1_card2_siut); getcards.push_back(player1_card2_value); getcards.push_back(player2_card1_siut); getcards.push_back(player2_card1_value); getcards.push_back(player2_card2_siut); getcards.push_back(player2_card2_value); getcards.push_back(flop1_siut); getcards.push_back(flop1_value); getcards.push_back(flop2_siut); getcards.push_back(flop2_value); getcards.push_back(flop3_siut); getcards.push_back(flop3_value); getcards.push_back(turn_siut); getcards.push_back(turn_value); getcards.push_back(river_siut); getcards.push_back(river_value); player1_card1 = siutes.at(player1_card1_siut) + " " + values.at(player1_card1_value); player1_card2 = siutes.at(player1_card2_siut) + " " + values.at(player1_card2_value); player2_card1 = siutes.at(player2_card1_siut) + " " + values.at(player2_card1_value); player2_card2 = siutes.at(player2_card2_siut) + " " + values.at(player2_card2_value); flop1 = siutes.at(flop1_siut) + " " + values.at(flop1_value); flop2 = siutes.at(flop2_siut) + " " + values.at(flop2_value); flop3 = siutes.at(flop3_siut) + " " + values.at(flop3_value); turn = siutes.at(turn_siut) + " " + values.at(turn_value); river = siutes.at(river_siut) + " " + values.at(river_value); } |
C-/C++-Quelltext |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 |
void CSvgDoc::Update(int money1, int money2, int pot, int round_count) { if (cards != pkrcrd_.getCardVec()) { cards = pkrcrd_.getCardVec(); // std::cout << "V E C T O R E R R O R !!!!!!" << std::endl; } remove("anthem.svg"); std::vector<std::string> siuts; std::vector<std::string> values; siuts.push_back("Data/siut_karo.gif"); siuts.push_back("Data/siut_pik.gif"); siuts.push_back("Data/siut_herz.gif"); siuts.push_back("Data/siut_kreuz.gif"); //Herz--------------------- values.push_back("Data/value_2.gif"); values.push_back("Data/value_3.gif"); values.push_back("Data/value_4.gif"); values.push_back("Data/value_5.gif"); values.push_back("Data/value_6.gif"); values.push_back("Data/value_7.gif"); values.push_back("Data/value_8.gif"); values.push_back("Data/value_9.gif"); values.push_back("Data/value_10.gif"); values.push_back("Data/value_bube.gif"); values.push_back("Data/value_dame.gif"); values.push_back("Data/value_koenig.gif"); values.push_back("Data/value_ass.gif"); output_file.open("anthem.svg",std::ios::out); output_file << "<?xml version=\"1.0\" encoding=\"utf-8\"?>"; output_file << "<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\" "; output_file << "\"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">"; output_file << "<svg xmlns=\"http://www.w3.org/2000/svg\" "; output_file << "xmlns:xlink=\"http://www.w3.org/1999/xlink\" "; output_file << "xmlns:ev=\"http://www.w3.org/2001/xml-events\" "; output_file << "version=\"1.1\" baseProfile=\"full\">"; output_file << std::endl; //welcome message output_file << "<text style=\"fill:black;\" x=\"150\" y=\"25\" font-size=\"20\">"; output_file << "Welcome to Anthem Poker Linux Edition! ALPHA Release</text>" << std::endl; output_file << "<line x1=\"10\" y1=\"40\" x2=\"800\" y2=\"40\" stroke=\"black\""; output_file << " stroke-width=\"4\" />" << std::endl; //player 1 section output_file << "<text style=\"fill:black;\" x=\"100\" y=\"60\" font-size=\"15\">"; output_file << "Spieler 1 Karten</text>" << std::endl; output_file << "<line x1=\"400\" y1=\"60\" x2=\"400\" y2=\"260\""; output_file << " stroke=\"black\" stroke-width=\"2\" />" << std::endl; //player 2 section output_file << "<text style=\"fill:black;\" x=\"550\" y=\"60\" font-size=\"15\">"; output_file << "Spieler 2 Karten</text>" << std::endl; output_file << "<line x1=\"10\" y1=\"285\" x2=\"800\" y2=\"285\""; output_file << " stroke=\"black\" stroke-width=\"2\" />" << std::endl; output_file << "<text style=\"fill:black;\" x=\"335\" y=\"300\" font-size=\"15\">"; output_file << "Am Tisch liegen</text>" << std::endl; output_file << "<line x1=\"10\" y1=\"525\" x2=\"800\" y2=\"525\""; output_file << " stroke=\"black\" stroke-width=\"2\" />" << std::endl; //statistics output_file << "<text style=\"fill:black;\" x=\"20\" y=\"540\" font-size=\"15\">"; output_file << "Spieler1 hat: " << money1 << " </text>" << std::endl; output_file << "<text style=\"fill:black;\" x=\"270\" y=\"540\" font-size=\"15\">"; output_file << "Spieler2 hat: " << money2 << " </text>" << std::endl; output_file << "<text style=\"fill:black;\" x=\"570\" y=\"540\" font-size=\"15\">"; output_file << "Im Pot sind: " << pot << " </text>" << std::endl; output_file << "<line x1=\"10\" y1=\"550\" x2=\"800\" y2=\"550\""; output_file << " stroke=\"black\" stroke-width=\"4\" />" << std::endl; //Border Lines output_file << "<line x1=\"10\" y1=\"40\" x2=\"10\" y2=\"550\""; output_file << " stroke=\"black\" stroke-width=\"4\" />" << std::endl; output_file << "<line x1=\"800\" y1=\"40\" x2=\"800\" y2=\"550\""; output_file << " stroke=\"black\" stroke-width=\"4\" />" << std::endl; //starting putting cards into image //cards player 1 output_file << "<image x=\"15\" y=\"132\" width=\"129px\" height=\"149px\" xlink:href=\"" << siuts[cards.at(0)] <<"\" />" << std::endl; output_file << "<image x=\"15\" y=\"82\" width=\"129px\" height=\"52px\" xlink:href=\"" << values[cards.at(1)] <<"\" />" << std::endl; output_file << "<image x=\"175\" y=\"132\" width=\"129px\" height=\"149px\" xlink:href=\"" << siuts[cards.at(2)] <<"\" />" << std::endl; output_file << "<image x=\"175\" y=\"82\" width=\"129px\" height=\"52px\" xlink:href=\"" << values[cards.at(3)] <<"\" />" << std::endl; //player 2 cards output_file << "<image x=\"470\" y=\"132\" width=\"129px\" height=\"149px\" xlink:href=\"" << siuts[cards.at(4)] <<"\" />" << std::endl; output_file << "<image x=\"470\" y=\"82\" width=\"129px\" height=\"52px\" xlink:href=\"" << values[cards.at(5)] <<"\" />" << std::endl; output_file << "<image x=\"630\" y=\"132\" width=\"129px\" height=\"149px\" xlink:href=\"" << siuts[cards.at(6)] <<"\" />" << std::endl; output_file << "<image x=\"630\" y=\"82\" width=\"129px\" height=\"52px\" xlink:href=\"" << values[cards.at(7)] <<"\" />" << std::endl; //verdeckte flop cards if (round_count == 0) { output_file << "<image x=\"15\" y=\"324\" width=\"126px\" height=\"199px\" xlink:href=\"" << "Data/card_back.gif\" />" << std::endl; output_file << "<image x=\"175\" y=\"324\" width=\"126px\" height=\"199px\" xlink:href=\"" << "Data/card_back.gif\" />" << std::endl; output_file << "<image x=\"335\" y=\"324\" width=\"126px\" height=\"199px\" xlink:href=\"" << "Data/card_back.gif\" />" << std::endl; } //table cards comming here... if (round_count == 1 || round_count == 2 || round_count == 3) { output_file << "<image x=\"15\" y=\"374\" width=\"129px\" height=\"149px\" xlink:href=\"" << siuts[cards.at(8)] <<"\" />" << std::endl; output_file << "<image x=\"15\" y=\"324\" width=\"129px\" height=\"52px\" xlink:href=\"" << values[cards.at(9)] <<"\" />" << std::endl; output_file << "<image x=\"175\" y=\"374\" width=\"129px\" height=\"149px\" xlink:href=\"" << siuts[cards.at(10)] <<"\" />" << std::endl; output_file << "<image x=\"175\" y=\"324\" width=\"129px\" height=\"52px\" xlink:href=\"" << values[cards.at(11)] <<"\" />" << std::endl; output_file << "<image x=\"335\" y=\"374\" width=\"129px\" height=\"149px\" xlink:href=\"" << siuts[cards.at(12)] <<"\" />" << std::endl; output_file << "<image x=\"335\" y=\"324\" width=\"129px\" height=\"52px\" xlink:href=\"" << values[cards.at(13)] <<"\" />" << std::endl; } //verdeckte turn and river cards if( round_count != 2 || round_count != 3) { output_file << "<image x=\"490\" y=\"324\" width=\"126px\" height=\"199px\" xlink:href=\"" << "Data/card_back.gif\" />" << std::endl; output_file << "<image x=\"650\" y=\"324\" width=\"126px\" height=\"199px\" xlink:href=\"" << "Data/card_back.gif\" />" << std::endl; } //turn and river... if (round_count == 2 || round_count == 3) { if (round_count == 2) { output_file << "<image x=\"490\" y=\"374\" width=\"129px\" height=\"149px\" xlink:href=\"" << siuts[cards.at(14)] <<"\" />" << std::endl; output_file << "<image x=\"490\" y=\"324\" width=\"129px\" height=\"52px\" xlink:href=\"" << values[cards.at(15)] <<"\" />" << std::endl; } if (round_count == 3 ) { output_file << "<image x=\"490\" y=\"374\" width=\"129px\" height=\"149px\" xlink:href=\"" << siuts[cards.at(14)] <<"\" />" << std::endl; output_file << "<image x=\"490\" y=\"324\" width=\"129px\" height=\"52px\" xlink:href=\"" << values[cards.at(15)] <<"\" />" << std::endl; output_file << "<image x=\"650\" y=\"374\" width=\"129px\" height=\"149px\" xlink:href=\"" << siuts[cards.at(16)] <<"\" />" << std::endl; output_file << "<image x=\"650\" y=\"324\" width=\"129px\" height=\"52px\" xlink:href=\"" << values[cards.at(17)] <<"\" />" << std::endl; } } // end of card image building... output_file << "</svg>"; // std::cout << "file build..." << std::endl; output_file.close(); |
C-/C++-Quelltext |
|
1 2 3 4 5 6 7 8 9 10 11 12 |
case SHOWDOWN: { roundShowdown(); std::cout << "\n\n mische und gebe ...\n"; std::cout << "--------------------------------------------\n\n"; m_round_counter = PREFLOP; pkrcrd_.resetVector(); pkrcrd_.create_deck(); players_[0]->setActive(); break; |
Zitat von »"AlymcGeel"«
und das auf dem bild is Allymcbeal und da mein Name ähnlich is wird er wohl das bild gepostet haben...
Werbeanzeige