<?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[Sudoku-Rätsel lösen lassen]]></title><description><![CDATA[<p>Hi Leute!</p>
<p>Ich beschäftige mich seit einiger Zeit mit C++.<br />
Nachdem ich Tutorials mit den Basics durchgearbeitet habe, versuche ich jetzt mehr oder weniger einfache Programme zu schreiben (z.B. Tic-Tac-Toe).</p>
<p>Momentan bin ich dabei ein Sudoku-Löser zu basteln.<br />
Nachdem man die vorhanden Felder eingegeben hat, soll das Programm zuerst nach unten alle Zahlen 1 - 9 durchgehen, dann zur Seite und dann in seiner &quot;Box&quot;. Die erste Möglichkeit soll eingesetzt werden, danach geht es mit dem nächsten Kästchen weiter. Ist irgendwann keine Möglichkeit mehr vorhanden, soll ein Kästchen zurückgegangen werden und die nächste mögliche Zahl eingesetzt werden.</p>
<p>Ich bin jetzt in etwa so weit:</p>
<pre><code>#include &lt;cstdlib&gt;
#include &lt;iostream&gt;

using namespace std;

void draw(int *feld)
{
     cout &lt;&lt; &quot;----------------------------------&quot; &lt;&lt; endl
          &lt;&lt; &quot;||&quot; &lt;&lt; feld[1] &lt;&lt; &quot;|&quot; &lt;&lt; feld[2] &lt;&lt; &quot;|&quot; &lt;&lt; feld[3] //Zeile 1 - Block 1 
          &lt;&lt; &quot;| |&quot; &lt;&lt; feld[4] &lt;&lt; &quot;|&quot; &lt;&lt; feld[5] &lt;&lt; &quot;|&quot; &lt;&lt; feld[6] 
          &lt;&lt; &quot;| |&quot; &lt;&lt; feld[7] &lt;&lt; &quot;|&quot; &lt;&lt; feld[8] &lt;&lt; &quot;|&quot; &lt;&lt; feld[9] &lt;&lt; &quot;||&quot; &lt;&lt; endl
          &lt;&lt; &quot;||&quot; &lt;&lt; feld[10] &lt;&lt; &quot;|&quot; &lt;&lt; feld[11] &lt;&lt; &quot;|&quot; &lt;&lt; feld[12] //Zeile 1 - Block 2
          &lt;&lt; &quot;| |&quot; &lt;&lt; feld[13] &lt;&lt; &quot;|&quot; &lt;&lt; feld[14] &lt;&lt; &quot;|&quot; &lt;&lt; feld[15] 
          &lt;&lt; &quot;| |&quot; &lt;&lt; feld[16] &lt;&lt; &quot;|&quot; &lt;&lt; feld[17] &lt;&lt; &quot;|&quot; &lt;&lt; feld[18] &lt;&lt; &quot;||&quot; &lt;&lt; endl
          &lt;&lt; &quot;||&quot; &lt;&lt; feld[19] &lt;&lt; &quot;|&quot; &lt;&lt; feld[20] &lt;&lt; &quot;|&quot; &lt;&lt; feld[21] //Zeile 1 - Block 3
          &lt;&lt; &quot;| |&quot; &lt;&lt; feld[22] &lt;&lt; &quot;|&quot; &lt;&lt; feld[23] &lt;&lt; &quot;|&quot; &lt;&lt; feld[24] 
          &lt;&lt; &quot;| |&quot; &lt;&lt; feld[25] &lt;&lt; &quot;|&quot; &lt;&lt; feld[26] &lt;&lt; &quot;|&quot; &lt;&lt; feld[27] &lt;&lt; &quot;||&quot; &lt;&lt; endl
          &lt;&lt; &quot;----------------------------------&quot; &lt;&lt; endl
          &lt;&lt; &quot;||&quot; &lt;&lt; feld[28] &lt;&lt; &quot;|&quot; &lt;&lt; feld[29] &lt;&lt; &quot;|&quot; &lt;&lt; feld[30] //Zeile 2 - Block 1
          &lt;&lt; &quot;| |&quot; &lt;&lt; feld[31] &lt;&lt; &quot;|&quot; &lt;&lt; feld[32] &lt;&lt; &quot;|&quot; &lt;&lt; feld[33] 
          &lt;&lt; &quot;| |&quot; &lt;&lt; feld[34] &lt;&lt; &quot;|&quot; &lt;&lt; feld[35] &lt;&lt; &quot;|&quot; &lt;&lt; feld[36] &lt;&lt; &quot;||&quot; &lt;&lt; endl
          &lt;&lt; &quot;||&quot; &lt;&lt; feld[37] &lt;&lt; &quot;|&quot; &lt;&lt; feld[38] &lt;&lt; &quot;|&quot; &lt;&lt; feld[39] //Zeile 2 - Block 2
          &lt;&lt; &quot;| |&quot; &lt;&lt; feld[40] &lt;&lt; &quot;|&quot; &lt;&lt; feld[41] &lt;&lt; &quot;|&quot; &lt;&lt; feld[42] 
          &lt;&lt; &quot;| |&quot; &lt;&lt; feld[43] &lt;&lt; &quot;|&quot; &lt;&lt; feld[44] &lt;&lt; &quot;|&quot; &lt;&lt; feld[45] &lt;&lt; &quot;||&quot; &lt;&lt; endl
          &lt;&lt; &quot;||&quot; &lt;&lt; feld[46] &lt;&lt; &quot;|&quot; &lt;&lt; feld[47] &lt;&lt; &quot;|&quot; &lt;&lt; feld[48] //Zeile 2 - Block 3
          &lt;&lt; &quot;| |&quot; &lt;&lt; feld[49] &lt;&lt; &quot;|&quot; &lt;&lt; feld[50] &lt;&lt; &quot;|&quot; &lt;&lt; feld[51] 
          &lt;&lt; &quot;| |&quot; &lt;&lt; feld[52] &lt;&lt; &quot;|&quot; &lt;&lt; feld[53] &lt;&lt; &quot;|&quot; &lt;&lt; feld[54] &lt;&lt; &quot;||&quot; &lt;&lt; endl
          &lt;&lt; &quot;----------------------------------&quot; &lt;&lt; endl
          &lt;&lt; &quot;||&quot; &lt;&lt; feld[55] &lt;&lt; &quot;|&quot; &lt;&lt; feld[56] &lt;&lt; &quot;|&quot; &lt;&lt; feld[57] //Zeile 3 - Block 1
          &lt;&lt; &quot;| |&quot; &lt;&lt; feld[58] &lt;&lt; &quot;|&quot; &lt;&lt; feld[59] &lt;&lt; &quot;|&quot; &lt;&lt; feld[60] 
          &lt;&lt; &quot;| |&quot; &lt;&lt; feld[61] &lt;&lt; &quot;|&quot; &lt;&lt; feld[62] &lt;&lt; &quot;|&quot; &lt;&lt; feld[63] &lt;&lt; &quot;||&quot; &lt;&lt; endl
          &lt;&lt; &quot;||&quot; &lt;&lt; feld[64] &lt;&lt; &quot;|&quot; &lt;&lt; feld[65] &lt;&lt; &quot;|&quot; &lt;&lt; feld[66] //Zeile 3 - Block 2
          &lt;&lt; &quot;| |&quot; &lt;&lt; feld[67] &lt;&lt; &quot;|&quot; &lt;&lt; feld[68] &lt;&lt; &quot;|&quot; &lt;&lt; feld[69] 
          &lt;&lt; &quot;| |&quot; &lt;&lt; feld[70] &lt;&lt; &quot;|&quot; &lt;&lt; feld[71] &lt;&lt; &quot;|&quot; &lt;&lt; feld[72] &lt;&lt; &quot;||&quot; &lt;&lt; endl
          &lt;&lt; &quot;||&quot; &lt;&lt; feld[73] &lt;&lt; &quot;|&quot; &lt;&lt; feld[74] &lt;&lt; &quot;|&quot; &lt;&lt; feld[75] //Zeile 3 - Block 3
          &lt;&lt; &quot;| |&quot; &lt;&lt; feld[76] &lt;&lt; &quot;|&quot; &lt;&lt; feld[77] &lt;&lt; &quot;|&quot; &lt;&lt; feld[78] 
          &lt;&lt; &quot;| |&quot; &lt;&lt; feld[79] &lt;&lt; &quot;|&quot; &lt;&lt; feld[80] &lt;&lt; &quot;|&quot; &lt;&lt; feld[81] &lt;&lt; &quot;||&quot; &lt;&lt; endl
          &lt;&lt; &quot;----------------------------------&quot; &lt;&lt; endl;
}

void eingabe(int *feld)
{
     int wert;
     int nummer;

     while(nummer != 99)
     {
           cout &lt;&lt; &quot;Nummer des Feldes (99 = fertig): &quot; &lt;&lt; endl;
           cin &gt;&gt; nummer;

           if ((nummer != 99) &amp;&amp; (nummer &lt; 82))
           {
              cout &lt;&lt; endl &lt;&lt; &quot;Wert: &quot;;
              cin &gt;&gt; wert;

              if (wert &lt; 10)
              {
                 feld[nummer] = wert;
                 cout &lt;&lt; &quot;Erfolg!&quot; &lt;&lt; endl &lt;&lt; endl;
              }

              else
              {
                  cout &lt;&lt; &quot;Wert größer als 9! Neue Eingabe!&quot; &lt;&lt; endl;
              }

           }

           else if ((nummer != 99) &amp;&amp; (nummer &gt; 82))
           {
                cout &lt;&lt; &quot;Nummer nicht vorhanden! Neue Eingabe!&quot; &lt;&lt; endl &lt;&lt; endl;
           }

           else
           {
               break; 
           }

     }

}

void check-vert(int *feld)
{

/*void analyse(int *feld)
{
     for(int a = 1; a &lt; 82; ++a) //Felder 1 bis 81 durchgehen
     {
             if(feld[a] &gt; 0) //Wenn Feld belegt ist, Ausgabe
             {
                        cout &lt;&lt; &quot;Feld &quot; &lt;&lt; a &lt;&lt; &quot; belegt. &quot; &lt;&lt; feld[a] &lt;&lt; endl;
             }

             if (feld[a] = 0) //Wenn Feld nicht belegt ist
             {
                  if (a &lt; 10) //Für Felder 1 - 9
                  {
                        cout &lt;&lt; &quot;Feld&quot; &lt;&lt; a &lt;&lt; &quot; beträgt &quot; &lt;&lt; feld[a];

                      for(int b = a; b &lt; 81; b + 9) //Alle Felder vertikal unter Feld a durchgehen
                      {
                             for (int c = 1; c &lt; 11; ++c) //einsetzbare Werte 1 bis 9
                              {
                                  if (feld[b] != c) //Wenn geprüftes Feld diesen Wert nicht hat
                                  {
                                     feld[a] = c; //Setze Wert in das Feld ein
                                     cout &lt;&lt; &quot;Feld &quot; &lt;&lt; a &lt;&lt; &quot; beträgt &quot; &lt;&lt; feld[a];
                                  }

                              }

                      }

                  }

             }
     }   
}*/      

int main(int argc, char *argv[])
{
    int feld[82] = {0};

    char i;

    cout &lt;&lt; &quot;C++ Soduku-Solver 0.1&quot; &lt;&lt; endl &lt;&lt; endl;
    cout &lt;&lt; &quot;Ihr Sodokufeld: &quot; &lt;&lt; endl &lt;&lt; endl;
    cout &lt;&lt; &quot;------------------------------------&quot; &lt;&lt; endl
         &lt;&lt; &quot;|| 1| 2| 3 ||  4| 5| 6 ||  7| 8| 9||&quot; &lt;&lt; endl
         &lt;&lt; &quot;||10|11|12 || 13|14|15 || 16|17|18||&quot; &lt;&lt; endl
         &lt;&lt; &quot;||19|20|21 || 22|23|24 || 25|26|27||&quot; &lt;&lt; endl
         &lt;&lt; &quot;------------------------------------&quot; &lt;&lt; endl
         &lt;&lt; &quot;||28|29|30 || 31|32|33 || 34|35|36||&quot; &lt;&lt; endl
         &lt;&lt; &quot;||37|38|39 || 40|41|42 || 43|44|45||&quot; &lt;&lt; endl
         &lt;&lt; &quot;||46|47|48 || 49|50|51 || 52|53|54||&quot; &lt;&lt; endl
         &lt;&lt; &quot;------------------------------------&quot; &lt;&lt; endl
         &lt;&lt; &quot;||55|56|57 || 58|59|60 || 61|62|63||&quot; &lt;&lt; endl
         &lt;&lt; &quot;||64|65|66 || 67|68|69 || 70|71|72||&quot; &lt;&lt; endl
         &lt;&lt; &quot;||73|74|75 || 76|77|78 || 79|80|81||&quot; &lt;&lt; endl &lt;&lt; endl &lt;&lt; feld[1];

    eingabe(feld);

    //analyse()

    cin &gt;&gt; i;

    //Feld zeichnen

    return 0;
}
</code></pre>
<p>Die Analyse hab ich jetzt mal in Klammern gesetzt. Da fängt mein Denkfehler glaube schon an.<br />
Es müssen ja zuerst ALLE Felder unter, neben und in der Box des leeren Feldes überprüft werden, bis ein Wert eingesetzt wird. Hier hab ich nur unter dem Feld prüfen lassen und dann einsetzen lassen, wenn das geprüfte Feld einen anderen Wert hat, als die Ziffer die ich überprüfen lasse. Dabei kann Feld b ja 3 sein, es wird mit Wert 1 verglichen und Feld a bekommt dann den Wert 1 (weil 1 != 3). Dabei kann ja in der Reihe unter Feld a doch noch ein Feld den Wert 1 haben.</p>
<p>Ich hoffe ihr konntet mit so weit folgen <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f644.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_rolling_eyes"
      title=":rolling_eyes:"
      alt="🙄"
    /></p>
<p>Also denke ich, brauche ich ja 3 einzelne Funktionen (vertikal, horizontal und Box), oder?!</p>
<p>Ich habe grade keine Ahnung, wie ich das bewerkstelligen soll, dass erst alle Ziffern auf den Wert geprüft werden und danach die übrig bleibende Nummmer übergeben wird.<br />
Soll ich vielleicht die Werte 1 - 9 in ein Array schreiben und dann alle Plätze in dem Array nach und nach mit jedem Feld vergleichen, tausche die vorhandenen Werte gegen eine 0 aus und lasse das übrigbleibende übergeben und dann mit den übergebenen Werten aus den anderen 2 Funktionen vergleichen?</p>
<p>Ich hoffe Ihr könnt mir irgendwie einen Denkanstoß geben... <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="😕"
    /></p>
<p>Liebe Grüße<br />
Maximilian <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>
]]></description><link>https://www.c-plusplus.net/forum/topic/320967/sudoku-rätsel-lösen-lassen</link><generator>RSS for Node</generator><lastBuildDate>Wed, 22 Jul 2026 13:14:02 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/320967.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 18 Oct 2013 19:18:55 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Sudoku-Rätsel lösen lassen on Fri, 18 Oct 2013 19:18:55 GMT]]></title><description><![CDATA[<p>Hi Leute!</p>
<p>Ich beschäftige mich seit einiger Zeit mit C++.<br />
Nachdem ich Tutorials mit den Basics durchgearbeitet habe, versuche ich jetzt mehr oder weniger einfache Programme zu schreiben (z.B. Tic-Tac-Toe).</p>
<p>Momentan bin ich dabei ein Sudoku-Löser zu basteln.<br />
Nachdem man die vorhanden Felder eingegeben hat, soll das Programm zuerst nach unten alle Zahlen 1 - 9 durchgehen, dann zur Seite und dann in seiner &quot;Box&quot;. Die erste Möglichkeit soll eingesetzt werden, danach geht es mit dem nächsten Kästchen weiter. Ist irgendwann keine Möglichkeit mehr vorhanden, soll ein Kästchen zurückgegangen werden und die nächste mögliche Zahl eingesetzt werden.</p>
<p>Ich bin jetzt in etwa so weit:</p>
<pre><code>#include &lt;cstdlib&gt;
#include &lt;iostream&gt;

using namespace std;

void draw(int *feld)
{
     cout &lt;&lt; &quot;----------------------------------&quot; &lt;&lt; endl
          &lt;&lt; &quot;||&quot; &lt;&lt; feld[1] &lt;&lt; &quot;|&quot; &lt;&lt; feld[2] &lt;&lt; &quot;|&quot; &lt;&lt; feld[3] //Zeile 1 - Block 1 
          &lt;&lt; &quot;| |&quot; &lt;&lt; feld[4] &lt;&lt; &quot;|&quot; &lt;&lt; feld[5] &lt;&lt; &quot;|&quot; &lt;&lt; feld[6] 
          &lt;&lt; &quot;| |&quot; &lt;&lt; feld[7] &lt;&lt; &quot;|&quot; &lt;&lt; feld[8] &lt;&lt; &quot;|&quot; &lt;&lt; feld[9] &lt;&lt; &quot;||&quot; &lt;&lt; endl
          &lt;&lt; &quot;||&quot; &lt;&lt; feld[10] &lt;&lt; &quot;|&quot; &lt;&lt; feld[11] &lt;&lt; &quot;|&quot; &lt;&lt; feld[12] //Zeile 1 - Block 2
          &lt;&lt; &quot;| |&quot; &lt;&lt; feld[13] &lt;&lt; &quot;|&quot; &lt;&lt; feld[14] &lt;&lt; &quot;|&quot; &lt;&lt; feld[15] 
          &lt;&lt; &quot;| |&quot; &lt;&lt; feld[16] &lt;&lt; &quot;|&quot; &lt;&lt; feld[17] &lt;&lt; &quot;|&quot; &lt;&lt; feld[18] &lt;&lt; &quot;||&quot; &lt;&lt; endl
          &lt;&lt; &quot;||&quot; &lt;&lt; feld[19] &lt;&lt; &quot;|&quot; &lt;&lt; feld[20] &lt;&lt; &quot;|&quot; &lt;&lt; feld[21] //Zeile 1 - Block 3
          &lt;&lt; &quot;| |&quot; &lt;&lt; feld[22] &lt;&lt; &quot;|&quot; &lt;&lt; feld[23] &lt;&lt; &quot;|&quot; &lt;&lt; feld[24] 
          &lt;&lt; &quot;| |&quot; &lt;&lt; feld[25] &lt;&lt; &quot;|&quot; &lt;&lt; feld[26] &lt;&lt; &quot;|&quot; &lt;&lt; feld[27] &lt;&lt; &quot;||&quot; &lt;&lt; endl
          &lt;&lt; &quot;----------------------------------&quot; &lt;&lt; endl
          &lt;&lt; &quot;||&quot; &lt;&lt; feld[28] &lt;&lt; &quot;|&quot; &lt;&lt; feld[29] &lt;&lt; &quot;|&quot; &lt;&lt; feld[30] //Zeile 2 - Block 1
          &lt;&lt; &quot;| |&quot; &lt;&lt; feld[31] &lt;&lt; &quot;|&quot; &lt;&lt; feld[32] &lt;&lt; &quot;|&quot; &lt;&lt; feld[33] 
          &lt;&lt; &quot;| |&quot; &lt;&lt; feld[34] &lt;&lt; &quot;|&quot; &lt;&lt; feld[35] &lt;&lt; &quot;|&quot; &lt;&lt; feld[36] &lt;&lt; &quot;||&quot; &lt;&lt; endl
          &lt;&lt; &quot;||&quot; &lt;&lt; feld[37] &lt;&lt; &quot;|&quot; &lt;&lt; feld[38] &lt;&lt; &quot;|&quot; &lt;&lt; feld[39] //Zeile 2 - Block 2
          &lt;&lt; &quot;| |&quot; &lt;&lt; feld[40] &lt;&lt; &quot;|&quot; &lt;&lt; feld[41] &lt;&lt; &quot;|&quot; &lt;&lt; feld[42] 
          &lt;&lt; &quot;| |&quot; &lt;&lt; feld[43] &lt;&lt; &quot;|&quot; &lt;&lt; feld[44] &lt;&lt; &quot;|&quot; &lt;&lt; feld[45] &lt;&lt; &quot;||&quot; &lt;&lt; endl
          &lt;&lt; &quot;||&quot; &lt;&lt; feld[46] &lt;&lt; &quot;|&quot; &lt;&lt; feld[47] &lt;&lt; &quot;|&quot; &lt;&lt; feld[48] //Zeile 2 - Block 3
          &lt;&lt; &quot;| |&quot; &lt;&lt; feld[49] &lt;&lt; &quot;|&quot; &lt;&lt; feld[50] &lt;&lt; &quot;|&quot; &lt;&lt; feld[51] 
          &lt;&lt; &quot;| |&quot; &lt;&lt; feld[52] &lt;&lt; &quot;|&quot; &lt;&lt; feld[53] &lt;&lt; &quot;|&quot; &lt;&lt; feld[54] &lt;&lt; &quot;||&quot; &lt;&lt; endl
          &lt;&lt; &quot;----------------------------------&quot; &lt;&lt; endl
          &lt;&lt; &quot;||&quot; &lt;&lt; feld[55] &lt;&lt; &quot;|&quot; &lt;&lt; feld[56] &lt;&lt; &quot;|&quot; &lt;&lt; feld[57] //Zeile 3 - Block 1
          &lt;&lt; &quot;| |&quot; &lt;&lt; feld[58] &lt;&lt; &quot;|&quot; &lt;&lt; feld[59] &lt;&lt; &quot;|&quot; &lt;&lt; feld[60] 
          &lt;&lt; &quot;| |&quot; &lt;&lt; feld[61] &lt;&lt; &quot;|&quot; &lt;&lt; feld[62] &lt;&lt; &quot;|&quot; &lt;&lt; feld[63] &lt;&lt; &quot;||&quot; &lt;&lt; endl
          &lt;&lt; &quot;||&quot; &lt;&lt; feld[64] &lt;&lt; &quot;|&quot; &lt;&lt; feld[65] &lt;&lt; &quot;|&quot; &lt;&lt; feld[66] //Zeile 3 - Block 2
          &lt;&lt; &quot;| |&quot; &lt;&lt; feld[67] &lt;&lt; &quot;|&quot; &lt;&lt; feld[68] &lt;&lt; &quot;|&quot; &lt;&lt; feld[69] 
          &lt;&lt; &quot;| |&quot; &lt;&lt; feld[70] &lt;&lt; &quot;|&quot; &lt;&lt; feld[71] &lt;&lt; &quot;|&quot; &lt;&lt; feld[72] &lt;&lt; &quot;||&quot; &lt;&lt; endl
          &lt;&lt; &quot;||&quot; &lt;&lt; feld[73] &lt;&lt; &quot;|&quot; &lt;&lt; feld[74] &lt;&lt; &quot;|&quot; &lt;&lt; feld[75] //Zeile 3 - Block 3
          &lt;&lt; &quot;| |&quot; &lt;&lt; feld[76] &lt;&lt; &quot;|&quot; &lt;&lt; feld[77] &lt;&lt; &quot;|&quot; &lt;&lt; feld[78] 
          &lt;&lt; &quot;| |&quot; &lt;&lt; feld[79] &lt;&lt; &quot;|&quot; &lt;&lt; feld[80] &lt;&lt; &quot;|&quot; &lt;&lt; feld[81] &lt;&lt; &quot;||&quot; &lt;&lt; endl
          &lt;&lt; &quot;----------------------------------&quot; &lt;&lt; endl;
}

void eingabe(int *feld)
{
     int wert;
     int nummer;

     while(nummer != 99)
     {
           cout &lt;&lt; &quot;Nummer des Feldes (99 = fertig): &quot; &lt;&lt; endl;
           cin &gt;&gt; nummer;

           if ((nummer != 99) &amp;&amp; (nummer &lt; 82))
           {
              cout &lt;&lt; endl &lt;&lt; &quot;Wert: &quot;;
              cin &gt;&gt; wert;

              if (wert &lt; 10)
              {
                 feld[nummer] = wert;
                 cout &lt;&lt; &quot;Erfolg!&quot; &lt;&lt; endl &lt;&lt; endl;
              }

              else
              {
                  cout &lt;&lt; &quot;Wert größer als 9! Neue Eingabe!&quot; &lt;&lt; endl;
              }

           }

           else if ((nummer != 99) &amp;&amp; (nummer &gt; 82))
           {
                cout &lt;&lt; &quot;Nummer nicht vorhanden! Neue Eingabe!&quot; &lt;&lt; endl &lt;&lt; endl;
           }

           else
           {
               break; 
           }

     }

}

void check-vert(int *feld)
{

/*void analyse(int *feld)
{
     for(int a = 1; a &lt; 82; ++a) //Felder 1 bis 81 durchgehen
     {
             if(feld[a] &gt; 0) //Wenn Feld belegt ist, Ausgabe
             {
                        cout &lt;&lt; &quot;Feld &quot; &lt;&lt; a &lt;&lt; &quot; belegt. &quot; &lt;&lt; feld[a] &lt;&lt; endl;
             }

             if (feld[a] = 0) //Wenn Feld nicht belegt ist
             {
                  if (a &lt; 10) //Für Felder 1 - 9
                  {
                        cout &lt;&lt; &quot;Feld&quot; &lt;&lt; a &lt;&lt; &quot; beträgt &quot; &lt;&lt; feld[a];

                      for(int b = a; b &lt; 81; b + 9) //Alle Felder vertikal unter Feld a durchgehen
                      {
                             for (int c = 1; c &lt; 11; ++c) //einsetzbare Werte 1 bis 9
                              {
                                  if (feld[b] != c) //Wenn geprüftes Feld diesen Wert nicht hat
                                  {
                                     feld[a] = c; //Setze Wert in das Feld ein
                                     cout &lt;&lt; &quot;Feld &quot; &lt;&lt; a &lt;&lt; &quot; beträgt &quot; &lt;&lt; feld[a];
                                  }

                              }

                      }

                  }

             }
     }   
}*/      

int main(int argc, char *argv[])
{
    int feld[82] = {0};

    char i;

    cout &lt;&lt; &quot;C++ Soduku-Solver 0.1&quot; &lt;&lt; endl &lt;&lt; endl;
    cout &lt;&lt; &quot;Ihr Sodokufeld: &quot; &lt;&lt; endl &lt;&lt; endl;
    cout &lt;&lt; &quot;------------------------------------&quot; &lt;&lt; endl
         &lt;&lt; &quot;|| 1| 2| 3 ||  4| 5| 6 ||  7| 8| 9||&quot; &lt;&lt; endl
         &lt;&lt; &quot;||10|11|12 || 13|14|15 || 16|17|18||&quot; &lt;&lt; endl
         &lt;&lt; &quot;||19|20|21 || 22|23|24 || 25|26|27||&quot; &lt;&lt; endl
         &lt;&lt; &quot;------------------------------------&quot; &lt;&lt; endl
         &lt;&lt; &quot;||28|29|30 || 31|32|33 || 34|35|36||&quot; &lt;&lt; endl
         &lt;&lt; &quot;||37|38|39 || 40|41|42 || 43|44|45||&quot; &lt;&lt; endl
         &lt;&lt; &quot;||46|47|48 || 49|50|51 || 52|53|54||&quot; &lt;&lt; endl
         &lt;&lt; &quot;------------------------------------&quot; &lt;&lt; endl
         &lt;&lt; &quot;||55|56|57 || 58|59|60 || 61|62|63||&quot; &lt;&lt; endl
         &lt;&lt; &quot;||64|65|66 || 67|68|69 || 70|71|72||&quot; &lt;&lt; endl
         &lt;&lt; &quot;||73|74|75 || 76|77|78 || 79|80|81||&quot; &lt;&lt; endl &lt;&lt; endl &lt;&lt; feld[1];

    eingabe(feld);

    //analyse()

    cin &gt;&gt; i;

    //Feld zeichnen

    return 0;
}
</code></pre>
<p>Die Analyse hab ich jetzt mal in Klammern gesetzt. Da fängt mein Denkfehler glaube schon an.<br />
Es müssen ja zuerst ALLE Felder unter, neben und in der Box des leeren Feldes überprüft werden, bis ein Wert eingesetzt wird. Hier hab ich nur unter dem Feld prüfen lassen und dann einsetzen lassen, wenn das geprüfte Feld einen anderen Wert hat, als die Ziffer die ich überprüfen lasse. Dabei kann Feld b ja 3 sein, es wird mit Wert 1 verglichen und Feld a bekommt dann den Wert 1 (weil 1 != 3). Dabei kann ja in der Reihe unter Feld a doch noch ein Feld den Wert 1 haben.</p>
<p>Ich hoffe ihr konntet mit so weit folgen <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f644.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_rolling_eyes"
      title=":rolling_eyes:"
      alt="🙄"
    /></p>
<p>Also denke ich, brauche ich ja 3 einzelne Funktionen (vertikal, horizontal und Box), oder?!</p>
<p>Ich habe grade keine Ahnung, wie ich das bewerkstelligen soll, dass erst alle Ziffern auf den Wert geprüft werden und danach die übrig bleibende Nummmer übergeben wird.<br />
Soll ich vielleicht die Werte 1 - 9 in ein Array schreiben und dann alle Plätze in dem Array nach und nach mit jedem Feld vergleichen, tausche die vorhandenen Werte gegen eine 0 aus und lasse das übrigbleibende übergeben und dann mit den übergebenen Werten aus den anderen 2 Funktionen vergleichen?</p>
<p>Ich hoffe Ihr könnt mir irgendwie einen Denkanstoß geben... <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="😕"
    /></p>
<p>Liebe Grüße<br />
Maximilian <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>
]]></description><link>https://www.c-plusplus.net/forum/post/2361261</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2361261</guid><dc:creator><![CDATA[Goldienator]]></dc:creator><pubDate>Fri, 18 Oct 2013 19:18:55 GMT</pubDate></item><item><title><![CDATA[Reply to Sudoku-Rätsel lösen lassen on Fri, 18 Oct 2013 20:23:36 GMT]]></title><description><![CDATA[<p>Goldienator schrieb:</p>
<blockquote>
<p>Ich hoffe Ihr könnt mir irgendwie einen Denkanstoß geben...</p>
</blockquote>
<p>Hier ein etwas heftiger Denkanstoß: <a href="http://channel9.msdn.com/Series/C9-Lectures-Stephan-T-Lavavej-Standard-Template-Library-STL-/C9-Lectures-Stephan-T-Lavavej-Standard-Template-Library-STL-4-of-n" rel="nofollow">Nurikabe solver</a><br />
Das ist Nummer 4 in einer Serie, die anderen sind auch sehenswert. Danach solltest du in der Lage sein deinen Code in ordentlichem C++ zu schreiben.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2361268</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2361268</guid><dc:creator><![CDATA[nwp3]]></dc:creator><pubDate>Fri, 18 Oct 2013 20:23:36 GMT</pubDate></item><item><title><![CDATA[Reply to Sudoku-Rätsel lösen lassen on Fri, 18 Oct 2013 21:07:27 GMT]]></title><description><![CDATA[<p>Sieht ja recht interessant aus, aber auch recht kompliziert für den Anfang, oder?</p>
<p>Wie findest du denn meinen Ansatz? Kann man daraus noch was machen oder hab ich gleich ganz falsch angefangen und erzähl die ganze Zeit nur Blödsinn? <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>Werd mir die Seite aus alle Fälle merken!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2361278</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2361278</guid><dc:creator><![CDATA[Goldienator]]></dc:creator><pubDate>Fri, 18 Oct 2013 21:07:27 GMT</pubDate></item><item><title><![CDATA[Reply to Sudoku-Rätsel lösen lassen on Sat, 19 Oct 2013 07:26:48 GMT]]></title><description><![CDATA[<p>Goldienator schrieb:</p>
<blockquote>
<p>Hi Leute!</p>
</blockquote>
<p>Denke, Du solltest erstmal kleinere Probleme üben.</p>
<p>a) Die Volkardsche Zahl hat die Eigenschaft, daß die Zahl,<br />
- die als ihrer ersten Ziffer gebildet wird, durch 1 teilbar ist und<br />
- die als ihrer ersten beiden Ziffern gebildet wird, durch 2 teilbar ist und<br />
- die als ihrer ersten drei Ziffern gebildet wird, durch 3 teilbar ist und</p>
<p>…<br />
Also 123<br />
würde das lösen bisher.<br />
1 ist duch 1 teilbar.<br />
12 ist durch 2 teilbar.<br />
123 ist durch 3 teilbar.<br />
…</p>
<p>- die als ihrer letzten vier Ziffern gebildet wird, durch 4 teilbar ist und</p>
<p>…Schon gehts nicht mehr. 1234 passt nicht, 1432 ginge…</p>
<p>- und so weiter<br />
- die als ihrer ersten neun Ziffern gebildet wird, durch 9 teilbar ist und</p>
<p>jede Ziffer von 1 bis 9 kommt genau einmal vor, die 0 kommt nicht vor.</p>
<p>b) Und das Acht-Damen-Problem.</p>
<p>Dann löse Dich vom Backtracking, aber behalte es im Hinterkopf und Sudoku sollte relativ locker von der Hand gehen. Ich denke, viel schneller so, als wenn Du Dir jetzt an Sudoku den Kopf einrennst.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2361281</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2361281</guid><dc:creator><![CDATA[volkard]]></dc:creator><pubDate>Sat, 19 Oct 2013 07:26:48 GMT</pubDate></item><item><title><![CDATA[Reply to Sudoku-Rätsel lösen lassen on Fri, 18 Oct 2013 21:50:01 GMT]]></title><description><![CDATA[<p>Ist auch die Ziffer 0 erlaubt? Wenn nicht, dann gibt es keine volkard'sche Zahl (Teiler 5 und 2 schließen sich dann gegenseitig aus). Und wenn, dann ist die Lösung trivial (123456789000000000), denn jede ganze Zahl ist ein Teiler von 0.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2361285</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2361285</guid><dc:creator><![CDATA[Columbo]]></dc:creator><pubDate>Fri, 18 Oct 2013 21:50:01 GMT</pubDate></item><item><title><![CDATA[Reply to Sudoku-Rätsel lösen lassen on Fri, 18 Oct 2013 21:51:10 GMT]]></title><description><![CDATA[<p>Hat sich mein Deutsch über Nacht verabschiedet? Du hast so extrem &quot;aus&quot; mit &quot;als&quot; versetzt, dass da doch ein System dahintersteckt?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2361286</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2361286</guid><dc:creator><![CDATA[AufmerksamerLeser]]></dc:creator><pubDate>Fri, 18 Oct 2013 21:51:10 GMT</pubDate></item><item><title><![CDATA[Reply to Sudoku-Rätsel lösen lassen on Fri, 18 Oct 2013 22:02:28 GMT]]></title><description><![CDATA[<p>Arcoth schrieb:</p>
<blockquote>
<p>Und wenn, dann ist die Lösung trivial (123456789000000000), denn jede ganze Zahl ist ein Teiler von 0.</p>
</blockquote>
<p>Es ist die kleinste volkardsche Zahl gesucht.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2361291</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2361291</guid><dc:creator><![CDATA[zusatzaufgabe]]></dc:creator><pubDate>Fri, 18 Oct 2013 22:02:28 GMT</pubDate></item><item><title><![CDATA[Reply to Sudoku-Rätsel lösen lassen on Fri, 18 Oct 2013 22:26:47 GMT]]></title><description><![CDATA[<p>Nicht mal zu der volkardschen Zahl fällt mir eine Herangehensweise ein /:<br />
Hat da vielleicht jmd einen Vorschlag? Evtl. auch wie man allgemein an solche Aufgaben herangeht um eine vernünftige Lösung zu finden...</p>
<p>Entweder bin ich zu dumm oder zu müde <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>
]]></description><link>https://www.c-plusplus.net/forum/post/2361293</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2361293</guid><dc:creator><![CDATA[Goldienator]]></dc:creator><pubDate>Fri, 18 Oct 2013 22:26:47 GMT</pubDate></item><item><title><![CDATA[Reply to Sudoku-Rätsel lösen lassen on Sat, 19 Oct 2013 07:18:00 GMT]]></title><description><![CDATA[<p>Arcoth schrieb:</p>
<blockquote>
<p>Ist auch die Ziffer 0 erlaubt?</p>
</blockquote>
<p>Nein.</p>
<blockquote>
<p>Wenn nicht, dann gibt es keine volkard'sche Zahl (Teiler 5 und 2 schließen sich dann gegenseitig aus).</p>
</blockquote>
<p>Aufgabe war falsch. Von vorne.</p>
<p>Warum hast Du da so einen Apostroph hineingefummelt?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2361302</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2361302</guid><dc:creator><![CDATA[volkard]]></dc:creator><pubDate>Sat, 19 Oct 2013 07:18:00 GMT</pubDate></item><item><title><![CDATA[Reply to Sudoku-Rätsel lösen lassen on Sat, 19 Oct 2013 05:23:24 GMT]]></title><description><![CDATA[<p>Goldienator schrieb:</p>
<blockquote>
<p>Evtl. auch wie man allgemein an solche Aufgaben herangeht um eine vernünftige Lösung zu finden...</p>
</blockquote>
<p>Löse es ein paar mal per Hand.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2361303</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2361303</guid><dc:creator><![CDATA[volkard]]></dc:creator><pubDate>Sat, 19 Oct 2013 05:23:24 GMT</pubDate></item><item><title><![CDATA[Reply to Sudoku-Rätsel lösen lassen on Sun, 20 Oct 2013 18:24:07 GMT]]></title><description><![CDATA[<p>Um noch mal auf die Sudokugeschichte zurückzukommen... <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>Mit Hilfe dieses Videos <a href="http://www.youtube.com/watch?v=F8JYIUOn_L4&amp;hd=1" rel="nofollow">www.youtube.com/watch?v=F8JYIUOn_L4&amp;hd=1</a></p>
<p>bin ich zu dem Code gekommen:</p>
<pre><code>#include &lt;cstdlib&gt;
#include &lt;iostream&gt;

using namespace std;

void draw(int feld[][8])
{
    for (int zeile = 0; zeile &lt; 9; ++zeile)
    {
        for(int spalte = 0; spalte &lt; 9; ++spalte)
        {
             cout &lt;&lt; feld[spalte][zeile] &lt;&lt; &quot; &quot;;
        }

        cout &lt;&lt; endl;
    }
}

void eingabe(int feld[][8])
{
    int spalte; 
	int zeile;
	int wert;
	char input = ' ';

	while(input != 'q')
	{

		cout &lt;&lt; &quot;Ihr Sodokufeld: &quot; &lt;&lt; endl &lt;&lt; endl;
		cout &lt;&lt; &quot;------------------------------------------&quot; &lt;&lt; endl
		     &lt;&lt; &quot;-|| 0 | 1 | 2 || 3 | 4 | 5 || 6 | 7 | 8 ||&quot; &lt;&lt; endl
             &lt;&lt; &quot;-||-----------||-----------||-----------||&quot; &lt;&lt; endl
		     &lt;&lt; &quot;0|| x | x | x || x | x | x || x | x | x ||&quot; &lt;&lt; endl
             &lt;&lt; &quot;1|| x | x | x || x | x | x || x | x | x ||&quot; &lt;&lt; endl
             &lt;&lt; &quot;2|| x | x | x || x | x | x || x | x | x ||&quot; &lt;&lt; endl
             &lt;&lt; &quot;-||-----------||-----------||-----------||&quot; &lt;&lt; endl
             &lt;&lt; &quot;3|| x | x | x || x | x | x || x | x | x ||&quot; &lt;&lt; endl
             &lt;&lt; &quot;4|| x | x | x || x | x | x || x | x | x ||&quot; &lt;&lt; endl
             &lt;&lt; &quot;5|| x | x | x || x | x | x || x | x | x ||&quot; &lt;&lt; endl
             &lt;&lt; &quot;-||-----------||-----------||-----------||&quot; &lt;&lt; endl
             &lt;&lt; &quot;6|| x | x | x || x | x | x || x | x | x ||&quot; &lt;&lt; endl
             &lt;&lt; &quot;7|| x | x | x || x | x | x || x | x | x ||&quot; &lt;&lt; endl
             &lt;&lt; &quot;8|| x | x | x || x | x | x || x | x | x ||&quot; &lt;&lt; endl;

		cout &lt;&lt; endl &lt;&lt; &quot;Spalte (0-8): &quot;;
		cin &gt;&gt; spalte;
		cout &lt;&lt; endl &lt;&lt; &quot;Zeile (0-8): &quot; ;
		cin &gt;&gt; zeile;
		cout &lt;&lt; endl &lt;&lt; &quot;Wert (1-9) &quot;;
		cin &gt;&gt; wert;

		feld[spalte][zeile] = wert;

		cout &lt;&lt; endl &lt;&lt; &quot;'q' + Enter zum fertigstellen. Beliebige Taste + Enter zum fortfahren.&quot; &lt;&lt; endl &lt;&lt; endl;
		cin &gt;&gt; input;

	}
}

bool chkZeile(int zeile, int wert, int arr[8][8])
{
	for (int spalte = 1; spalte &lt; 9; ++spalte) //für Spalten-koordinate
	{
		if (arr[spalte][zeile] == wert) //wenn Feld (spalte, koordinnate) schon wert hat
		{
			return false;
		}
	}

	return true;
}

bool chkSpalte(int spalte, int wert, int arr[8][8])
{
	for (int zeile = 1; zeile &lt; 9; ++zeile)
	{
		if (arr[spalte][zeile] == wert)
		{
			return false;
		}
	}

	return true;
}

bool chkBox(int spalte, int zeile, int wert, int arr[8][8])
{
	for (int i = 1; i &lt; 9; ++i)
	{
		for (int j = 1; i &lt; 9; ++i)
		{
			if (arr[spalte - (spalte%3) + i][zeile - (zeile%3) + j] == wert) //von links-oben nach rechts-unten
			{
				return false;
			}
		}
	}
	return true;
}

bool chkall(int spalte, int zeile, int wert, int arr[8][8])
{
	if (chkZeile(zeile, wert, arr) == false)
	{
		return false;
	}

	if (chkSpalte(spalte, wert, arr) == false)
	{
		return false;
	}

	if (chkBox(spalte, zeile, wert, arr) == false)
	{
		return false;
	}

	return true;
}

int solve(int spalte, int zeile, int wert, int arr[8][8])
{
	int workarr[8][8];
	for (int i = 0; i &lt; 9; ++i)
	{
		for (int j = 0; j &lt; 9; ++j)
		{
			workarr[i][j] = arr[i][j];
		}
	}

	workarr[zeile][spalte] = wert;

	for (int x = 0; x &lt; 9; ++x)
	{
		for (int y = 0; y &lt; 9; ++y)
		{
			if(workarr[x][y] == 0)
			{
				for (int val = 1; val &lt; 9; ++val)
				{
					if(chkall(x,y,val,workarr))
					{
						solve(x,y,val,workarr);
					}
				}
				return NULL;
			}
		}
	}
}

int main(int argc, char *argv[])
{
    int feld[8][8] = {0};

    eingabe(feld);
	solve(0,0,0,feld);
    draw(feld);
	system(&quot;Pause&quot;);

    return 0;
}
</code></pre>
<p>Es wird jetzt an der Stelle angehalten, an der ich eine Kopie von dem der Funktion übergebenem Array, um damit dann weiter zu arbeiten, kommt die Fehlermeldung:</p>
<p><strong>Unbehandelte Ausnahme bei 0x012b8d38 in Sudoku-Löser.exe: 0xC0000005: Zugriffsverletzung beim Lesen an Position 0xa835bbca.</strong></p>
<p>Weiß da jmd. einen Rat? :o</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2361600</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2361600</guid><dc:creator><![CDATA[Goldienator]]></dc:creator><pubDate>Sun, 20 Oct 2013 18:24:07 GMT</pubDate></item><item><title><![CDATA[Reply to Sudoku-Rätsel lösen lassen on Mon, 21 Oct 2013 07:14:26 GMT]]></title><description><![CDATA[<p>bitte lösche den code da, das ist einfach nur c mit cout, absolut unbrauchbar. gründe für den runtime error:<br />
1. zeile 13 (vll solltest du dir array-indices nochmals anschauen)<br />
2. zeile 65 (dito)<br />
3. zeile 78 (dito)<br />
4. zeile 93 (dito)<br />
5. zeile 139 (dito)<br />
6. zeile 143 (dito)<br />
7. zeile 124 (stackoverflow wenn zu tiefe rekursion)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2361726</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2361726</guid><dc:creator><![CDATA[not smart]]></dc:creator><pubDate>Mon, 21 Oct 2013 07:14:26 GMT</pubDate></item><item><title><![CDATA[Reply to Sudoku-Rätsel lösen lassen on Mon, 21 Oct 2013 09:13:18 GMT]]></title><description><![CDATA[<blockquote>
<p>1. zeile 13 (vll solltest du dir array-indices nochmals anschauen)</p>
</blockquote>
<p>Was soll denn damit sein?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2361757</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2361757</guid><dc:creator><![CDATA[Goldienator]]></dc:creator><pubDate>Mon, 21 Oct 2013 09:13:18 GMT</pubDate></item><item><title><![CDATA[Reply to Sudoku-Rätsel lösen lassen on Mon, 21 Oct 2013 09:14:19 GMT]]></title><description><![CDATA[<p>Goldienator schrieb:</p>
<blockquote>
<blockquote>
<p>1. zeile 13 (vll solltest du dir array-indices nochmals anschauen)</p>
</blockquote>
<p>Was soll denn damit sein?</p>
</blockquote>
<p>Zähl mal alle Zahlen von 0 an, die kleiner sind als 9. Wie viele sind das?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2361758</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2361758</guid><dc:creator><![CDATA[SeppJ]]></dc:creator><pubDate>Mon, 21 Oct 2013 09:14:19 GMT</pubDate></item><item><title><![CDATA[Reply to Sudoku-Rätsel lösen lassen on Mon, 21 Oct 2013 09:39:17 GMT]]></title><description><![CDATA[<p>0, 1, 2, 3, 4, 5, 6, 7, 8</p>
<p>Sind neun Zahlen <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>
]]></description><link>https://www.c-plusplus.net/forum/post/2361772</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2361772</guid><dc:creator><![CDATA[Goldienator]]></dc:creator><pubDate>Mon, 21 Oct 2013 09:39:17 GMT</pubDate></item><item><title><![CDATA[Reply to Sudoku-Rätsel lösen lassen on Mon, 21 Oct 2013 09:57:43 GMT]]></title><description><![CDATA[<p>Oder irr ich mich da? <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="😕"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/2361779</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2361779</guid><dc:creator><![CDATA[Goldienator]]></dc:creator><pubDate>Mon, 21 Oct 2013 09:57:43 GMT</pubDate></item><item><title><![CDATA[Reply to Sudoku-Rätsel lösen lassen on Mon, 21 Oct 2013 10:00:00 GMT]]></title><description><![CDATA[<p>Goldienator schrieb:</p>
<blockquote>
<p>Sind neun Zahlen <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>
</blockquote>
<p>Und wie groß ist dein Feld?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2361781</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2361781</guid><dc:creator><![CDATA[nwp3]]></dc:creator><pubDate>Mon, 21 Oct 2013 10:00:00 GMT</pubDate></item><item><title><![CDATA[Reply to Sudoku-Rätsel lösen lassen on Mon, 21 Oct 2013 10:11:17 GMT]]></title><description><![CDATA[<blockquote>
<p>Und wie groß ist dein Feld?</p>
</blockquote>
<p>0-8 (also 9) Zeilen und 0-8 Spalten.<br />
Sind ja dann insgesamt 81...</p>
<p>Sieht man doch eigentlich auch im Code oder?</p>
<pre><code>cout &lt;&lt; &quot;------------------------------------------&quot; &lt;&lt; endl
             &lt;&lt; &quot;-|| 0 | 1 | 2 || 3 | 4 | 5 || 6 | 7 | 8 ||&quot; &lt;&lt; endl
             &lt;&lt; &quot;-||-----------||-----------||-----------||&quot; &lt;&lt; endl
             &lt;&lt; &quot;0|| x | x | x || x | x | x || x | x | x ||&quot; &lt;&lt; endl
             &lt;&lt; &quot;1|| x | x | x || x | x | x || x | x | x ||&quot; &lt;&lt; endl
             &lt;&lt; &quot;2|| x | x | x || x | x | x || x | x | x ||&quot; &lt;&lt; endl
             &lt;&lt; &quot;-||-----------||-----------||-----------||&quot; &lt;&lt; endl
             &lt;&lt; &quot;3|| x | x | x || x | x | x || x | x | x ||&quot; &lt;&lt; endl
             &lt;&lt; &quot;4|| x | x | x || x | x | x || x | x | x ||&quot; &lt;&lt; endl
             &lt;&lt; &quot;5|| x | x | x || x | x | x || x | x | x ||&quot; &lt;&lt; endl
             &lt;&lt; &quot;-||-----------||-----------||-----------||&quot; &lt;&lt; endl
             &lt;&lt; &quot;6|| x | x | x || x | x | x || x | x | x ||&quot; &lt;&lt; endl
             &lt;&lt; &quot;7|| x | x | x || x | x | x || x | x | x ||&quot; &lt;&lt; endl
             &lt;&lt; &quot;8|| x | x | x || x | x | x || x | x | x ||&quot; &lt;&lt; endl;
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/2361783</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2361783</guid><dc:creator><![CDATA[Goldienator]]></dc:creator><pubDate>Mon, 21 Oct 2013 10:11:17 GMT</pubDate></item><item><title><![CDATA[Reply to Sudoku-Rätsel lösen lassen on Mon, 21 Oct 2013 10:14:55 GMT]]></title><description><![CDATA[<p>Goldienator schrieb:</p>
<blockquote>
<blockquote>
<p>Und wie groß ist dein Feld?</p>
</blockquote>
<p>0-8 (also 9) Zeilen und 0-8 Spalten.<br />
Sind ja dann insgesamt 81...</p>
<p>Sieht man doch eigentlich auch im Code oder?</p>
</blockquote>
<p>nicht die Zeichen, die du ausgibst. Wie groß ist dein Array?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2361785</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2361785</guid><dc:creator><![CDATA[daddy_felix]]></dc:creator><pubDate>Mon, 21 Oct 2013 10:14:55 GMT</pubDate></item><item><title><![CDATA[Reply to Sudoku-Rätsel lösen lassen on Mon, 21 Oct 2013 10:22:10 GMT]]></title><description><![CDATA[<blockquote>
<p>nicht die Zeichen, die du ausgibst. Wie groß ist dein Array?</p>
</blockquote>
<p>Ich glaub ich versteh jetzt was ihr sagen wollt <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>Wenn ich ein Array mit 8 Speicherplätzen erstelle, kann ich das Array nur bis [7] ansprechen, weil [0] ja auch zu den 8 Plätzen dazu zählt, oder?!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2361790</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2361790</guid><dc:creator><![CDATA[Goldienator]]></dc:creator><pubDate>Mon, 21 Oct 2013 10:22:10 GMT</pubDate></item><item><title><![CDATA[Reply to Sudoku-Rätsel lösen lassen on Mon, 21 Oct 2013 10:23:29 GMT]]></title><description><![CDATA[<p>Goldienator schrieb:</p>
<blockquote>
<p>Wenn ich ein Array mit 8 Speicherplätzen erstelle, kann ich das Array nur bis [7] ansprechen, weil [0] ja auch zu den 8 Plätzen dazu zählt, oder?!</p>
</blockquote>
<p>So ist es.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2361793</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2361793</guid><dc:creator><![CDATA[SeppJ]]></dc:creator><pubDate>Mon, 21 Oct 2013 10:23:29 GMT</pubDate></item><item><title><![CDATA[Reply to Sudoku-Rätsel lösen lassen on Mon, 21 Oct 2013 10:32:53 GMT]]></title><description><![CDATA[<p>Argghh... jetzt bin ich komplett verwirrt <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="😕"
    /> <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f62e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_open_mouth"
      title=":open_mouth:"
      alt="😮"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/2361797</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2361797</guid><dc:creator><![CDATA[Goldienator]]></dc:creator><pubDate>Mon, 21 Oct 2013 10:32:53 GMT</pubDate></item><item><title><![CDATA[Reply to Sudoku-Rätsel lösen lassen on Mon, 21 Oct 2013 10:34:40 GMT]]></title><description><![CDATA[<p>damit du ein array hast mit 9 einträgen musst du es mit &quot;int array[9]&quot; definieren und kannst es dann mit &quot;array[0]&quot; ... &quot;array[8]&quot; ansprechen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2361800</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2361800</guid><dc:creator><![CDATA[kenner der verwirrung]]></dc:creator><pubDate>Mon, 21 Oct 2013 10:34:40 GMT</pubDate></item><item><title><![CDATA[Reply to Sudoku-Rätsel lösen lassen on Mon, 21 Oct 2013 10:38:54 GMT]]></title><description><![CDATA[<p>Okay... hab ich so weit verstanden <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>Jetzt erklärt mir das mal bitte mit dem Stackoverflow bei einer zu tiefen Rekursion... <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="😕"
    /></p>
<p>Was ist damit genau gemeint?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2361801</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2361801</guid><dc:creator><![CDATA[Goldienator]]></dc:creator><pubDate>Mon, 21 Oct 2013 10:38:54 GMT</pubDate></item><item><title><![CDATA[Reply to Sudoku-Rätsel lösen lassen on Mon, 21 Oct 2013 10:49:31 GMT]]></title><description><![CDATA[<p>mach einfach eine klasse die ein sudoku-spielfeld darstellt und intern einen vektor benutzt. etwa so:</p>
<pre><code>#include &lt;vector&gt;
#include &lt;iostream&gt;
using namespace std;
class sudoku
{
public:
	enum {
		width = 9,
		height = 9
	};
private:
	vector&lt;int&gt; data;
public:
	sudoku(int fill = 0)
		: data(width * height, fill) {
	}
	void solve() {
		//...
	}
	int operator() (size_t x, size_t y) const {
		return data[x + y * width];
	}
	int&amp; operator() (size_t x, size_t y) {
		return data[x + y * width];
	}
};
ostream&amp; operator&lt;&lt; (ostream&amp; s, sudoku const&amp; d) {
	//...
}
int main()
{
	sudoku mein_spielfeld;
	mein_spielfeld(0, 0) = 1;
	mein_spielfeld.solve();
	cout &lt;&lt; mein_spielfeld;
}
</code></pre>
<p>das ganze ist viel einfacher zu bedienen...<br />
das mit dem möglichen stackoverflow wird damit gerade auch behoben denn ein std::vector speichert seine elemente auf dem heap. (bzw. nein, er legt sie mit new[] an aber damit wird normalerweise der heap angesprochen)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2361807</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2361807</guid><dc:creator><![CDATA[kenner der verwirrung]]></dc:creator><pubDate>Mon, 21 Oct 2013 10:49:31 GMT</pubDate></item><item><title><![CDATA[Reply to Sudoku-Rätsel lösen lassen on Mon, 21 Oct 2013 12:50:12 GMT]]></title><description><![CDATA[<p>Goldienator schrieb:</p>
<blockquote>
<p>Okay... hab ich so weit verstanden <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>Jetzt erklärt mir das mal bitte mit dem Stackoverflow bei einer zu tiefen Rekursion... <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="😕"
    /></p>
<p>Was ist damit genau gemeint?</p>
</blockquote>
<p>Jeder rekurtsive Aufruf braucht ein wenig Stackspeicher, so 20-50 Bytes vielleicht. Ruft sich eine Funktion oft selber auf, vieltausenmal, kann der STack ausgehen und das Programm stürzt ab.</p>
<p>Wird Dir aber nicht passieren, weil Du bei vor jedem Abstieg eine Zahl einträgst und nach jedem Aufstieg sie wieder austrägst. Kannst nicht tiefer als 81 Ebenen abteigen. 81 ist voll unkritisch.</p>
<p>Sogar, wenn Du nicht streichst (warum nicht, ist doch viel schneller und einfach genug), sondern Kopien hältst, wie Du es mit dem workarray machst, 81*sizeof(int)*81 ist auch locker um die 30k, kannst davon ausgehen, ca 1M zu haben.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2361850</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2361850</guid><dc:creator><![CDATA[volkard]]></dc:creator><pubDate>Mon, 21 Oct 2013 12:50:12 GMT</pubDate></item></channel></rss>