<?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[nach bestätigen kehrt das prog net zur schleife zurück]]></title><description><![CDATA[<p>hi... ich hab hier mal nen shcnippsel von meinem programm.... es ist so vorgesehen das wenn die anwendung bei betaetigen der esc-taste pausiert und ein fenster sich oefnet welches fragt beenden j/n... geh ich auf nein und bestaetige gehts aber will ich weiter machen verlaesst er die schleife irgendwie nbet und fragt noch mal das selbe und so weiter...drueck ich jedoch 2mal hinter einander schnell enter klappt es und die ursprüngliche anwendung wird wieder aufgenommen. hmm was kann ich tun? gibts ne möglich keit bei pressen von enter die taste 2mal auszuwerten so das dieses doppelbetätigen hinfaellig wird???</p>
<pre><code class="language-cpp">bool play = true;
 while (play)
  {

   clrscr();
   gotoxy(snake_pos_x,snake_pos_y);                    // Spawnpoint: Schlange
   textcolor(LIGHTRED);
   cprintf(&quot;s&quot;);

     gotoxy(creep_pos_x,creep_pos_y);                  // Spwanpoint: Beute, später auf Zufall
     textcolor(GREEN);
     cprintf(&quot;o&quot;);
     gotoxy(1,20);

        textbackground(LIGHTBLUE);
        textcolor(WHITE);
        cprintf(&quot;________________________________________________________________________________&quot;);
        cout &lt;&lt; &quot;\n&quot;;
        textcolor(YELLOW);
        cprintf(&quot;Level: %d&quot;,Level);
        cout &lt;&lt; &quot;\n\n&quot;;
        cprintf(&quot;Score: %d&quot;,Score);

       Sleep(Speed);                                     // gibt die Geschwindigkeit der Schlange an

       if (kbhit())                                    // wenn Taste gedrückt wird
       {
          Key = getch();                               // Taste sofort auswerten, ohne auf Eingabe
       }                                               // zu warten

          switch (Key)                                 // Tastenfunktion zuweisen
         {
               case 'w': snake_pos_y--; break;         // hoch
               case 'a': snake_pos_x--; break;         // links
               case 's': snake_pos_y++; break;         // runter
               case 'd': snake_pos_x++; break;         // rechts
               case 27 :

              int cur;
              int c_pos_x = 35, c_pos_y = 12;
              int kKey;
              bool vote = true;

              while(vote)
              {

                        textcolor(BLACK);
                        gotoxy(23,9);
                        textbackground(WHITE);
                        cprintf(&quot;***************************************&quot;);
                        gotoxy(23,10);
                        cprintf(&quot;*   &quot;);textcolor(RED);cprintf(&quot;&gt;&gt;&gt; Spiel wirklich beenden? &lt;&lt;&lt;&quot;);textcolor(BLACK);cprintf(&quot;   *&quot;);
                        gotoxy(23,11);
                        cprintf(&quot;*                                     *&quot;);
                        gotoxy(23,12);
                        cprintf(&quot;*       &quot;);textcolor(RED);cprintf(&quot;Ja!           NEIN!           &quot;);textcolor(BLACK);cprintf(&quot;*&quot;);
                        gotoxy(23,13);
                        cprintf(&quot;*                                     *&quot;);
                        gotoxy(23,14);
                        cprintf(&quot;***************************************&quot;);

                        gotoxy(c_pos_x,c_pos_y);
                        textcolor(BLACK);
                        cprintf(&quot;&lt;-&quot;);
                        Sleep(50);

                     if(kbhit())
                     {
                        kKey = getch();

                        switch(kKey)
                        {
                            case 'a' : c_pos_x--; break;
                            case 'd' : c_pos_x++; break;
                            case 13  : vote = false; break;

                        }
                        if(c_pos_x == 34)
                        {
                            c_pos_x = 51;
                        }
                        if(c_pos_x == 36)
                        {
                            c_pos_x = 51;
                        }

                        if(c_pos_x == 50)
                        {
                            c_pos_x = 35;
                        }
                        if(c_pos_x == 52)
                        {
                            c_pos_x = 35;
                        }
                     }
              }
              switch(c_pos_x)
              {
                    case 35: play = false; break;
                    case 51: play = true; break;
              }
         }
</code></pre>
<p>fuwer schnelle hilfe THANX.</p>
<p>mfg knuter</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/152774/nach-bestätigen-kehrt-das-prog-net-zur-schleife-zurück</link><generator>RSS for Node</generator><lastBuildDate>Mon, 07 Sep 2026 04:31:46 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/152774.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 09 Jul 2006 20:23:03 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to nach bestätigen kehrt das prog net zur schleife zurück on Sun, 09 Jul 2006 20:23:03 GMT]]></title><description><![CDATA[<p>hi... ich hab hier mal nen shcnippsel von meinem programm.... es ist so vorgesehen das wenn die anwendung bei betaetigen der esc-taste pausiert und ein fenster sich oefnet welches fragt beenden j/n... geh ich auf nein und bestaetige gehts aber will ich weiter machen verlaesst er die schleife irgendwie nbet und fragt noch mal das selbe und so weiter...drueck ich jedoch 2mal hinter einander schnell enter klappt es und die ursprüngliche anwendung wird wieder aufgenommen. hmm was kann ich tun? gibts ne möglich keit bei pressen von enter die taste 2mal auszuwerten so das dieses doppelbetätigen hinfaellig wird???</p>
<pre><code class="language-cpp">bool play = true;
 while (play)
  {

   clrscr();
   gotoxy(snake_pos_x,snake_pos_y);                    // Spawnpoint: Schlange
   textcolor(LIGHTRED);
   cprintf(&quot;s&quot;);

     gotoxy(creep_pos_x,creep_pos_y);                  // Spwanpoint: Beute, später auf Zufall
     textcolor(GREEN);
     cprintf(&quot;o&quot;);
     gotoxy(1,20);

        textbackground(LIGHTBLUE);
        textcolor(WHITE);
        cprintf(&quot;________________________________________________________________________________&quot;);
        cout &lt;&lt; &quot;\n&quot;;
        textcolor(YELLOW);
        cprintf(&quot;Level: %d&quot;,Level);
        cout &lt;&lt; &quot;\n\n&quot;;
        cprintf(&quot;Score: %d&quot;,Score);

       Sleep(Speed);                                     // gibt die Geschwindigkeit der Schlange an

       if (kbhit())                                    // wenn Taste gedrückt wird
       {
          Key = getch();                               // Taste sofort auswerten, ohne auf Eingabe
       }                                               // zu warten

          switch (Key)                                 // Tastenfunktion zuweisen
         {
               case 'w': snake_pos_y--; break;         // hoch
               case 'a': snake_pos_x--; break;         // links
               case 's': snake_pos_y++; break;         // runter
               case 'd': snake_pos_x++; break;         // rechts
               case 27 :

              int cur;
              int c_pos_x = 35, c_pos_y = 12;
              int kKey;
              bool vote = true;

              while(vote)
              {

                        textcolor(BLACK);
                        gotoxy(23,9);
                        textbackground(WHITE);
                        cprintf(&quot;***************************************&quot;);
                        gotoxy(23,10);
                        cprintf(&quot;*   &quot;);textcolor(RED);cprintf(&quot;&gt;&gt;&gt; Spiel wirklich beenden? &lt;&lt;&lt;&quot;);textcolor(BLACK);cprintf(&quot;   *&quot;);
                        gotoxy(23,11);
                        cprintf(&quot;*                                     *&quot;);
                        gotoxy(23,12);
                        cprintf(&quot;*       &quot;);textcolor(RED);cprintf(&quot;Ja!           NEIN!           &quot;);textcolor(BLACK);cprintf(&quot;*&quot;);
                        gotoxy(23,13);
                        cprintf(&quot;*                                     *&quot;);
                        gotoxy(23,14);
                        cprintf(&quot;***************************************&quot;);

                        gotoxy(c_pos_x,c_pos_y);
                        textcolor(BLACK);
                        cprintf(&quot;&lt;-&quot;);
                        Sleep(50);

                     if(kbhit())
                     {
                        kKey = getch();

                        switch(kKey)
                        {
                            case 'a' : c_pos_x--; break;
                            case 'd' : c_pos_x++; break;
                            case 13  : vote = false; break;

                        }
                        if(c_pos_x == 34)
                        {
                            c_pos_x = 51;
                        }
                        if(c_pos_x == 36)
                        {
                            c_pos_x = 51;
                        }

                        if(c_pos_x == 50)
                        {
                            c_pos_x = 35;
                        }
                        if(c_pos_x == 52)
                        {
                            c_pos_x = 35;
                        }
                     }
              }
              switch(c_pos_x)
              {
                    case 35: play = false; break;
                    case 51: play = true; break;
              }
         }
</code></pre>
<p>fuwer schnelle hilfe THANX.</p>
<p>mfg knuter</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1094657</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1094657</guid><dc:creator><![CDATA[knuer]]></dc:creator><pubDate>Sun, 09 Jul 2006 20:23:03 GMT</pubDate></item><item><title><![CDATA[Reply to nach bestätigen kehrt das prog net zur schleife zurück on Mon, 10 Jul 2006 08:36:13 GMT]]></title><description><![CDATA[<p>wieso antwortet den niemaND <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f61e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--disappointed_face"
      title=":("
      alt="😞"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1094854</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1094854</guid><dc:creator><![CDATA[knuter]]></dc:creator><pubDate>Mon, 10 Jul 2006 08:36:13 GMT</pubDate></item><item><title><![CDATA[Reply to nach bestätigen kehrt das prog net zur schleife zurück on Mon, 10 Jul 2006 08:42:56 GMT]]></title><description><![CDATA[<p>knuter schrieb:</p>
<blockquote>
<p>wieso antwortet den niemaND <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f61e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--disappointed_face"
      title=":("
      alt="😞"
    /></p>
</blockquote>
<p>Vermutlich, weil du wie ein Schwachkopf schreibst.</p>
<p>Das Problem liegt darin, wie du dir die zuletzt gedrückte Taste merkst. Solange da 27 drin steht, machst du dein Fenster immer wieder auf.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1094858</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1094858</guid><dc:creator><![CDATA[MFK]]></dc:creator><pubDate>Mon, 10 Jul 2006 08:42:56 GMT</pubDate></item><item><title><![CDATA[Reply to nach bestätigen kehrt das prog net zur schleife zurück on Mon, 10 Jul 2006 08:44:57 GMT]]></title><description><![CDATA[<p>MFK schrieb:</p>
<blockquote>
<p>knuter schrieb:</p>
<blockquote>
<p>wieso antwortet den niemaND <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f61e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--disappointed_face"
      title=":("
      alt="😞"
    /></p>
</blockquote>
<p>Vermutlich, weil du wie ein Schwachkopf schreibst.</p>
<p>Das Problem liegt darin, wie du dir die zuletzt gedrückte Taste merkst. Solange da 27 drin steht, machst du dein Fenster immer wieder auf.</p>
</blockquote>
<p>danke fuer das kompliment</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1094862</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1094862</guid><dc:creator><![CDATA[knuter]]></dc:creator><pubDate>Mon, 10 Jul 2006 08:44:57 GMT</pubDate></item><item><title><![CDATA[Reply to nach bestätigen kehrt das prog net zur schleife zurück on Mon, 10 Jul 2006 08:51:02 GMT]]></title><description><![CDATA[<p>ne aber mal im ernst was kann ich den da gegen tun??? des mit dem merken von 27 hab ich ben net ganz verstanden</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1094869</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1094869</guid><dc:creator><![CDATA[knuter]]></dc:creator><pubDate>Mon, 10 Jul 2006 08:51:02 GMT</pubDate></item><item><title><![CDATA[Reply to nach bestätigen kehrt das prog net zur schleife zurück on Mon, 10 Jul 2006 09:22:19 GMT]]></title><description><![CDATA[<p>Wenn du 's' drückst, läuft deine Schlange immer wieder nach rechts, bis du einen andere Taste drückst.<br />
Wenn du 'Esc' drückst, geht immer wieder dein &quot;Fenster&quot; auf, bis du eine andere Taste drückst.</p>
<p>-&gt; Du darfst 's' und 'Esc' nicht gleich behandeln.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1094909</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1094909</guid><dc:creator><![CDATA[MFK]]></dc:creator><pubDate>Mon, 10 Jul 2006 09:22:19 GMT</pubDate></item><item><title><![CDATA[Reply to nach bestätigen kehrt das prog net zur schleife zurück on Mon, 10 Jul 2006 10:00:14 GMT]]></title><description><![CDATA[<p>d.h. also das ich fuer &quot;Esc&quot; eine extra switch&amp;case abfrage machen soll???</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1094948</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1094948</guid><dc:creator><![CDATA[T0bi]]></dc:creator><pubDate>Mon, 10 Jul 2006 10:00:14 GMT</pubDate></item><item><title><![CDATA[Reply to nach bestätigen kehrt das prog net zur schleife zurück on Mon, 10 Jul 2006 13:17:47 GMT]]></title><description><![CDATA[<p>Du könntest auch ans Ende des &quot;case 27:&quot; Blocks (der für ESC) die Anweisung &quot;key=0;&quot; ergänzen, dann landest du im nachfolgenden Schleifendurchlauf im (nicht vorhandenen) default-Block.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1095111</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1095111</guid><dc:creator><![CDATA[CStoll]]></dc:creator><pubDate>Mon, 10 Jul 2006 13:17:47 GMT</pubDate></item><item><title><![CDATA[Reply to nach bestätigen kehrt das prog net zur schleife zurück on Mon, 10 Jul 2006 15:11:15 GMT]]></title><description><![CDATA[<p>danke CStoll des wars was ich gebraucht hatte jetzt geht, THANX</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1095217</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1095217</guid><dc:creator><![CDATA[T0bi]]></dc:creator><pubDate>Mon, 10 Jul 2006 15:11:15 GMT</pubDate></item></channel></rss>