<?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[TicTacToe]]></title><description><![CDATA[<p>Habe angefangen einen simplen Tic Tac Toe Programm zu schreiben...<br />
doch schon warn die ersten Fehler im Programm</p>
<pre><code>#include&lt;iostream&gt;

using namespace std;
int main()
{

    int Feld1;
    int Feld2;
    int Feld3;
    int Feld4;
    int Feld5;
    int Feld6;
    int Feld7;
    int Feld8;
    int Feld9;

    cout&lt;&lt;&quot;Tic-Tac-Toe Programm\n&quot;;
    cin.get();

      cout&lt;&lt;&quot;     |   |  \n&quot;
            &quot;   1 | 2 | 3 \n&quot;
            &quot;     |   |  \n&quot;
            &quot;-----+---+----- \n&quot;
            &quot;     |   |       \n&quot;
            &quot;   4 | 5 | 6 \n&quot;
            &quot;     |   |     \n&quot;                                                    
            &quot;-----+---+-----  \n&quot;                                                      
            &quot;     |   |         \n&quot;                           
            &quot;   7 | 8 | 9         \n&quot;                                                 
            &quot;     |   | \n&quot;;
   cin.get();

   cout&lt;&lt;&quot;Spieler 1 Bitte Wählen sie einen Feld von 1-9 aus(X)\n&quot;;
   cin&gt;&gt;Feld1;

if(Feld1==1)
{

      cout&lt;&lt;&quot;     |   |  \n&quot;
            &quot;   X | 2 | 3 \n&quot;
            &quot;     |   |  \n&quot;
            &quot;-----+---+----- \n&quot;
            &quot;     |   |       \n&quot;
            &quot;   4 | 5 | 6 \n&quot;
            &quot;     |   |     \n&quot;                                                    
            &quot;-----+---+-----  \n&quot;                                                      
            &quot;     |   |         \n&quot;                           
            &quot;   7 | 8 | 9         \n&quot;                                                 
            &quot;     |   | \n&quot;;
   cin.get();

}

else
{
if (Feld1==2)
{

      cout&lt;&lt;&quot;     |   |  \n&quot;
            &quot;   1 | X | 3 \n&quot;
            &quot;     |   |  \n&quot;
            &quot;-----+---+----- \n&quot;
            &quot;     |   |       \n&quot;
            &quot;   4 | 5 | 6 \n&quot;
            &quot;     |   |     \n&quot;                                                    
            &quot;-----+---+-----  \n&quot;                                                      
            &quot;     |   |         \n&quot;                           
            &quot;   7 | 8 | 9         \n&quot;                                                 
            &quot;     |   | \n&quot;;
   cin.get();
}

else
{
if (Feld1==3)
{

      cout&lt;&lt;&quot;     |   |  \n&quot;
            &quot;   1 | 2 | X \n&quot;
            &quot;     |   |  \n&quot;
            &quot;-----+---+----- \n&quot;
            &quot;     |   |       \n&quot;
            &quot;   4 | 5 | 6 \n&quot;
            &quot;     |   |     \n&quot;                                                    
            &quot;-----+---+-----  \n&quot;                                                      
            &quot;     |   |         \n&quot;                           
            &quot;   7 | 8 | 9         \n&quot;                                                 
            &quot;     |   | \n&quot;;
   cin.get();}
else
{
if (Feld1==4)
{

      cout&lt;&lt;&quot;     |   |  \n&quot;
            &quot;   1 | 2 | 3 \n&quot;
            &quot;     |   |  \n&quot;
            &quot;-----+---+----- \n&quot;
            &quot;     |   |       \n&quot;
            &quot;   X | 5 | 6 \n&quot;
            &quot;     |   |     \n&quot;                                                    
            &quot;-----+---+-----  \n&quot;                                                      
            &quot;     |   |         \n&quot;                           
            &quot;   7 | 8 | 9         \n&quot;                                                 
            &quot;     |   | \n&quot;;
   cin.get();}
   else
{
if (Feld1==5)
{

      cout&lt;&lt;&quot;     |   |  \n&quot;
            &quot;   1 | 2 | 3 \n&quot;
            &quot;     |   |  \n&quot;
            &quot;-----+---+----- \n&quot;
            &quot;     |   |       \n&quot;
            &quot;   4 | X | 6 \n&quot;
            &quot;     |   |     \n&quot;                                                    
            &quot;-----+---+-----  \n&quot;                                                      
            &quot;     |   |         \n&quot;                           
            &quot;   7 | 8 | 9         \n&quot;                                                 
            &quot;     |   | \n&quot;;
   cin.get();}
   else
{
if (Feld1==6)
{

      cout&lt;&lt;&quot;     |   |  \n&quot;
            &quot;   1 | 2 | 3 \n&quot;
            &quot;     |   |  \n&quot;
            &quot;-----+---+----- \n&quot;
            &quot;     |   |       \n&quot;
            &quot;   4 | 5 | X \n&quot;
            &quot;     |   |     \n&quot;                                                    
            &quot;-----+---+-----  \n&quot;                                                      
            &quot;     |   |         \n&quot;                           
            &quot;   7 | 8 | 9         \n&quot;                                                 
            &quot;     |   | \n&quot;;
   cin.get();}else
{
if (Feld1==7)
{

      cout&lt;&lt;&quot;     |   |  \n&quot;
            &quot;   1 | 2 | 3 \n&quot;
            &quot;     |   |  \n&quot;
            &quot;-----+---+----- \n&quot;
            &quot;     |   |       \n&quot;
            &quot;   4 | 5 | 6 \n&quot;
            &quot;     |   |     \n&quot;                                                    
            &quot;-----+---+-----  \n&quot;                                                      
            &quot;     |   |         \n&quot;                           
            &quot;   X | 8 | 9         \n&quot;                                                 
            &quot;     |   | \n&quot;;
   cin.get();}

else
{
if (Feld1==8)
{

      cout&lt;&lt;&quot;     |   |  \n&quot;
            &quot;   1 | 2 | 3 \n&quot;
            &quot;     |   |  \n&quot;
            &quot;-----+---+----- \n&quot;
            &quot;     |   |       \n&quot;
            &quot;   4 | 5 | 6 \n&quot;
            &quot;     |   |     \n&quot;                                                    
            &quot;-----+---+-----  \n&quot;                                                      
            &quot;     |   |         \n&quot;                           
            &quot;   7 | X | 9         \n&quot;                                                 
            &quot;     |   | \n&quot;;
   cin.get();}
   else
{
if (Feld1==9)
{

      cout&lt;&lt;&quot;     |   |  \n&quot;
            &quot;   1 | 2 | 3 \n&quot;
            &quot;     |   |  \n&quot;
            &quot;-----+---+----- \n&quot;
            &quot;     |   |       \n&quot;
            &quot;   4 | 5 | 6 \n&quot;
            &quot;     |   |     \n&quot;                                                    
            &quot;-----+---+-----  \n&quot;                                                      
            &quot;     |   |         \n&quot;                           
            &quot;   7 | 8 | X         \n&quot;                                                 
            &quot;     |   | \n&quot;;
   cin.get();
}
</code></pre>
<p>unzwar weis ich nicht wie ich weiter schreiben soll da ich nicht wissen kann wo spieler 1 x gesetzt hat</p>
<p>Vielen Dank im Vorraus</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/254442/tictactoe</link><generator>RSS for Node</generator><lastBuildDate>Sun, 13 Sep 2026 01:02:23 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/254442.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 16 Nov 2009 17:29:41 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to TicTacToe on Mon, 16 Nov 2009 17:29:41 GMT]]></title><description><![CDATA[<p>Habe angefangen einen simplen Tic Tac Toe Programm zu schreiben...<br />
doch schon warn die ersten Fehler im Programm</p>
<pre><code>#include&lt;iostream&gt;

using namespace std;
int main()
{

    int Feld1;
    int Feld2;
    int Feld3;
    int Feld4;
    int Feld5;
    int Feld6;
    int Feld7;
    int Feld8;
    int Feld9;

    cout&lt;&lt;&quot;Tic-Tac-Toe Programm\n&quot;;
    cin.get();

      cout&lt;&lt;&quot;     |   |  \n&quot;
            &quot;   1 | 2 | 3 \n&quot;
            &quot;     |   |  \n&quot;
            &quot;-----+---+----- \n&quot;
            &quot;     |   |       \n&quot;
            &quot;   4 | 5 | 6 \n&quot;
            &quot;     |   |     \n&quot;                                                    
            &quot;-----+---+-----  \n&quot;                                                      
            &quot;     |   |         \n&quot;                           
            &quot;   7 | 8 | 9         \n&quot;                                                 
            &quot;     |   | \n&quot;;
   cin.get();

   cout&lt;&lt;&quot;Spieler 1 Bitte Wählen sie einen Feld von 1-9 aus(X)\n&quot;;
   cin&gt;&gt;Feld1;

if(Feld1==1)
{

      cout&lt;&lt;&quot;     |   |  \n&quot;
            &quot;   X | 2 | 3 \n&quot;
            &quot;     |   |  \n&quot;
            &quot;-----+---+----- \n&quot;
            &quot;     |   |       \n&quot;
            &quot;   4 | 5 | 6 \n&quot;
            &quot;     |   |     \n&quot;                                                    
            &quot;-----+---+-----  \n&quot;                                                      
            &quot;     |   |         \n&quot;                           
            &quot;   7 | 8 | 9         \n&quot;                                                 
            &quot;     |   | \n&quot;;
   cin.get();

}

else
{
if (Feld1==2)
{

      cout&lt;&lt;&quot;     |   |  \n&quot;
            &quot;   1 | X | 3 \n&quot;
            &quot;     |   |  \n&quot;
            &quot;-----+---+----- \n&quot;
            &quot;     |   |       \n&quot;
            &quot;   4 | 5 | 6 \n&quot;
            &quot;     |   |     \n&quot;                                                    
            &quot;-----+---+-----  \n&quot;                                                      
            &quot;     |   |         \n&quot;                           
            &quot;   7 | 8 | 9         \n&quot;                                                 
            &quot;     |   | \n&quot;;
   cin.get();
}

else
{
if (Feld1==3)
{

      cout&lt;&lt;&quot;     |   |  \n&quot;
            &quot;   1 | 2 | X \n&quot;
            &quot;     |   |  \n&quot;
            &quot;-----+---+----- \n&quot;
            &quot;     |   |       \n&quot;
            &quot;   4 | 5 | 6 \n&quot;
            &quot;     |   |     \n&quot;                                                    
            &quot;-----+---+-----  \n&quot;                                                      
            &quot;     |   |         \n&quot;                           
            &quot;   7 | 8 | 9         \n&quot;                                                 
            &quot;     |   | \n&quot;;
   cin.get();}
else
{
if (Feld1==4)
{

      cout&lt;&lt;&quot;     |   |  \n&quot;
            &quot;   1 | 2 | 3 \n&quot;
            &quot;     |   |  \n&quot;
            &quot;-----+---+----- \n&quot;
            &quot;     |   |       \n&quot;
            &quot;   X | 5 | 6 \n&quot;
            &quot;     |   |     \n&quot;                                                    
            &quot;-----+---+-----  \n&quot;                                                      
            &quot;     |   |         \n&quot;                           
            &quot;   7 | 8 | 9         \n&quot;                                                 
            &quot;     |   | \n&quot;;
   cin.get();}
   else
{
if (Feld1==5)
{

      cout&lt;&lt;&quot;     |   |  \n&quot;
            &quot;   1 | 2 | 3 \n&quot;
            &quot;     |   |  \n&quot;
            &quot;-----+---+----- \n&quot;
            &quot;     |   |       \n&quot;
            &quot;   4 | X | 6 \n&quot;
            &quot;     |   |     \n&quot;                                                    
            &quot;-----+---+-----  \n&quot;                                                      
            &quot;     |   |         \n&quot;                           
            &quot;   7 | 8 | 9         \n&quot;                                                 
            &quot;     |   | \n&quot;;
   cin.get();}
   else
{
if (Feld1==6)
{

      cout&lt;&lt;&quot;     |   |  \n&quot;
            &quot;   1 | 2 | 3 \n&quot;
            &quot;     |   |  \n&quot;
            &quot;-----+---+----- \n&quot;
            &quot;     |   |       \n&quot;
            &quot;   4 | 5 | X \n&quot;
            &quot;     |   |     \n&quot;                                                    
            &quot;-----+---+-----  \n&quot;                                                      
            &quot;     |   |         \n&quot;                           
            &quot;   7 | 8 | 9         \n&quot;                                                 
            &quot;     |   | \n&quot;;
   cin.get();}else
{
if (Feld1==7)
{

      cout&lt;&lt;&quot;     |   |  \n&quot;
            &quot;   1 | 2 | 3 \n&quot;
            &quot;     |   |  \n&quot;
            &quot;-----+---+----- \n&quot;
            &quot;     |   |       \n&quot;
            &quot;   4 | 5 | 6 \n&quot;
            &quot;     |   |     \n&quot;                                                    
            &quot;-----+---+-----  \n&quot;                                                      
            &quot;     |   |         \n&quot;                           
            &quot;   X | 8 | 9         \n&quot;                                                 
            &quot;     |   | \n&quot;;
   cin.get();}

else
{
if (Feld1==8)
{

      cout&lt;&lt;&quot;     |   |  \n&quot;
            &quot;   1 | 2 | 3 \n&quot;
            &quot;     |   |  \n&quot;
            &quot;-----+---+----- \n&quot;
            &quot;     |   |       \n&quot;
            &quot;   4 | 5 | 6 \n&quot;
            &quot;     |   |     \n&quot;                                                    
            &quot;-----+---+-----  \n&quot;                                                      
            &quot;     |   |         \n&quot;                           
            &quot;   7 | X | 9         \n&quot;                                                 
            &quot;     |   | \n&quot;;
   cin.get();}
   else
{
if (Feld1==9)
{

      cout&lt;&lt;&quot;     |   |  \n&quot;
            &quot;   1 | 2 | 3 \n&quot;
            &quot;     |   |  \n&quot;
            &quot;-----+---+----- \n&quot;
            &quot;     |   |       \n&quot;
            &quot;   4 | 5 | 6 \n&quot;
            &quot;     |   |     \n&quot;                                                    
            &quot;-----+---+-----  \n&quot;                                                      
            &quot;     |   |         \n&quot;                           
            &quot;   7 | 8 | X         \n&quot;                                                 
            &quot;     |   | \n&quot;;
   cin.get();
}
</code></pre>
<p>unzwar weis ich nicht wie ich weiter schreiben soll da ich nicht wissen kann wo spieler 1 x gesetzt hat</p>
<p>Vielen Dank im Vorraus</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1808936</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1808936</guid><dc:creator><![CDATA[Big]]></dc:creator><pubDate>Mon, 16 Nov 2009 17:29:41 GMT</pubDate></item><item><title><![CDATA[Reply to TicTacToe on Mon, 16 Nov 2009 17:36:10 GMT]]></title><description><![CDATA[<p>Ausgabe mit cout kriegst du ja schonmal hin. Kann man noch verbessern aber eins nach dem anderen. Das nächste wäre dann die Eingabe. sprich du musst den Spieler1 fragen wo er sein Kreuz macht (mit cout) und dann einlesen was er antwortet (mit cin). Wie das geht dürfte im Buch/Tutorial deiner Wahl recht bald kommen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1808939</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1808939</guid><dc:creator><![CDATA[pumuckl]]></dc:creator><pubDate>Mon, 16 Nov 2009 17:36:10 GMT</pubDate></item><item><title><![CDATA[Reply to TicTacToe on Mon, 16 Nov 2009 17:47:05 GMT]]></title><description><![CDATA[<p>Guten Tach<br />
Ich finde du machst das ein bisschen umständlich machst, naja. Hab auch mal ein TicTacToe geschrieben (wenn du willst kann ich dir des mal schicken). Ich hab keinen Plan wozu die ganzen Variablen brauchst (,da du offensichtlich Feld1 zur Eingabe benutzt) <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=":confused:"
      alt="😕"
    /> . Ich hab das ganze mit einem Int-Array gelöst. 0 steht für ein leeres Feld, 1 für X und 2 für O. Den Rest kann man sich ,glaube ich, denken (wenn nicht, dann Bescheid sagen).</p>
<p>mfg MaSter_MiND_</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1808943</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1808943</guid><dc:creator><![CDATA[MaSter_MiND_]]></dc:creator><pubDate>Mon, 16 Nov 2009 17:47:05 GMT</pubDate></item><item><title><![CDATA[Reply to TicTacToe on Mon, 16 Nov 2009 17:47:57 GMT]]></title><description><![CDATA[<p>Big schrieb:</p>
<blockquote>
<p>unzwar weis ich nicht wie ich weiter schreiben soll da ich nicht wissen kann wo spieler 1 x gesetzt hat</p>
</blockquote>
<p>Das Programm muss sich irgendwie merken, welcher Spieler welchen Zug gemacht hat. Du könntest eine int Variable für jedes Feld anlegen und dann machst du 0 für unbesetzt, 1 für X und 2 für O. Falls du weißt, was ein Array oder ein std:vector ist, kann man damit wunderbar das ganze Spielfeld beschreiben. Falls du das noch nicht kennst, kannst du dir das entweder anlesen oder du machst es von Hand mit 9 einzelnen int Variablen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1808944</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1808944</guid><dc:creator><![CDATA[SeppJ]]></dc:creator><pubDate>Mon, 16 Nov 2009 17:47:57 GMT</pubDate></item><item><title><![CDATA[Reply to TicTacToe on Mon, 16 Nov 2009 17:59:35 GMT]]></title><description><![CDATA[<p>MaSter_MiND_ es wär sehr hilfreich für mich wenn du es mir zusenden würdest<br />
so könnte ich sehen wie ich es schreiben soll den ich habe immer noch keine ahnung wie es weiter gehen soll..</p>
<p>e-mail: <a href="mailto:der.gangsta@hotmail.de" rel="nofollow">der.gangsta@hotmail.de</a></p>
<p>VIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIELEN DANNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNK<br />
IM VOOORAUS <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/1808949</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1808949</guid><dc:creator><![CDATA[Big]]></dc:creator><pubDate>Mon, 16 Nov 2009 17:59:35 GMT</pubDate></item></channel></rss>