<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[*argh* Blackjack]]></title><description><![CDATA[<p>Ich habe vorhin ja schonmal wegen einem Random-Befehl nachgefragt.<br />
Jetzt hab ich mein Blackjack fast fertig, aber ich komm an dem Punkt nicht weiter, wo er, wenn er über 21 geht dann sagt &quot;YOU LOOSE&quot;. Könnte mir da jemand helfen?</p>
<p>Ist ein bisschen Chaos im Code <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title="=)"
      alt="🙂"
    /></p>
<pre><code>/*
Blackjack made by Marc G. 2006
*/

/*
Ass = 1 oder 11
König = 10
Königin = 10
Bube = 10
*/

//Libarys
#include &lt;iostream&gt;
#include &lt;cstdlib&gt;
#include &lt;ctime&gt;

//Soweit unwichtig...
using namespace std;

//Haupt-Funktion
int main()
{

//Deklarationen
srand(time(0));
int a = rand() % 9 + 2;
int b = rand() % 9 + 2;
int c = rand() % 9 + 2;
int d = rand() % 9 + 2;
int e = rand() % 9 + 2;
int f = rand() % 9 + 2;
int g = rand() % 9 + 2;
int h = rand() % 9 + 2;
int i = rand() % 9 + 2;
int j = rand() % 9 + 2;
int k = rand() % 9 + 2;
char ch = 0;
int insg, insg2, insg3, insg4, insg5, insg6, insg7, insg8, insg9, insg10, insg11, eing;

//Ausgabe (Design)
if(a&lt;=21)
{
insg = a + b;
}else{
system(&quot;cls&quot;);
cout&lt;&lt;&quot;YOU LOST - You took to much&quot;&lt;&lt;endl;
}
cout&lt;&lt;&quot;1st Card: &quot;&lt;&lt;a&lt;&lt;&quot; \n2nd Card: &quot;&lt;&lt;b&lt;&lt;&quot; \n\nTogether: &quot;&lt;&lt;insg&lt;&lt;endl;
cout&lt;&lt;&quot;\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nTake another Card, type: 1\n&quot;;
cout&lt;&lt;&quot;Stand with that Cards, type: 2\n&quot;;
cout&lt;&lt;&quot;To quit, type: Q + Enter\n&quot;;
eing = 0;
cin&gt;&gt;eing;

//Wenn zu viel - dann tod!
if(insg &gt; 21)
{
cout&lt;&lt;&quot;You lost!&quot;&lt;&lt;endl;
}else if(insg2 &gt; 21){
      system(&quot;cls&quot;);
      cout&lt;&lt;&quot;You Lost!&quot;;    
}else if(insg3 &gt; 21){
      system(&quot;cls&quot;);
      cout&lt;&lt;&quot;You Lost!&quot;;    
}else if(insg4 &gt; 21){
      system(&quot;cls&quot;);
      cout&lt;&lt;&quot;You Lost!&quot;;    
}else if(insg5 &gt; 21){
      system(&quot;cls&quot;);
      cout&lt;&lt;&quot;You Lost!&quot;;  
}else if(insg6 &gt; 21){
      system(&quot;cls&quot;);
      cout&lt;&lt;&quot;You Lost!&quot;;  
}

if(eing = 1)
{
system(&quot;cls&quot;);
insg2 = a + b + c;
cout&lt;&lt;&quot;1st Card: &quot;&lt;&lt;a&lt;&lt;&quot; \n2nd Card: &quot;&lt;&lt;b&lt;&lt;&quot;\n3rd Card: &quot;&lt;&lt;c&lt;&lt;&quot; \n\nTogether: &quot;&lt;&lt;insg2&lt;&lt;endl;

}

cout&lt;&lt;&quot;\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nTake another Card, type: 1\n&quot;;
cout&lt;&lt;&quot;Stand with that Cards, type: 2\n&quot;;
cout&lt;&lt;&quot;To quit, type: Q + Enter\n&quot;;
eing = 0;
cin&gt;&gt;eing;

//Wenn zu viel - dann tod!
if(insg &gt; 21)
{
cout&lt;&lt;&quot;You lost!&quot;&lt;&lt;endl;
}else if(insg2 &gt; 21){
      system(&quot;cls&quot;);
      cout&lt;&lt;&quot;You Lost!&quot;;    
}else if(insg3 &gt; 21){
      system(&quot;cls&quot;);
      cout&lt;&lt;&quot;You Lost!&quot;;    
}else if(insg4 &gt; 21){
      system(&quot;cls&quot;);
      cout&lt;&lt;&quot;You Lost!&quot;;    
}else if(insg5 &gt; 21){
      system(&quot;cls&quot;);
      cout&lt;&lt;&quot;You Lost!&quot;;  
}else if(insg6 &gt; 21){
      system(&quot;cls&quot;);
      cout&lt;&lt;&quot;You Lost!&quot;;  
}

if(eing = 1)
{
system(&quot;cls&quot;);
insg3 = a + b + c + d;
cout&lt;&lt;&quot;1st Card: &quot;&lt;&lt;a&lt;&lt;&quot; \n2nd Card: &quot;&lt;&lt;b&lt;&lt;&quot;\n3rd Card: &quot;&lt;&lt;c&lt;&lt;&quot;\n4th Card: &quot;&lt;&lt;d&lt;&lt;&quot; \n\nTogether: &quot;&lt;&lt;insg3&lt;&lt;endl;
}

cout&lt;&lt;&quot;\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nTake another Card, type: 1\n&quot;;
cout&lt;&lt;&quot;Stand with that Cards, type: 2\n&quot;;
cout&lt;&lt;&quot;To quit, type: Q + Enter\n&quot;;
eing = 0;
cin&gt;&gt;eing;

//Wenn zu viel - dann tod!
if(insg &gt; 21)
{
cout&lt;&lt;&quot;You lost!&quot;&lt;&lt;endl;
}else if(insg2 &gt; 21){
      system(&quot;cls&quot;);
      cout&lt;&lt;&quot;You Lost!&quot;;    
}else if(insg3 &gt; 21){
      system(&quot;cls&quot;);
      cout&lt;&lt;&quot;You Lost!&quot;;    
}else if(insg4 &gt; 21){
      system(&quot;cls&quot;);
      cout&lt;&lt;&quot;You Lost!&quot;;    
}else if(insg5 &gt; 21){
      system(&quot;cls&quot;);
      cout&lt;&lt;&quot;You Lost!&quot;;  
}else if(insg6 &gt; 21){
      system(&quot;cls&quot;);
      cout&lt;&lt;&quot;You Lost!&quot;;  
}

if(eing = 1)
{
system(&quot;cls&quot;);
insg4 = a + b + c + d + e;
cout&lt;&lt;&quot;1st Card: &quot;&lt;&lt;a&lt;&lt;&quot; \n2nd Card: &quot;&lt;&lt;b&lt;&lt;&quot;\n3rd Card: &quot;&lt;&lt;c&lt;&lt;&quot;\n4th Card: &quot;&lt;&lt;d&lt;&lt;&quot;\n5th Card: &quot;&lt;&lt;e&lt;&lt;&quot; \n\nTogether: &quot;&lt;&lt;insg4&lt;&lt;endl;
}

cout&lt;&lt;&quot;\n\n\n\n\n\n\n\n\n\n\n\n\n\nTake another Card, type: 1\n&quot;;
cout&lt;&lt;&quot;Stand with that Cards, type: 2\n&quot;;
cout&lt;&lt;&quot;To quit, type: Q + Enter\n&quot;;
eing = 0;
cin&gt;&gt;eing;

//Wenn zu viel - dann tod!
if(insg &gt; 21)
{
cout&lt;&lt;&quot;You lost!&quot;&lt;&lt;endl;
}else if(insg2 &gt; 21){
      system(&quot;cls&quot;);
      cout&lt;&lt;&quot;You Lost!&quot;;    
}else if(insg3 &gt; 21){
      system(&quot;cls&quot;);
      cout&lt;&lt;&quot;You Lost!&quot;;    
}else if(insg4 &gt; 21){
      system(&quot;cls&quot;);
      cout&lt;&lt;&quot;You Lost!&quot;;    
}else if(insg5 &gt; 21){
      system(&quot;cls&quot;);
      cout&lt;&lt;&quot;You Lost!&quot;;  
}else if(insg6 &gt; 21){
      system(&quot;cls&quot;);
      cout&lt;&lt;&quot;You Lost!&quot;;  
}

if(eing = 1)
{
system(&quot;cls&quot;);
insg5 = a + b + c + d + e + f;
cout&lt;&lt;&quot;1st Card: &quot;&lt;&lt;a&lt;&lt;&quot; \n2nd Card: &quot;&lt;&lt;b&lt;&lt;&quot;\n3rd Card: &quot;&lt;&lt;c&lt;&lt;&quot;\n4th Card: &quot;&lt;&lt;d&lt;&lt;&quot;\n5th Card: &quot;&lt;&lt;e&lt;&lt;&quot;\n6th Card: &quot;&lt;&lt;f&lt;&lt;&quot; \n\nTogether: &quot;&lt;&lt;insg5&lt;&lt;endl;
}

cout&lt;&lt;&quot;\n\n\n\n\n\n\n\n\n\n\n\n\nTake another Card, type: 1\n&quot;;
cout&lt;&lt;&quot;Stand with that Cards, type: 2\n&quot;;
cout&lt;&lt;&quot;To quit, type: Q + Enter\n&quot;;
eing = 0;
cin&gt;&gt;eing;

//Wenn zu viel - dann tod!
if(insg &gt; 21)
{
cout&lt;&lt;&quot;You lost!&quot;&lt;&lt;endl;
}else if(insg2 &gt; 21){
      system(&quot;cls&quot;);
      cout&lt;&lt;&quot;You Lost!&quot;;    
}else if(insg3 &gt; 21){
      system(&quot;cls&quot;);
      cout&lt;&lt;&quot;You Lost!&quot;;    
}else if(insg4 &gt; 21){
      system(&quot;cls&quot;);
      cout&lt;&lt;&quot;You Lost!&quot;;    
}else if(insg5 &gt; 21){
      system(&quot;cls&quot;);
      cout&lt;&lt;&quot;You Lost!&quot;;  
}else if(insg6 &gt; 21){
      system(&quot;cls&quot;);
      cout&lt;&lt;&quot;You Lost!&quot;;  
}

if(eing = 1)
{
system(&quot;cls&quot;);
insg6 = a + b + c + d + e + f + g;
cout&lt;&lt;&quot;1st Card: &quot;&lt;&lt;a&lt;&lt;&quot; \n2nd Card: &quot;&lt;&lt;b&lt;&lt;&quot;\n3rd Card: &quot;&lt;&lt;c&lt;&lt;&quot;\n4th Card: &quot;&lt;&lt;d&lt;&lt;&quot;\n5th Card: &quot;&lt;&lt;e&lt;&lt;&quot;\n6th Card: &quot;&lt;&lt;f&lt;&lt;&quot;\n7th Card: &quot;&lt;&lt;g&lt;&lt;&quot; \n\nTogether: &quot;&lt;&lt;insg6&lt;&lt;endl;
}
cout&lt;&lt;&quot;\n\n\n\n\n\n\n\n\n\n\n\nTake another Card, type: 1\n&quot;;
cout&lt;&lt;&quot;Stand with that Cards, type: 2\n&quot;;
cout&lt;&lt;&quot;To quit, type: Q + Enter\n&quot;;
eing = 0;
cin&gt;&gt;eing;

//Wenn zu viel - dann tod!
if(insg &gt; 21)
{
cout&lt;&lt;&quot;You lost!&quot;&lt;&lt;endl;
}else if(insg2 &gt; 21){
      system(&quot;cls&quot;);
      cout&lt;&lt;&quot;You Lost!&quot;;    
}else if(insg3 &gt; 21){
      system(&quot;cls&quot;);
      cout&lt;&lt;&quot;You Lost!&quot;;    
}else if(insg4 &gt; 21){
      system(&quot;cls&quot;);
      cout&lt;&lt;&quot;You Lost!&quot;;    
}else if(insg5 &gt; 21){
      system(&quot;cls&quot;);
      cout&lt;&lt;&quot;You Lost!&quot;;  
}else if(insg6 &gt; 21){
      system(&quot;cls&quot;);
      cout&lt;&lt;&quot;You Lost!&quot;;  
}

if(eing = 1)
{
system(&quot;cls&quot;);
insg7 = a + b + c + d + e + f + g + h;
cout&lt;&lt;&quot;1st Card: &quot;&lt;&lt;a&lt;&lt;&quot; \n2nd Card: &quot;&lt;&lt;b&lt;&lt;&quot;\n3rd Card: &quot;&lt;&lt;c&lt;&lt;&quot;\n4th Card: &quot;&lt;&lt;d&lt;&lt;&quot;\n5th Card: &quot;&lt;&lt;e&lt;&lt;&quot;\n6th Card: &quot;&lt;&lt;f&lt;&lt;&quot;\n7th Card: &quot;&lt;&lt;g&lt;&lt;&quot;\n8th Card:&quot;&lt;&lt;h&lt;&lt;&quot; \n\nTogether: &quot;&lt;&lt;insg7&lt;&lt;endl;
}

cout&lt;&lt;&quot;\n\n\n\n\n\n\n\n\n\n\nTake another Card, type: 1\n&quot;;
cout&lt;&lt;&quot;Stand with that Cards, type: 2\n&quot;;
cout&lt;&lt;&quot;To quit, type: Q + Enter\n&quot;;
eing = 0;
cin&gt;&gt;eing;

//Wenn zu viel - dann tod!
if(insg &gt; 21)
{
cout&lt;&lt;&quot;You lost!&quot;&lt;&lt;endl;
}else if(insg2 &gt; 21){
      system(&quot;cls&quot;);
      cout&lt;&lt;&quot;You Lost!&quot;;    
}else if(insg3 &gt; 21){
      system(&quot;cls&quot;);
      cout&lt;&lt;&quot;You Lost!&quot;;    
}else if(insg4 &gt; 21){
      system(&quot;cls&quot;);
      cout&lt;&lt;&quot;You Lost!&quot;;    
}else if(insg5 &gt; 21){
      system(&quot;cls&quot;);
      cout&lt;&lt;&quot;You Lost!&quot;;  
}else if(insg6 &gt; 21){
      system(&quot;cls&quot;);
      cout&lt;&lt;&quot;You Lost!&quot;;  
}

if(eing = 1)
{
system(&quot;cls&quot;);
insg8 = a + b + c + d + e + f + g + h + i;
cout&lt;&lt;&quot;1st Card: &quot;&lt;&lt;a&lt;&lt;&quot; \n2nd Card: &quot;&lt;&lt;b&lt;&lt;&quot;\n3rd Card: &quot;&lt;&lt;c&lt;&lt;&quot;\n4th Card: &quot;&lt;&lt;d&lt;&lt;&quot;\n5th Card: &quot;&lt;&lt;e&lt;&lt;&quot;\n6th Card: &quot;&lt;&lt;f&lt;&lt;&quot;\n7th Card: &quot;&lt;&lt;g&lt;&lt;&quot;\n8th Card:&quot;&lt;&lt;h&lt;&lt;&quot;\n9th Card: &quot;&lt;&lt;i&lt;&lt;&quot; \n\nTogether: &quot;&lt;&lt;insg8&lt;&lt;endl;
}

cout&lt;&lt;&quot;\n\n\n\n\n\n\n\n\n\nTake another Card, type: 1\n&quot;;
cout&lt;&lt;&quot;Stand with that Cards, type: 2\n&quot;;
cout&lt;&lt;&quot;To quit, type: Q + Enter\n&quot;;
eing = 0;
cin&gt;&gt;eing;

//Wenn zu viel - dann tod!
if(insg &gt; 21)
{
cout&lt;&lt;&quot;You lost!&quot;&lt;&lt;endl;
}else if(insg2 &gt; 21){
      system(&quot;cls&quot;);
      cout&lt;&lt;&quot;You Lost!&quot;;    
}else if(insg3 &gt; 21){
      system(&quot;cls&quot;);
      cout&lt;&lt;&quot;You Lost!&quot;;    
}else if(insg4 &gt; 21){
      system(&quot;cls&quot;);
      cout&lt;&lt;&quot;You Lost!&quot;;    
}else if(insg5 &gt; 21){
      system(&quot;cls&quot;);
      cout&lt;&lt;&quot;You Lost!&quot;;  
}else if(insg6 &gt; 21){
      system(&quot;cls&quot;);
      cout&lt;&lt;&quot;You Lost!&quot;;  
}

if(eing = 1)
{
system(&quot;cls&quot;);
insg9 = a + b + c + d + e + f + g + h + i + j;
cout&lt;&lt;&quot;1st Card: &quot;&lt;&lt;a&lt;&lt;&quot; \n2nd Card: &quot;&lt;&lt;b&lt;&lt;&quot;\n3rd Card: &quot;&lt;&lt;c&lt;&lt;&quot;\n4th Card: &quot;&lt;&lt;d&lt;&lt;&quot;\n5th Card: &quot;&lt;&lt;e&lt;&lt;&quot;\n6th Card: &quot;&lt;&lt;f&lt;&lt;&quot;\n7th Card: &quot;&lt;&lt;g&lt;&lt;&quot;\n8th Card: &quot;&lt;&lt;h&lt;&lt;&quot;\n9th Card: &quot;&lt;&lt;i&lt;&lt;&quot;\n10th Card:&quot;&lt;&lt;j&lt;&lt;&quot; \n\nTogether: &quot;&lt;&lt;insg9&lt;&lt;endl;
}

cout&lt;&lt;&quot;\n\n\n\n\n\n\n\n\nTake another Card, type: 1\n&quot;;
cout&lt;&lt;&quot;Stand with that Cards, type: 2\n&quot;;
cout&lt;&lt;&quot;To quit, type: Q + Enter\n&quot;;
eing = 0;
cin&gt;&gt;eing;

//Wenn zu viel - dann tod!
if(insg &gt; 21)
{
cout&lt;&lt;&quot;You lost!&quot;&lt;&lt;endl;
}else if(insg2 &gt; 21){
      system(&quot;cls&quot;);
      cout&lt;&lt;&quot;You Lost!&quot;;    
}else if(insg3 &gt; 21){
      system(&quot;cls&quot;);
      cout&lt;&lt;&quot;You Lost!&quot;;    
}else if(insg4 &gt; 21){
      system(&quot;cls&quot;);
      cout&lt;&lt;&quot;You Lost!&quot;;    
}else if(insg5 &gt; 21){
      system(&quot;cls&quot;);
      cout&lt;&lt;&quot;You Lost!&quot;;  
}else if(insg6 &gt; 21){
      system(&quot;cls&quot;);
      cout&lt;&lt;&quot;You Lost!&quot;;  
}

if(eing = 1)
{
system(&quot;cls&quot;);
insg10 = a + b + c + d + e + f + g + h + i + j;
cout&lt;&lt;&quot;1st Card: &quot;&lt;&lt;a&lt;&lt;&quot; \n2nd Card: &quot;&lt;&lt;b&lt;&lt;&quot;\n3rd Card: &quot;&lt;&lt;c&lt;&lt;&quot;\n4th Card: &quot;&lt;&lt;d&lt;&lt;&quot;\n5th Card: &quot;&lt;&lt;e&lt;&lt;&quot;\n6th Card: &quot;&lt;&lt;f&lt;&lt;&quot;\n7th Card: &quot;&lt;&lt;g&lt;&lt;&quot;\n8th Card: &quot;&lt;&lt;h&lt;&lt;&quot;\n9th Card: &quot;&lt;&lt;i&lt;&lt;&quot;\n10th Card: &quot;&lt;&lt;j&lt;&lt;&quot;\n11th Card: &quot;&lt;&lt;k&lt;&lt;&quot; \n\nTogether: &quot;&lt;&lt;insg10&lt;&lt;endl;
}

cout&lt;&lt;&quot;\n\n\n\n\n\n\n\nTake another Card, type: 1\n&quot;;
cout&lt;&lt;&quot;Stand with that Cards, type: 2\n&quot;;
cout&lt;&lt;&quot;To quit, type: Q + Enter\n&quot;;
eing = 0;
cin&gt;&gt;eing;

//Wenn zu viel - dann tod!
if(insg &gt; 21)
{
cout&lt;&lt;&quot;You lost!&quot;&lt;&lt;endl;
}else if(insg2 &gt; 21){
      system(&quot;cls&quot;);
      cout&lt;&lt;&quot;You Lost!&quot;;    
}else if(insg3 &gt; 21){
      system(&quot;cls&quot;);
      cout&lt;&lt;&quot;You Lost!&quot;;    
}else if(insg4 &gt; 21){
      system(&quot;cls&quot;);
      cout&lt;&lt;&quot;You Lost!&quot;;    
}else if(insg5 &gt; 21){
      system(&quot;cls&quot;);
      cout&lt;&lt;&quot;You Lost!&quot;;  
}else if(insg6 &gt; 21){
      system(&quot;cls&quot;);
      cout&lt;&lt;&quot;You Lost!&quot;;  
}

if(eing = 1)
{
system(&quot;cls&quot;);
insg11 = a + b + c + d + e + f + g + h + i + j + k;
cout&lt;&lt;&quot;This was too much, you lost.&quot;&lt;&lt;endl;
}

cout&lt;&lt;&quot;\n\n\n\n\n\n\n\n\n\n\n\n\n\nTake another Card, type: 1\n&quot;;
cout&lt;&lt;&quot;Stand with that Cards, type: 2\n&quot;;
cout&lt;&lt;&quot;To quit, type: Q + Enter\n&quot;;
eing = 0;
cin&gt;&gt;eing;

//SCHLEIFE + Schließen
do{
ch = cin.get( );    
} while(ch != 'Q'); 
//SCHLEIFEN-ENDE

cin.get();
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/topic/149008/argh-blackjack</link><generator>RSS for Node</generator><lastBuildDate>Sat, 05 Sep 2026 11:07:28 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/149008.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 01 Jun 2006 11:48:46 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to *argh* Blackjack on Thu, 01 Jun 2006 11:48:46 GMT]]></title><description><![CDATA[<p>Ich habe vorhin ja schonmal wegen einem Random-Befehl nachgefragt.<br />
Jetzt hab ich mein Blackjack fast fertig, aber ich komm an dem Punkt nicht weiter, wo er, wenn er über 21 geht dann sagt &quot;YOU LOOSE&quot;. Könnte mir da jemand helfen?</p>
<p>Ist ein bisschen Chaos im Code <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title="=)"
      alt="🙂"
    /></p>
<pre><code>/*
Blackjack made by Marc G. 2006
*/

/*
Ass = 1 oder 11
König = 10
Königin = 10
Bube = 10
*/

//Libarys
#include &lt;iostream&gt;
#include &lt;cstdlib&gt;
#include &lt;ctime&gt;

//Soweit unwichtig...
using namespace std;

//Haupt-Funktion
int main()
{

//Deklarationen
srand(time(0));
int a = rand() % 9 + 2;
int b = rand() % 9 + 2;
int c = rand() % 9 + 2;
int d = rand() % 9 + 2;
int e = rand() % 9 + 2;
int f = rand() % 9 + 2;
int g = rand() % 9 + 2;
int h = rand() % 9 + 2;
int i = rand() % 9 + 2;
int j = rand() % 9 + 2;
int k = rand() % 9 + 2;
char ch = 0;
int insg, insg2, insg3, insg4, insg5, insg6, insg7, insg8, insg9, insg10, insg11, eing;

//Ausgabe (Design)
if(a&lt;=21)
{
insg = a + b;
}else{
system(&quot;cls&quot;);
cout&lt;&lt;&quot;YOU LOST - You took to much&quot;&lt;&lt;endl;
}
cout&lt;&lt;&quot;1st Card: &quot;&lt;&lt;a&lt;&lt;&quot; \n2nd Card: &quot;&lt;&lt;b&lt;&lt;&quot; \n\nTogether: &quot;&lt;&lt;insg&lt;&lt;endl;
cout&lt;&lt;&quot;\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nTake another Card, type: 1\n&quot;;
cout&lt;&lt;&quot;Stand with that Cards, type: 2\n&quot;;
cout&lt;&lt;&quot;To quit, type: Q + Enter\n&quot;;
eing = 0;
cin&gt;&gt;eing;

//Wenn zu viel - dann tod!
if(insg &gt; 21)
{
cout&lt;&lt;&quot;You lost!&quot;&lt;&lt;endl;
}else if(insg2 &gt; 21){
      system(&quot;cls&quot;);
      cout&lt;&lt;&quot;You Lost!&quot;;    
}else if(insg3 &gt; 21){
      system(&quot;cls&quot;);
      cout&lt;&lt;&quot;You Lost!&quot;;    
}else if(insg4 &gt; 21){
      system(&quot;cls&quot;);
      cout&lt;&lt;&quot;You Lost!&quot;;    
}else if(insg5 &gt; 21){
      system(&quot;cls&quot;);
      cout&lt;&lt;&quot;You Lost!&quot;;  
}else if(insg6 &gt; 21){
      system(&quot;cls&quot;);
      cout&lt;&lt;&quot;You Lost!&quot;;  
}

if(eing = 1)
{
system(&quot;cls&quot;);
insg2 = a + b + c;
cout&lt;&lt;&quot;1st Card: &quot;&lt;&lt;a&lt;&lt;&quot; \n2nd Card: &quot;&lt;&lt;b&lt;&lt;&quot;\n3rd Card: &quot;&lt;&lt;c&lt;&lt;&quot; \n\nTogether: &quot;&lt;&lt;insg2&lt;&lt;endl;

}

cout&lt;&lt;&quot;\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nTake another Card, type: 1\n&quot;;
cout&lt;&lt;&quot;Stand with that Cards, type: 2\n&quot;;
cout&lt;&lt;&quot;To quit, type: Q + Enter\n&quot;;
eing = 0;
cin&gt;&gt;eing;

//Wenn zu viel - dann tod!
if(insg &gt; 21)
{
cout&lt;&lt;&quot;You lost!&quot;&lt;&lt;endl;
}else if(insg2 &gt; 21){
      system(&quot;cls&quot;);
      cout&lt;&lt;&quot;You Lost!&quot;;    
}else if(insg3 &gt; 21){
      system(&quot;cls&quot;);
      cout&lt;&lt;&quot;You Lost!&quot;;    
}else if(insg4 &gt; 21){
      system(&quot;cls&quot;);
      cout&lt;&lt;&quot;You Lost!&quot;;    
}else if(insg5 &gt; 21){
      system(&quot;cls&quot;);
      cout&lt;&lt;&quot;You Lost!&quot;;  
}else if(insg6 &gt; 21){
      system(&quot;cls&quot;);
      cout&lt;&lt;&quot;You Lost!&quot;;  
}

if(eing = 1)
{
system(&quot;cls&quot;);
insg3 = a + b + c + d;
cout&lt;&lt;&quot;1st Card: &quot;&lt;&lt;a&lt;&lt;&quot; \n2nd Card: &quot;&lt;&lt;b&lt;&lt;&quot;\n3rd Card: &quot;&lt;&lt;c&lt;&lt;&quot;\n4th Card: &quot;&lt;&lt;d&lt;&lt;&quot; \n\nTogether: &quot;&lt;&lt;insg3&lt;&lt;endl;
}

cout&lt;&lt;&quot;\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nTake another Card, type: 1\n&quot;;
cout&lt;&lt;&quot;Stand with that Cards, type: 2\n&quot;;
cout&lt;&lt;&quot;To quit, type: Q + Enter\n&quot;;
eing = 0;
cin&gt;&gt;eing;

//Wenn zu viel - dann tod!
if(insg &gt; 21)
{
cout&lt;&lt;&quot;You lost!&quot;&lt;&lt;endl;
}else if(insg2 &gt; 21){
      system(&quot;cls&quot;);
      cout&lt;&lt;&quot;You Lost!&quot;;    
}else if(insg3 &gt; 21){
      system(&quot;cls&quot;);
      cout&lt;&lt;&quot;You Lost!&quot;;    
}else if(insg4 &gt; 21){
      system(&quot;cls&quot;);
      cout&lt;&lt;&quot;You Lost!&quot;;    
}else if(insg5 &gt; 21){
      system(&quot;cls&quot;);
      cout&lt;&lt;&quot;You Lost!&quot;;  
}else if(insg6 &gt; 21){
      system(&quot;cls&quot;);
      cout&lt;&lt;&quot;You Lost!&quot;;  
}

if(eing = 1)
{
system(&quot;cls&quot;);
insg4 = a + b + c + d + e;
cout&lt;&lt;&quot;1st Card: &quot;&lt;&lt;a&lt;&lt;&quot; \n2nd Card: &quot;&lt;&lt;b&lt;&lt;&quot;\n3rd Card: &quot;&lt;&lt;c&lt;&lt;&quot;\n4th Card: &quot;&lt;&lt;d&lt;&lt;&quot;\n5th Card: &quot;&lt;&lt;e&lt;&lt;&quot; \n\nTogether: &quot;&lt;&lt;insg4&lt;&lt;endl;
}

cout&lt;&lt;&quot;\n\n\n\n\n\n\n\n\n\n\n\n\n\nTake another Card, type: 1\n&quot;;
cout&lt;&lt;&quot;Stand with that Cards, type: 2\n&quot;;
cout&lt;&lt;&quot;To quit, type: Q + Enter\n&quot;;
eing = 0;
cin&gt;&gt;eing;

//Wenn zu viel - dann tod!
if(insg &gt; 21)
{
cout&lt;&lt;&quot;You lost!&quot;&lt;&lt;endl;
}else if(insg2 &gt; 21){
      system(&quot;cls&quot;);
      cout&lt;&lt;&quot;You Lost!&quot;;    
}else if(insg3 &gt; 21){
      system(&quot;cls&quot;);
      cout&lt;&lt;&quot;You Lost!&quot;;    
}else if(insg4 &gt; 21){
      system(&quot;cls&quot;);
      cout&lt;&lt;&quot;You Lost!&quot;;    
}else if(insg5 &gt; 21){
      system(&quot;cls&quot;);
      cout&lt;&lt;&quot;You Lost!&quot;;  
}else if(insg6 &gt; 21){
      system(&quot;cls&quot;);
      cout&lt;&lt;&quot;You Lost!&quot;;  
}

if(eing = 1)
{
system(&quot;cls&quot;);
insg5 = a + b + c + d + e + f;
cout&lt;&lt;&quot;1st Card: &quot;&lt;&lt;a&lt;&lt;&quot; \n2nd Card: &quot;&lt;&lt;b&lt;&lt;&quot;\n3rd Card: &quot;&lt;&lt;c&lt;&lt;&quot;\n4th Card: &quot;&lt;&lt;d&lt;&lt;&quot;\n5th Card: &quot;&lt;&lt;e&lt;&lt;&quot;\n6th Card: &quot;&lt;&lt;f&lt;&lt;&quot; \n\nTogether: &quot;&lt;&lt;insg5&lt;&lt;endl;
}

cout&lt;&lt;&quot;\n\n\n\n\n\n\n\n\n\n\n\n\nTake another Card, type: 1\n&quot;;
cout&lt;&lt;&quot;Stand with that Cards, type: 2\n&quot;;
cout&lt;&lt;&quot;To quit, type: Q + Enter\n&quot;;
eing = 0;
cin&gt;&gt;eing;

//Wenn zu viel - dann tod!
if(insg &gt; 21)
{
cout&lt;&lt;&quot;You lost!&quot;&lt;&lt;endl;
}else if(insg2 &gt; 21){
      system(&quot;cls&quot;);
      cout&lt;&lt;&quot;You Lost!&quot;;    
}else if(insg3 &gt; 21){
      system(&quot;cls&quot;);
      cout&lt;&lt;&quot;You Lost!&quot;;    
}else if(insg4 &gt; 21){
      system(&quot;cls&quot;);
      cout&lt;&lt;&quot;You Lost!&quot;;    
}else if(insg5 &gt; 21){
      system(&quot;cls&quot;);
      cout&lt;&lt;&quot;You Lost!&quot;;  
}else if(insg6 &gt; 21){
      system(&quot;cls&quot;);
      cout&lt;&lt;&quot;You Lost!&quot;;  
}

if(eing = 1)
{
system(&quot;cls&quot;);
insg6 = a + b + c + d + e + f + g;
cout&lt;&lt;&quot;1st Card: &quot;&lt;&lt;a&lt;&lt;&quot; \n2nd Card: &quot;&lt;&lt;b&lt;&lt;&quot;\n3rd Card: &quot;&lt;&lt;c&lt;&lt;&quot;\n4th Card: &quot;&lt;&lt;d&lt;&lt;&quot;\n5th Card: &quot;&lt;&lt;e&lt;&lt;&quot;\n6th Card: &quot;&lt;&lt;f&lt;&lt;&quot;\n7th Card: &quot;&lt;&lt;g&lt;&lt;&quot; \n\nTogether: &quot;&lt;&lt;insg6&lt;&lt;endl;
}
cout&lt;&lt;&quot;\n\n\n\n\n\n\n\n\n\n\n\nTake another Card, type: 1\n&quot;;
cout&lt;&lt;&quot;Stand with that Cards, type: 2\n&quot;;
cout&lt;&lt;&quot;To quit, type: Q + Enter\n&quot;;
eing = 0;
cin&gt;&gt;eing;

//Wenn zu viel - dann tod!
if(insg &gt; 21)
{
cout&lt;&lt;&quot;You lost!&quot;&lt;&lt;endl;
}else if(insg2 &gt; 21){
      system(&quot;cls&quot;);
      cout&lt;&lt;&quot;You Lost!&quot;;    
}else if(insg3 &gt; 21){
      system(&quot;cls&quot;);
      cout&lt;&lt;&quot;You Lost!&quot;;    
}else if(insg4 &gt; 21){
      system(&quot;cls&quot;);
      cout&lt;&lt;&quot;You Lost!&quot;;    
}else if(insg5 &gt; 21){
      system(&quot;cls&quot;);
      cout&lt;&lt;&quot;You Lost!&quot;;  
}else if(insg6 &gt; 21){
      system(&quot;cls&quot;);
      cout&lt;&lt;&quot;You Lost!&quot;;  
}

if(eing = 1)
{
system(&quot;cls&quot;);
insg7 = a + b + c + d + e + f + g + h;
cout&lt;&lt;&quot;1st Card: &quot;&lt;&lt;a&lt;&lt;&quot; \n2nd Card: &quot;&lt;&lt;b&lt;&lt;&quot;\n3rd Card: &quot;&lt;&lt;c&lt;&lt;&quot;\n4th Card: &quot;&lt;&lt;d&lt;&lt;&quot;\n5th Card: &quot;&lt;&lt;e&lt;&lt;&quot;\n6th Card: &quot;&lt;&lt;f&lt;&lt;&quot;\n7th Card: &quot;&lt;&lt;g&lt;&lt;&quot;\n8th Card:&quot;&lt;&lt;h&lt;&lt;&quot; \n\nTogether: &quot;&lt;&lt;insg7&lt;&lt;endl;
}

cout&lt;&lt;&quot;\n\n\n\n\n\n\n\n\n\n\nTake another Card, type: 1\n&quot;;
cout&lt;&lt;&quot;Stand with that Cards, type: 2\n&quot;;
cout&lt;&lt;&quot;To quit, type: Q + Enter\n&quot;;
eing = 0;
cin&gt;&gt;eing;

//Wenn zu viel - dann tod!
if(insg &gt; 21)
{
cout&lt;&lt;&quot;You lost!&quot;&lt;&lt;endl;
}else if(insg2 &gt; 21){
      system(&quot;cls&quot;);
      cout&lt;&lt;&quot;You Lost!&quot;;    
}else if(insg3 &gt; 21){
      system(&quot;cls&quot;);
      cout&lt;&lt;&quot;You Lost!&quot;;    
}else if(insg4 &gt; 21){
      system(&quot;cls&quot;);
      cout&lt;&lt;&quot;You Lost!&quot;;    
}else if(insg5 &gt; 21){
      system(&quot;cls&quot;);
      cout&lt;&lt;&quot;You Lost!&quot;;  
}else if(insg6 &gt; 21){
      system(&quot;cls&quot;);
      cout&lt;&lt;&quot;You Lost!&quot;;  
}

if(eing = 1)
{
system(&quot;cls&quot;);
insg8 = a + b + c + d + e + f + g + h + i;
cout&lt;&lt;&quot;1st Card: &quot;&lt;&lt;a&lt;&lt;&quot; \n2nd Card: &quot;&lt;&lt;b&lt;&lt;&quot;\n3rd Card: &quot;&lt;&lt;c&lt;&lt;&quot;\n4th Card: &quot;&lt;&lt;d&lt;&lt;&quot;\n5th Card: &quot;&lt;&lt;e&lt;&lt;&quot;\n6th Card: &quot;&lt;&lt;f&lt;&lt;&quot;\n7th Card: &quot;&lt;&lt;g&lt;&lt;&quot;\n8th Card:&quot;&lt;&lt;h&lt;&lt;&quot;\n9th Card: &quot;&lt;&lt;i&lt;&lt;&quot; \n\nTogether: &quot;&lt;&lt;insg8&lt;&lt;endl;
}

cout&lt;&lt;&quot;\n\n\n\n\n\n\n\n\n\nTake another Card, type: 1\n&quot;;
cout&lt;&lt;&quot;Stand with that Cards, type: 2\n&quot;;
cout&lt;&lt;&quot;To quit, type: Q + Enter\n&quot;;
eing = 0;
cin&gt;&gt;eing;

//Wenn zu viel - dann tod!
if(insg &gt; 21)
{
cout&lt;&lt;&quot;You lost!&quot;&lt;&lt;endl;
}else if(insg2 &gt; 21){
      system(&quot;cls&quot;);
      cout&lt;&lt;&quot;You Lost!&quot;;    
}else if(insg3 &gt; 21){
      system(&quot;cls&quot;);
      cout&lt;&lt;&quot;You Lost!&quot;;    
}else if(insg4 &gt; 21){
      system(&quot;cls&quot;);
      cout&lt;&lt;&quot;You Lost!&quot;;    
}else if(insg5 &gt; 21){
      system(&quot;cls&quot;);
      cout&lt;&lt;&quot;You Lost!&quot;;  
}else if(insg6 &gt; 21){
      system(&quot;cls&quot;);
      cout&lt;&lt;&quot;You Lost!&quot;;  
}

if(eing = 1)
{
system(&quot;cls&quot;);
insg9 = a + b + c + d + e + f + g + h + i + j;
cout&lt;&lt;&quot;1st Card: &quot;&lt;&lt;a&lt;&lt;&quot; \n2nd Card: &quot;&lt;&lt;b&lt;&lt;&quot;\n3rd Card: &quot;&lt;&lt;c&lt;&lt;&quot;\n4th Card: &quot;&lt;&lt;d&lt;&lt;&quot;\n5th Card: &quot;&lt;&lt;e&lt;&lt;&quot;\n6th Card: &quot;&lt;&lt;f&lt;&lt;&quot;\n7th Card: &quot;&lt;&lt;g&lt;&lt;&quot;\n8th Card: &quot;&lt;&lt;h&lt;&lt;&quot;\n9th Card: &quot;&lt;&lt;i&lt;&lt;&quot;\n10th Card:&quot;&lt;&lt;j&lt;&lt;&quot; \n\nTogether: &quot;&lt;&lt;insg9&lt;&lt;endl;
}

cout&lt;&lt;&quot;\n\n\n\n\n\n\n\n\nTake another Card, type: 1\n&quot;;
cout&lt;&lt;&quot;Stand with that Cards, type: 2\n&quot;;
cout&lt;&lt;&quot;To quit, type: Q + Enter\n&quot;;
eing = 0;
cin&gt;&gt;eing;

//Wenn zu viel - dann tod!
if(insg &gt; 21)
{
cout&lt;&lt;&quot;You lost!&quot;&lt;&lt;endl;
}else if(insg2 &gt; 21){
      system(&quot;cls&quot;);
      cout&lt;&lt;&quot;You Lost!&quot;;    
}else if(insg3 &gt; 21){
      system(&quot;cls&quot;);
      cout&lt;&lt;&quot;You Lost!&quot;;    
}else if(insg4 &gt; 21){
      system(&quot;cls&quot;);
      cout&lt;&lt;&quot;You Lost!&quot;;    
}else if(insg5 &gt; 21){
      system(&quot;cls&quot;);
      cout&lt;&lt;&quot;You Lost!&quot;;  
}else if(insg6 &gt; 21){
      system(&quot;cls&quot;);
      cout&lt;&lt;&quot;You Lost!&quot;;  
}

if(eing = 1)
{
system(&quot;cls&quot;);
insg10 = a + b + c + d + e + f + g + h + i + j;
cout&lt;&lt;&quot;1st Card: &quot;&lt;&lt;a&lt;&lt;&quot; \n2nd Card: &quot;&lt;&lt;b&lt;&lt;&quot;\n3rd Card: &quot;&lt;&lt;c&lt;&lt;&quot;\n4th Card: &quot;&lt;&lt;d&lt;&lt;&quot;\n5th Card: &quot;&lt;&lt;e&lt;&lt;&quot;\n6th Card: &quot;&lt;&lt;f&lt;&lt;&quot;\n7th Card: &quot;&lt;&lt;g&lt;&lt;&quot;\n8th Card: &quot;&lt;&lt;h&lt;&lt;&quot;\n9th Card: &quot;&lt;&lt;i&lt;&lt;&quot;\n10th Card: &quot;&lt;&lt;j&lt;&lt;&quot;\n11th Card: &quot;&lt;&lt;k&lt;&lt;&quot; \n\nTogether: &quot;&lt;&lt;insg10&lt;&lt;endl;
}

cout&lt;&lt;&quot;\n\n\n\n\n\n\n\nTake another Card, type: 1\n&quot;;
cout&lt;&lt;&quot;Stand with that Cards, type: 2\n&quot;;
cout&lt;&lt;&quot;To quit, type: Q + Enter\n&quot;;
eing = 0;
cin&gt;&gt;eing;

//Wenn zu viel - dann tod!
if(insg &gt; 21)
{
cout&lt;&lt;&quot;You lost!&quot;&lt;&lt;endl;
}else if(insg2 &gt; 21){
      system(&quot;cls&quot;);
      cout&lt;&lt;&quot;You Lost!&quot;;    
}else if(insg3 &gt; 21){
      system(&quot;cls&quot;);
      cout&lt;&lt;&quot;You Lost!&quot;;    
}else if(insg4 &gt; 21){
      system(&quot;cls&quot;);
      cout&lt;&lt;&quot;You Lost!&quot;;    
}else if(insg5 &gt; 21){
      system(&quot;cls&quot;);
      cout&lt;&lt;&quot;You Lost!&quot;;  
}else if(insg6 &gt; 21){
      system(&quot;cls&quot;);
      cout&lt;&lt;&quot;You Lost!&quot;;  
}

if(eing = 1)
{
system(&quot;cls&quot;);
insg11 = a + b + c + d + e + f + g + h + i + j + k;
cout&lt;&lt;&quot;This was too much, you lost.&quot;&lt;&lt;endl;
}

cout&lt;&lt;&quot;\n\n\n\n\n\n\n\n\n\n\n\n\n\nTake another Card, type: 1\n&quot;;
cout&lt;&lt;&quot;Stand with that Cards, type: 2\n&quot;;
cout&lt;&lt;&quot;To quit, type: Q + Enter\n&quot;;
eing = 0;
cin&gt;&gt;eing;

//SCHLEIFE + Schließen
do{
ch = cin.get( );    
} while(ch != 'Q'); 
//SCHLEIFEN-ENDE

cin.get();
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1069485</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1069485</guid><dc:creator><![CDATA[FreeR0M]]></dc:creator><pubDate>Thu, 01 Jun 2006 11:48:46 GMT</pubDate></item><item><title><![CDATA[Reply to *argh* Blackjack on Thu, 01 Jun 2006 11:53:47 GMT]]></title><description><![CDATA[<p>Ich sehe min. 50 &quot;YOU LOST&quot;... wo genau hängst du?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1069490</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1069490</guid><dc:creator><![CDATA[GPC]]></dc:creator><pubDate>Thu, 01 Jun 2006 11:53:47 GMT</pubDate></item><item><title><![CDATA[Reply to *argh* Blackjack on Thu, 01 Jun 2006 12:03:00 GMT]]></title><description><![CDATA[<p>Und zwar an dem Punkt, nach dem er die 2te Zahl ausgegeben hat. Weil es ja sein kann, das man dann 20 Hat und jemand stop drücken will. Und genau da hänge ich, er soll dann, wenn man nach der 2ten Zahl 20 hat und dann noch eine Zahl bekommt und über 21 kommt, das er dann schreiben soll: &quot;YOU LOST&quot;, also an dieser stelle ungefähr---&gt;</p>
<pre><code class="language-cpp">//Ausgabe (Design)
if(a&lt;=21)
{
insg = a + b;
}else{
system(&quot;cls&quot;);
cout&lt;&lt;&quot;YOU LOST - You took to much&quot;&lt;&lt;endl;
}
cout&lt;&lt;&quot;1st Card: &quot;&lt;&lt;a&lt;&lt;&quot; \n2nd Card: &quot;&lt;&lt;b&lt;&lt;&quot; \n\nTogether: &quot;&lt;&lt;insg&lt;&lt;endl;
cout&lt;&lt;&quot;\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nTake another Card, type: 1\n&quot;;
cout&lt;&lt;&quot;Stand with that Cards, type: 2\n&quot;;
cout&lt;&lt;&quot;To quit, type: Q + Enter\n&quot;;
eing = 0;
cin&gt;&gt;eing;

//Wenn zu viel - dann tod!
if(insg &gt; 21)
{
cout&lt;&lt;&quot;You lost!&quot;&lt;&lt;endl;
}else if(insg2 &gt; 21){
      system(&quot;cls&quot;);
      cout&lt;&lt;&quot;You Lost!&quot;;    
}else if(insg3 &gt; 21){
      system(&quot;cls&quot;);
      cout&lt;&lt;&quot;You Lost!&quot;;    
}else if(insg4 &gt; 21){
      system(&quot;cls&quot;);
      cout&lt;&lt;&quot;You Lost!&quot;;    
}else if(insg5 &gt; 21){
      system(&quot;cls&quot;);
      cout&lt;&lt;&quot;You Lost!&quot;;  
}else if(insg6 &gt; 21){
      system(&quot;cls&quot;);
      cout&lt;&lt;&quot;You Lost!&quot;;  
}

if(eing = 1)
{
system(&quot;cls&quot;);
insg2 = a + b + c;
cout&lt;&lt;&quot;1st Card: &quot;&lt;&lt;a&lt;&lt;&quot; \n2nd Card: &quot;&lt;&lt;b&lt;&lt;&quot;\n3rd Card: &quot;&lt;&lt;c&lt;&lt;&quot; \n\nTogether: &quot;&lt;&lt;insg2&lt;&lt;endl;

}

cout&lt;&lt;&quot;\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nTake another Card, type: 1\n&quot;;
cout&lt;&lt;&quot;Stand with that Cards, type: 2\n&quot;;
cout&lt;&lt;&quot;To quit, type: Q + Enter\n&quot;;
eing = 0;
cin&gt;&gt;eing;
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1069500</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1069500</guid><dc:creator><![CDATA[FreeR0M]]></dc:creator><pubDate>Thu, 01 Jun 2006 12:03:00 GMT</pubDate></item><item><title><![CDATA[Reply to *argh* Blackjack on Thu, 01 Jun 2006 12:06:44 GMT]]></title><description><![CDATA[<p>An der Stelle hast du 'insg2' und die weiteren Zwischensummen auch noch gar nicht initialisiert.</p>
<p>(btw reicht eine Zwischensumme aus, in der du dir den jeweils aktuellen Stand merkst)</p>
<p>PS: Und mit 2 Karten kann man noch gar nicht über 21 kommen <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1069506</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1069506</guid><dc:creator><![CDATA[CStoll]]></dc:creator><pubDate>Thu, 01 Jun 2006 12:06:44 GMT</pubDate></item><item><title><![CDATA[Reply to *argh* Blackjack on Thu, 01 Jun 2006 12:12:05 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/11682">@FreeR0M</a>:</p>
<p>du solltest mal die elementaren Grundbegriffe wie Arrays und Funktionen lernen und verwenden(!). Dann hättest du auch nicht so viele Fehler im Programm...</p>
<p>&quot;Für Programmier-Anfänger sollte man C&amp;P verbieten!&quot;</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1069515</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1069515</guid><dc:creator><![CDATA[Th]]></dc:creator><pubDate>Thu, 01 Jun 2006 12:12:05 GMT</pubDate></item><item><title><![CDATA[Reply to *argh* Blackjack on Thu, 01 Jun 2006 12:12:18 GMT]]></title><description><![CDATA[<p>Überleg dir mal um das spiel ne schleife drumherumzusetzten.<br />
Ich sehe ca. 10 mal denselben code!<br />
Dein ganzes Programm könnte man mit schleifen also auf ca 1/10 des codes reduzieren. Dann wird dein Problem vll. auch besser ersichtlich.<br />
(Ich glaub keiner ließt sich so einen großen code ganz durch)</p>
<p>Desweiteren solltest du uns sagen wo genau dein problem liegt.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1069516</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1069516</guid><dc:creator><![CDATA[Mario Sandler]]></dc:creator><pubDate>Thu, 01 Jun 2006 12:12:18 GMT</pubDate></item><item><title><![CDATA[Reply to *argh* Blackjack on Thu, 01 Jun 2006 12:23:16 GMT]]></title><description><![CDATA[<p>ich sehe spontan solche fehler:</p>
<p>if(eing = 1)</p>
<p>wie geht der vergleichsoperator? <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1069532</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1069532</guid><dc:creator><![CDATA[elise]]></dc:creator><pubDate>Thu, 01 Jun 2006 12:23:16 GMT</pubDate></item><item><title><![CDATA[Reply to *argh* Blackjack on Thu, 01 Jun 2006 12:25:38 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/9348">@Th</a>: Ich kann das ganze Zeug, weiss nur nicht, wie ich das in mein Spiel implementieren soll <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f615.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--confused_face"
      title=":/"
      alt="😕"
    /></p>
<p><a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/8753">@Storm</a>: Ja das stimmt allerdings!</p>
<p><a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/448">@elise</a>: &quot;==&quot; stimmt :S</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1069536</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1069536</guid><dc:creator><![CDATA[FreeR0M]]></dc:creator><pubDate>Thu, 01 Jun 2006 12:25:38 GMT</pubDate></item><item><title><![CDATA[Reply to *argh* Blackjack on Thu, 01 Jun 2006 12:32:07 GMT]]></title><description><![CDATA[<p>@FreeROM:</p>
<blockquote>
<p><a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/9348">@Th</a>: Ich kann das ganze Zeug, weiss nur nicht, wie ich das in mein Spiel implementieren soll <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f615.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--confused_face"
      title=":/"
      alt="😕"
    /></p>
</blockquote>
<p>So definierst du also &quot;Können&quot;?</p>
<p>hier mal ein kurzer Tipp:</p>
<pre><code class="language-cpp">int wert = 0;
int karte;
do
{
  karte = rand()%9+2;
  wert += karte;
}while(wert &lt;= 21);
</code></pre>
<p>Ein- und Ausgabe mußt du nur noch ergänzen...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1069544</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1069544</guid><dc:creator><![CDATA[Th]]></dc:creator><pubDate>Thu, 01 Jun 2006 12:32:07 GMT</pubDate></item><item><title><![CDATA[Reply to *argh* Blackjack on Thu, 01 Jun 2006 16:09:38 GMT]]></title><description><![CDATA[<p>hä?</p>
<p>Ich sagte, ich kann Schleifen und co, aber weiss nicht, wie ich sie mit Blackjack in Verbindung setzen soll.</p>
<p>Deine kleine Schleife funktioniert auch nur halb, weil da kommt 20 ma hintereinander z.B. 7 raus, wenn ich jetzt aber 2 Karten ziehen will, dann kommt ja immer z.B. immer 14, bzw. das Doppelte der Random-Zahlen raus, weils ja immer das gleiche ist?!?!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1069698</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1069698</guid><dc:creator><![CDATA[FreeR0M-Gast]]></dc:creator><pubDate>Thu, 01 Jun 2006 16:09:38 GMT</pubDate></item><item><title><![CDATA[Reply to *argh* Blackjack on Fri, 02 Jun 2006 06:38:05 GMT]]></title><description><![CDATA[<p>Was rechnest du denn, daß da immer das selbe rauskommen soll? rand() liefert bei jedem Aufruf eine neue Zufallszahl. Und Th's Konstruktion addiert solange Zufallswerte, bis sie über 21 kommt (die Ausgabe der Zwischenwerte und die Abfrage, ob der Spieler weitermachen will, mußt du da noch selber einbauen).</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1069883</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1069883</guid><dc:creator><![CDATA[CStoll]]></dc:creator><pubDate>Fri, 02 Jun 2006 06:38:05 GMT</pubDate></item><item><title><![CDATA[Reply to *argh* Blackjack on Fri, 02 Jun 2006 14:21:29 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/10318">@CStoll</a>: Wenn ich TH's kleines Teil berechnen lasse und 2 mal ausgeben lasse, dann kommt 20 mal die gleiche Zahl.</p>
<p>Wenn ich jetzt also eine Random-Zahl haben will OK, aber wenn ich jetzt die 2te KArte ziehen will, dann kommt ja wieder die selbe Random Zahl heraus?!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1070135</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1070135</guid><dc:creator><![CDATA[FreeR0M]]></dc:creator><pubDate>Fri, 02 Jun 2006 14:21:29 GMT</pubDate></item><item><title><![CDATA[Reply to *argh* Blackjack on Fri, 02 Jun 2006 14:41:05 GMT]]></title><description><![CDATA[<p>ooo also mit diesem Spaghetticode solltest lieber nicht weitermachen.<br />
Das ist ja grauslig.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1070140</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1070140</guid><dc:creator><![CDATA[hehejo]]></dc:creator><pubDate>Fri, 02 Jun 2006 14:41:05 GMT</pubDate></item><item><title><![CDATA[Reply to *argh* Blackjack on Sun, 04 Jun 2006 06:40:17 GMT]]></title><description><![CDATA[<p>nach rand immer das gleiche ergebnis: wahrscheinlich initialisierung<br />
mit srand vergessen.</p>
<p>ausserdem sollte man sowieso sicherstellen das nicht z.b. die kreuz sieben<br />
mehr als drei mal nacheinandergezogen wird: sonst falschspieler. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /></p>
<p>und wenn du deine kenntnisse von schleifenkonstrukten nicht beim<br />
blackjack zum einsatz bringen kannst, ist die aussage blackjack ist<br />
fast fertig sehr optimistisch.<br />
obwohl ich kann mich noch waage an relativ aktuelle quelltexte erinnern die<br />
noch mit unnötigen &quot;goto&quot;-anweisungen arbeiten.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1070979</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1070979</guid><dc:creator><![CDATA[besserwisser]]></dc:creator><pubDate>Sun, 04 Jun 2006 06:40:17 GMT</pubDate></item><item><title><![CDATA[Reply to *argh* Blackjack on Sun, 04 Jun 2006 11:40:01 GMT]]></title><description><![CDATA[<p>Ich habe mal ein anderes Kartenspiel geschrieben. Vielleicht geben dir folgende Programmausschnitte einen Eindruck wie man das ganze objektorientiert lösen könnte.</p>
<p>karte.h</p>
<pre><code class="language-cpp">#ifndef __BLACKJACKKARTE_H__
#define __BLACKJACKKARTE_H__

#include &lt;string&gt;
#include &quot;farbe.h&quot;
#include &quot;wert.h&quot;

namespace blackjack {

static const int max_wert_ass = 11;

class Karte {
private:
    Farbe farbe;
    Wert wert;

public:
    Karte()
            : farbe(PICK), wert(ASS) {}

    explicit Karte(Farbe f, Wert w)
            : farbe(f), wert(w) {}

    ~Karte() {}

    Farbe getFarbe() const {
        return farbe;
    }

    std::string getFarbeStr() const;

    Wert getWert() const {
        return wert;
    }

    std::string getWertStr() const;

    int minValue() const;
    int maxValue() const;
};

}

#endif
</code></pre>
<p>kartenstapel.h</p>
<pre><code class="language-cpp">#ifndef __BLACKJACKKARTENSTAPEL_H__
#define __BLACKJACKKARTENSTAPEL_H__

#include &lt;vector&gt;
#include &quot;karte.h&quot;

static const int anzahlDecks = 6;
static const int kartenProDeck = 52;
static const int anzahlKarten = anzahlDecks * kartenProDeck; 

namespace blackjack {

class Kartenstapel{
private:
	typedef std::vector&lt;Karte*&gt; vec_type;
	vec_type v;

public:
    void initStapel();

    Karte* getKarte();

};

}

#endif
</code></pre>
<p>kartenstapel.cpp</p>
<pre><code class="language-cpp">#include &quot;kartenstapel.h&quot;
#include &lt;algorithm&gt;

#include &lt;iostream&gt;
using namespace std;

using namespace blackjack;

struct generator_ {
    int f, w;

    generator_()
            : f(blackjack::PICK), w(0) {}

    Karte* operator()() {
        if (w == blackjack::KOENIG) {
            w = blackjack::ASS;

            if (f == blackjack::KARO)
                f = blackjack::PICK;
            else
                ++f;
        } else
            ++w;

        return new Karte(static_cast&lt;Farbe&gt;(f)
                         , static_cast&lt;Wert&gt;(w));
    }
};

namespace blackjack {

void Kartenstapel::initStapel() {
    vec_type::iterator i = v.begin();
    while (i != v.end())
        delete *i++;

    v.resize(anzahlKarten, 0);
    generate(v.begin(), v.end(), generator_());

#ifdef _GLIBCPP_HAVE_DRAND48

    srand48(time(0));
#else

    srand(time(0));
#endif

    random_shuffle(v.begin(), v.end());
}

Karte* Kartenstapel::getKarte() {
    if (v.empty())
        return 0;

    Karte* tmp = v.back();
    v.pop_back();
    return tmp;
}

}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1071089</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1071089</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Sun, 04 Jun 2006 11:40:01 GMT</pubDate></item><item><title><![CDATA[Reply to *argh* Blackjack on Sun, 04 Jun 2006 13:09:36 GMT]]></title><description><![CDATA[<p>auf so etwas kompeliziertes wäre ich zwar nicht gekommen, ist aber richtig geil<br />
danke! <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1071142</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1071142</guid><dc:creator><![CDATA[FreeR0M]]></dc:creator><pubDate>Sun, 04 Jun 2006 13:09:36 GMT</pubDate></item><item><title><![CDATA[Reply to *argh* Blackjack on Sun, 04 Jun 2006 13:28:57 GMT]]></title><description><![CDATA[<blockquote>
<p>auf so etwas kompeliziertes wäre ich zwar nicht gekommen, ist aber richtig geil<br />
danke!</p>
</blockquote>
<p>Kompliziert finde ich das ganz und garnicht. Nimm mir das jetzt nicht böse <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /> - aber unübersichtlicher und redundanter Quelltext ist viel umständlicher zu lesen. Aber mit der Zeit und mit guten Büchern eignet man sich schon einen guten Programmierstiel an <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1071154</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1071154</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Sun, 04 Jun 2006 13:28:57 GMT</pubDate></item><item><title><![CDATA[Reply to *argh* Blackjack on Mon, 05 Jun 2006 12:05:31 GMT]]></title><description><![CDATA[<p>ich habe M+T easy c++</p>
<p>aber das mit dem oop will einfach net in meinen kopf <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f615.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--confused_face"
      title=":/"
      alt="😕"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1071573</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1071573</guid><dc:creator><![CDATA[FreeR0M]]></dc:creator><pubDate>Mon, 05 Jun 2006 12:05:31 GMT</pubDate></item><item><title><![CDATA[Reply to *argh* Blackjack on Mon, 05 Jun 2006 13:41:32 GMT]]></title><description><![CDATA[<p>&quot;Die C++ Programmiersprache&quot; von Bjarne Stroustrup ist das ideale Buch für Fortgeschrittene C++-Programmierer. Es wird sehr detailliert auf alle wichtigen Konzepte eingegangen.</p>
<p>Ansonsten finde ich spezielle Bücher über objektorientierte Analyse und Design recht gut, da die Konzepte der OOP unabhängig von der Programmiersprache behandelt werden.</p>
<p>Ich würde mich auch mit der UML beschäftigen, so erlernt man nicht nur eine Sprache mit der man die objektorientierten Gedanken ausdrücken kann, sondern vertieft auch die Kenntnisse der OOP.</p>
<p>Von den C++-Büchern von Markt &amp; Technik bin ich eher weniger begeistert.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1071643</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1071643</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Mon, 05 Jun 2006 13:41:32 GMT</pubDate></item><item><title><![CDATA[Reply to *argh* Blackjack on Mon, 05 Jun 2006 13:49:52 GMT]]></title><description><![CDATA[<p>den code würde ich ganz schnell vergessen aber mach dir kein zu großen kopf darüber so haben wir fast alle angefangen. Mich zumindest erinner das an mein erstes VB Programm welches symbolisch ableiten sollte und da ich dahmals noch net wusste wie man das richtig macht (Parser Baum) habe ich so eine ähnlichen Code geschrieben um eine Klammer hirachie reinzubekommen das war echt graussam <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":-)"
      alt="🙂"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1071647</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1071647</guid><dc:creator><![CDATA[MadMax1982]]></dc:creator><pubDate>Mon, 05 Jun 2006 13:49:52 GMT</pubDate></item><item><title><![CDATA[Reply to *argh* Blackjack on Mon, 05 Jun 2006 14:33:12 GMT]]></title><description><![CDATA[<p>@ MadMax:</p>
<p>Welchen Code meinst du? Bezog sich das auf meinen Quelltextausschnitt?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1071674</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1071674</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Mon, 05 Jun 2006 14:33:12 GMT</pubDate></item><item><title><![CDATA[Reply to *argh* Blackjack on Mon, 05 Jun 2006 15:08:04 GMT]]></title><description><![CDATA[<p>Hier noch ein bischen Futter für den C/C++ -Compiler.<br />
Habe den Autorenhinweis noch drin da das meiste aus den ersten 20 Zeilen vom<br />
Initiator.</p>
<pre><code class="language-cpp">/* 
Blackjack made by Marc G. 2006 
*/ 

/* 
Ass = 1 oder 11 --&gt; noch nicht implementiert 
König = 10 
Königin = 10 
Bube = 10
*/ 

// todo: Spielfarben noch nicht eingebaut
// todo: Falscheingaben abfangen 

//Libarys 
#include &lt;iostream&gt; 
#include &lt;cstdlib&gt; 
#include &lt;ctime&gt; 

using namespace std; 

//Haupt-Funktion 
int main() 
{ 
	char ch = 0;
	int insg;
	int ende;

	srand(time(0)); 
	int a = rand() % 13 + 2;	// König, Dame und Bube sollten auch vertreten sein
	if(a &gt; 11)
		a = 10;	// brutal ;)  &lt;-- aber sonst Kartenwert 10 unterrepräsentiert
	insg = a;
	do{
		ch = 'z';
		ende = 0; 
		int a = rand() % 13 + 2;	// König, Dame und Bube sollten auch vertreten sein
		if(a &gt; 11)
			a = 10;	// brutal ;)  &lt;-- aber sonst Kartenwert 10 unterrepräsentiert
		insg = insg + a;
		cout &lt;&lt; &quot;bisher hast du &quot; &lt;&lt; insg &lt;&lt; &quot; Augen&quot; &lt;&lt; endl;
		if(insg&lt;=21)
		{
			cout &lt;&lt; &quot;willst du eine weitere Karte ziehen? j/n&quot; &lt;&lt; endl;
			cin &gt;&gt; ch;
			if(ch != 'j')
				ende = 1;     
		}
		else
		{
			cout &lt;&lt; &quot;zu hoch gezockt! ;) &quot; &lt;&lt; endl;
			cout &lt;&lt; &quot;genug gesehen? j/n&quot; &lt;&lt; endl;
			cin &gt;&gt; ch;
			if(ch == 'j')
				ende = 1;     
		}

	//SCHLEIFE + Schließen 
	} while(ende!=1); 
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1071704</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1071704</guid><dc:creator><![CDATA[f.-th.]]></dc:creator><pubDate>Mon, 05 Jun 2006 15:08:04 GMT</pubDate></item><item><title><![CDATA[Reply to *argh* Blackjack on Mon, 05 Jun 2006 16:23:25 GMT]]></title><description><![CDATA[<p>das ist doch mal was, damit kann ich aber richtig gut was anfangen.</p>
<p>wollte nochmals allen danken, für ihre nette hilfe <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title="=)"
      alt="🙂"
    /></p>
<p>so langsam krieg ich es auf die reihe <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f603.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--grinning_face_with_big_eyes"
      title=":D"
      alt="😃"
    /></p>
<p>grüßle, freer0m</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1071763</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1071763</guid><dc:creator><![CDATA[FreeR0M]]></dc:creator><pubDate>Mon, 05 Jun 2006 16:23:25 GMT</pubDate></item><item><title><![CDATA[Reply to *argh* Blackjack on Tue, 06 Jun 2006 15:38:07 GMT]]></title><description><![CDATA[<p>hier jetzt mein 0.2 alpha release <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /><br />
will noch spielgeld und spielkartenfarbe implementieren!</p>
<pre><code class="language-cpp">/*
     Blackjack made by Marc G. 2006

     ?todo: Spielfarben noch nicht eingebaut *4
     ?todo: Falscheingaben abfangen *3
     !done: Design *1
     ?todo: Spielgeld *2
*/

//Libarys
#include &lt;iostream&gt;
#include &lt;cstdlib&gt;
#include &lt;ctime&gt;

using namespace std;

//Haupt-Funktion
int main()
{
    char ch = 0;
    char ee = 0;
    int insg;
    int ende;
    int i=2;

    srand(time(0));
    int a = rand() % 13 + 2;    // König, Dame und Bube sollten auch vertreten sein
    if(a &gt; 11)
        a = 10;    // brutal ;)  &lt;-- aber sonst Kartenwert 10 unterrepräsentiert
    insg = a;

        cout &lt;&lt; &quot;--------------------------------------------\nWillkommen zu C++ Solo-Blackjack von Marc G.\n----------------------------------------2006&quot; &lt;&lt; endl;
        cout &lt;&lt; &quot;\n* Erklaerung der Shortcuts... \n  - j=ja\n  - n=nein\n  - q=beenden\n\n&quot; &lt;&lt; endl;         
        cout &lt;&lt; &quot;* Erklaerung von Blackjack...\n  - Bei diesem Solo-Player von Blackjack, versuchen Sie, so nah wie moeglich an   21 heran zu kommen, ueberschreiten Sie die 21, so ist das Spiel zu Ende. Errei  chen Sie direkt 21 mit 2 Karten, so nennt man dies dann 'Blackjack'.&quot;&lt;&lt;endl;
        cout &lt;&lt; &quot;\n\n\n* Weiter mit:\n b = Bugs\n k = Kontact\n w = Weiter (zum Spiel starten)\n\n\nZum einfachen fortfahren, 'w' und dann 'ENTER'-Taste druecken.&quot; &lt;&lt; endl;
        cin&gt;&gt;ee;
        if(ee == 'b')
        {
              system(&quot;cls&quot;);
              cout &lt;&lt; &quot;------------------------------------------------------------------------\n| 1. Moechte man keine Karte mehr ziehen, so stuertzt das Programm ab. |\n| 2. ?                                                                 |\n------------------------------------------------------------------------\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n&quot;&lt;&lt;endl;
              system(&quot;pause&quot;);
              return main();
        }
        else if(ee == 'k')
        {
              system(&quot;cls&quot;);
              cout &lt;&lt; &quot;-----------------------------------\n| E-Mail: marc.gunit(at)gmail.com |\n| MSN: r0m(at)hotmail.de          |\n-----------------------------------\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n&quot;&lt;&lt;endl;
              system(&quot;pause&quot;);
              return main();
        }
        else if(ee == 'w')
        {

        }
        system(&quot;cls&quot;);
  do{
        ch = 'z';
        ende = 0;
        int a = rand() % 13 + 2;    // König, Dame und Bube sollten auch vertreten sein
        if(a &gt; 11)
            a = 10;    // brutal ;)  &lt;-- aber sonst Kartenwert 10 unterrepräsentiert
        insg = insg + a;
        cout &lt;&lt; &quot;--------------------------------------------\n| Bisher hast du &quot; &lt;&lt; i &lt;&lt; &quot; Karten und &quot; &lt;&lt; insg &lt;&lt; &quot; Augen&quot; &lt;&lt; endl;
        if(insg&lt;21)
        {
            cout &lt;&lt; &quot;--------------------------------------------\n| Willst du eine weitere Karte ziehen? j/n |\n--------------------------------------------&quot; &lt;&lt; endl;
            cin &gt;&gt; ch;
            i++;
            if(ch != 'j')
            ende = 1;
        }
        else if(insg == 21)
        {
             cout&lt;&lt;&quot;Glueckwunsch, Sie haben genau 21 erreicht!&quot;&lt;&lt;endl;
        }
        else
        {
            system(&quot;cls&quot;);
            cout &lt;&lt; &quot;--------------------------------\n| End-Ergebniss: &quot;&lt;&lt; insg &lt;&lt; endl;
            cout &lt;&lt; &quot;| Spielende - Das war zu viel! |\n--------------------------------&quot; &lt;&lt; endl;
            cout &lt;&lt; &quot;| Nochmal? j/n                 |\n--------------------------------&quot; &lt;&lt; endl;
            cin &gt;&gt; ch;
            if(ch == 'j')
                {
                     system(&quot;cls&quot;);
                     return main();
                }

            if(ch == 'n')
                ende = 1;
                {
                     return 0;
                }
        }
    } while(ende!=1);
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1072620</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1072620</guid><dc:creator><![CDATA[FreeR0M]]></dc:creator><pubDate>Tue, 06 Jun 2006 15:38:07 GMT</pubDate></item><item><title><![CDATA[Reply to *argh* Blackjack on Tue, 06 Jun 2006 16:27:51 GMT]]></title><description><![CDATA[<p>Must du mehrere Tasturabfragen machen solltest du statt if - else dich<br />
mal mit switch - case befassen.</p>
<p>Und wenn du schon system(&quot;xy&quot;)verwendest schau mal nach deiner Einleitung<br />
ob du da nicht ein paar einsparen kannst(von den &quot;cls&quot;).</p>
<p>system(&quot;pause&quot;) kann man auch anders lösen - es gibt genug Beispiele hier<br />
im Forum zum Thema system - versuchs hier mal mit suchen.<br />
Ausserdem, wenn du die Tasturabfragen bei mir richtig verstehst, solltest du<br />
selber eine passende Lösung(ohne system(&quot;pause&quot;)) erstellen können.</p>
<p>Man kann schon Fortschritte bei dir erkennen, aber bis es rund läuft<br />
must du wohl noch einige Varianten(mit 20 bis 50 solltest du rechnen) testen<br />
müssen.</p>
<p>MfG f.-th.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1072654</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1072654</guid><dc:creator><![CDATA[f.-th.]]></dc:creator><pubDate>Tue, 06 Jun 2006 16:27:51 GMT</pubDate></item><item><title><![CDATA[Reply to *argh* Blackjack on Tue, 06 Jun 2006 16:32:41 GMT]]></title><description><![CDATA[<p>habs übersehen:<br />
wozu in 'int main()' 'return main()' gut sein? überleg mal was do-while macht.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1072657</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1072657</guid><dc:creator><![CDATA[f.-th.]]></dc:creator><pubDate>Tue, 06 Jun 2006 16:32:41 GMT</pubDate></item></channel></rss>