<?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[Ausgabe nur kurz anzeigen]]></title><description><![CDATA[<p>Mein Code:</p>
<pre><code>#include &lt;iostream&gt;
#include &lt;conio.h&gt;

using namespace std;

namespace taste{
    const int p_oben = 72;
    const int p_unten = 80;
    const int p_rechts = 77;
    const int p_links = 75;
    const int leertaste = 32;
    const int esc = 27;
}

void spielfeld(int &amp;x, bool &amp;schuss){

    char feld[10][10]= {{'_','_','_','_','_','_','_','_','_','_'},//0
                        {'_','_','_','_','_','_','_','_','_','_'},//1
                        {'_','_','_','_','_','_','_','_','_','_'},//2
                        {'_','_','_','_','_','_','_','_','_','_'},//3
                        {'_','_','_','_','_','_','_','_','_','_'},//4
                        {'_','_','_','_','_','_','_','_','_','_'},//5
                        {'_','_','_','_','_','_','_','_','_','_'},//6
                        {'_','_','_','_','_','_','_','_','_','_'},//7
                        {'_','_','_','_','_','_','_','_','_','_'},//8
                        {'_','_','_','_','_','_','_','_','_','_'}};//9
                      //  0    1   2   3   4   5   6   7   8   9

    if(x&lt;0){
        x=0;
    }
    else if(x&gt;9){
        x=9;
    }
    else{
    }

            if(schuss==true){
                for(unsigned int i=0;i&lt;9;i++){
                    feld[i][x]='|';
                }
                //y ist die Spalte
                //x ist die Zeile

                //X Bewegt sich auf x (Zeile)
            }

    feld[9][x]='X';

    system(&quot;CLS&quot;);

    for(unsigned int y=0;y&lt;10;y++){ //Gibt das Spielfeld aus 0-9
        if(y==0){
        }
        else{
            cout &lt;&lt; &quot;\n&quot;;
        }
        for(unsigned int x=0;x&lt;10;x++){
            cout &lt;&lt; feld[y][x];
        }

    }
    schuss=false;
}

int main(){
    int eingabe=0, x=0;
    bool schuss=false;

    spielfeld(x, schuss);

    do{
    eingabe=getch();
        switch(eingabe){
            case taste::p_oben: schuss=true;
                                spielfeld(x, schuss);
                                break;
            case taste::p_unten:
                                break;
            case taste::p_rechts: x++;
                                spielfeld(x, schuss);
                                break;
            case taste::p_links: x--;
                                spielfeld(x, schuss);
                                break;
        }
    }while(eingabe!=taste::esc);
    return 0;
}
</code></pre>
<p>Mein Problem ist ich würde gerne das wenn ich nach oben komme die Reihe von &quot;|&quot;, nur einmal kurz gezeigt wird. Ich habe nun damit rumgespielt bekomme es aber nicht hin.</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/325634/ausgabe-nur-kurz-anzeigen</link><generator>RSS for Node</generator><lastBuildDate>Sun, 12 Jul 2026 01:44:25 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/325634.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 11 May 2014 13:15:10 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Ausgabe nur kurz anzeigen on Sun, 11 May 2014 13:15:10 GMT]]></title><description><![CDATA[<p>Mein Code:</p>
<pre><code>#include &lt;iostream&gt;
#include &lt;conio.h&gt;

using namespace std;

namespace taste{
    const int p_oben = 72;
    const int p_unten = 80;
    const int p_rechts = 77;
    const int p_links = 75;
    const int leertaste = 32;
    const int esc = 27;
}

void spielfeld(int &amp;x, bool &amp;schuss){

    char feld[10][10]= {{'_','_','_','_','_','_','_','_','_','_'},//0
                        {'_','_','_','_','_','_','_','_','_','_'},//1
                        {'_','_','_','_','_','_','_','_','_','_'},//2
                        {'_','_','_','_','_','_','_','_','_','_'},//3
                        {'_','_','_','_','_','_','_','_','_','_'},//4
                        {'_','_','_','_','_','_','_','_','_','_'},//5
                        {'_','_','_','_','_','_','_','_','_','_'},//6
                        {'_','_','_','_','_','_','_','_','_','_'},//7
                        {'_','_','_','_','_','_','_','_','_','_'},//8
                        {'_','_','_','_','_','_','_','_','_','_'}};//9
                      //  0    1   2   3   4   5   6   7   8   9

    if(x&lt;0){
        x=0;
    }
    else if(x&gt;9){
        x=9;
    }
    else{
    }

            if(schuss==true){
                for(unsigned int i=0;i&lt;9;i++){
                    feld[i][x]='|';
                }
                //y ist die Spalte
                //x ist die Zeile

                //X Bewegt sich auf x (Zeile)
            }

    feld[9][x]='X';

    system(&quot;CLS&quot;);

    for(unsigned int y=0;y&lt;10;y++){ //Gibt das Spielfeld aus 0-9
        if(y==0){
        }
        else{
            cout &lt;&lt; &quot;\n&quot;;
        }
        for(unsigned int x=0;x&lt;10;x++){
            cout &lt;&lt; feld[y][x];
        }

    }
    schuss=false;
}

int main(){
    int eingabe=0, x=0;
    bool schuss=false;

    spielfeld(x, schuss);

    do{
    eingabe=getch();
        switch(eingabe){
            case taste::p_oben: schuss=true;
                                spielfeld(x, schuss);
                                break;
            case taste::p_unten:
                                break;
            case taste::p_rechts: x++;
                                spielfeld(x, schuss);
                                break;
            case taste::p_links: x--;
                                spielfeld(x, schuss);
                                break;
        }
    }while(eingabe!=taste::esc);
    return 0;
}
</code></pre>
<p>Mein Problem ist ich würde gerne das wenn ich nach oben komme die Reihe von &quot;|&quot;, nur einmal kurz gezeigt wird. Ich habe nun damit rumgespielt bekomme es aber nicht hin.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2398625</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2398625</guid><dc:creator><![CDATA[Fragenstellerasd]]></dc:creator><pubDate>Sun, 11 May 2014 13:15:10 GMT</pubDate></item><item><title><![CDATA[Reply to Ausgabe nur kurz anzeigen on Sun, 11 May 2014 20:53:21 GMT]]></title><description><![CDATA[<p>Soll die Ausgabe nur in der Konsole ausgegeben werden? (Konsolen-spiel)</p>
<p>Falls ja, wäre meine Idee einfach nochmal eine Ausgabe (oder mehr) zu machen wo das '|' wieder weg ist. Klar kann man dann hoch scrollen, aber das ist dass einzige was mir für die Konsole einfällt.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2398695</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2398695</guid><dc:creator><![CDATA[neuling7]]></dc:creator><pubDate>Sun, 11 May 2014 20:53:21 GMT</pubDate></item><item><title><![CDATA[Reply to Ausgabe nur kurz anzeigen on Sun, 11 May 2014 20:55:23 GMT]]></title><description><![CDATA[<p>Ausgabe nur kurz anzeigen:</p>
<pre><code>#include &lt;windows.h&gt;

void ClearScreen(void)
{
    CONSOLE_SCREEN_BUFFER_INFO csbi;
    COORD target = {0, 0};
    DWORD written;

    GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &amp;csbi);
    FillConsoleOutputCharacter(GetStdHandle(STD_OUTPUT_HANDLE), ' ',
                                            csbi.dwSize.X * csbi.dwSize.Y,
                                            target, &amp;written);
    FillConsoleOutputAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 7,
                                            csbi.dwSize.X * csbi.dwSize.Y,
                                            target, &amp;written);
}

void SetWindowExt(int x, int y, int yMulti = 1)
{
    SMALL_RECT sr_window = {0, 0, x - 1, y - 1};
    COORD      extension;
    CONSOLE_SCREEN_BUFFER_INFO csbi;

    GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &amp;csbi);

    extension.X = max(x, csbi.dwMaximumWindowSize.X);
    extension.Y = max(y, csbi.dwMaximumWindowSize.Y);

    SetConsoleScreenBufferSize(GetStdHandle(STD_OUTPUT_HANDLE), extension);
    SetConsoleWindowInfo(GetStdHandle(STD_OUTPUT_HANDLE), TRUE, &amp;sr_window);

    extension.X = x;
    extension.Y = y * yMulti;
    SetConsoleScreenBufferSize(GetStdHandle(STD_OUTPUT_HANDLE), extension);
}

void DruckSimpleText(int x, int y, char const *text)
{
    COORD target = {x, y};
    DWORD written;

    WriteConsoleOutputCharacter(GetStdHandle(STD_OUTPUT_HANDLE), text,
                                            strlen(text),
                                            target, &amp;written);
}

void SetCursorVisible(BOOL v)
{
    CONSOLE_CURSOR_INFO ci;

    GetConsoleCursorInfo(GetStdHandle(STD_OUTPUT_HANDLE), &amp;ci);

    ci.bVisible = v;

    SetConsoleCursorInfo(GetStdHandle(STD_OUTPUT_HANDLE), &amp;ci);
}

int main()
{
   SetWindowExt(30, 30);
   ClearScreen();
   SetCursorVisible(false);

   for(int i = 0; i &lt; 10; ++i)
   {
      DruckSimpleText(i, i, &quot;kurz Hallo&quot;);
      Sleep(1000);
      DruckSimpleText(i, i, &quot;          &quot;);
   }

   SetCursorVisible(true);
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/2398696</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2398696</guid><dc:creator><![CDATA[Belli]]></dc:creator><pubDate>Sun, 11 May 2014 20:55:23 GMT</pubDate></item></channel></rss>