<?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[[C#] Game Of Life: Rückwärts]]></title><description><![CDATA[<p>Hallo Leute!</p>
<p>Ich habe einen GameOfLife-Algorythmus. Aber wie mache ich das er rückwärts rechnet?</p>
<p>Ich weiß wirklich nicht mehr weiter...</p>
<pre><code class="language-cpp">public void Game(bool back)
        {
            CellMatrix&lt;bool&gt; tmp = new CellMatrix&lt;bool&gt;(
                this.Matrix.Width,
                this.Matrix.Height);

            for (int y = 0; y &lt; this.Matrix.Height; y++)
            {
                for (int x = 0; x &lt; this.Matrix.Width; x++)
                {
                    int neighbours = Neighbours(x, y);

                    if (back)
                    {
                        // ... //
                    }
                    else
                    {
                        if (this.Matrix[x, y])
                        {
                            // Cell is living
                            if ((neighbours &lt; 2) || (neighbours &gt; 3))
                                tmp[x, y] = false;
                            else
                                tmp[x, y] = true;
                        }
                        else if (neighbours == 3)
                            tmp[x, y] = true;
                        else
                            tmp[x, y] = false;
                    }
                }
            }

            this.Matrix = tmp;
        }
</code></pre>
<p>CellMatrix: Ist eine Matrix-Klasse von mir<br />
Neighbours(): WIviele nachbarn?</p>
<p>Ich hoffe, das ist alles verständlich.</p>
<p>Aber wie rechne ich denn nun rückwärts?</p>
<p>Danke schonmal im Vorraus. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f576.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--sunglasses"
      title=":sunglasses:"
      alt="🕶"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/topic/197450/c-game-of-life-rückwärts</link><generator>RSS for Node</generator><lastBuildDate>Mon, 29 Jun 2026 21:44:02 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/197450.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 10 Nov 2007 16:02:46 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to [C#] Game Of Life: Rückwärts on Sat, 10 Nov 2007 16:02:46 GMT]]></title><description><![CDATA[<p>Hallo Leute!</p>
<p>Ich habe einen GameOfLife-Algorythmus. Aber wie mache ich das er rückwärts rechnet?</p>
<p>Ich weiß wirklich nicht mehr weiter...</p>
<pre><code class="language-cpp">public void Game(bool back)
        {
            CellMatrix&lt;bool&gt; tmp = new CellMatrix&lt;bool&gt;(
                this.Matrix.Width,
                this.Matrix.Height);

            for (int y = 0; y &lt; this.Matrix.Height; y++)
            {
                for (int x = 0; x &lt; this.Matrix.Width; x++)
                {
                    int neighbours = Neighbours(x, y);

                    if (back)
                    {
                        // ... //
                    }
                    else
                    {
                        if (this.Matrix[x, y])
                        {
                            // Cell is living
                            if ((neighbours &lt; 2) || (neighbours &gt; 3))
                                tmp[x, y] = false;
                            else
                                tmp[x, y] = true;
                        }
                        else if (neighbours == 3)
                            tmp[x, y] = true;
                        else
                            tmp[x, y] = false;
                    }
                }
            }

            this.Matrix = tmp;
        }
</code></pre>
<p>CellMatrix: Ist eine Matrix-Klasse von mir<br />
Neighbours(): WIviele nachbarn?</p>
<p>Ich hoffe, das ist alles verständlich.</p>
<p>Aber wie rechne ich denn nun rückwärts?</p>
<p>Danke schonmal im Vorraus. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f576.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--sunglasses"
      title=":sunglasses:"
      alt="🕶"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1400989</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1400989</guid><dc:creator><![CDATA[Script-Styler]]></dc:creator><pubDate>Sat, 10 Nov 2007 16:02:46 GMT</pubDate></item><item><title><![CDATA[Reply to [C#] Game Of Life: Rückwärts on Sat, 10 Nov 2007 16:32:50 GMT]]></title><description><![CDATA[<p>Wie soll das gehen? Im Allgemeinen gibt es mehrere mögliche Vorgängerzustände.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1401012</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1401012</guid><dc:creator><![CDATA[Bashar]]></dc:creator><pubDate>Sat, 10 Nov 2007 16:32:50 GMT</pubDate></item><item><title><![CDATA[Reply to [C#] Game Of Life: Rückwärts on Sat, 10 Nov 2007 18:55:51 GMT]]></title><description><![CDATA[<p>vielleicht gelingt es dir, diese regeln umzudrehen:</p>
<blockquote>
<p>Death<br />
If an occupied cell has 0, 1, 4, 5, 6, 7, or 8 occupied neighbors, the organism dies (0, 1: of loneliness; 4 thru 8: of overcrowding).<br />
Survival<br />
If an occupied cell has two or three neighbors, the organism survives to the next generation.<br />
Birth<br />
If an unoccupied cell has three occupied neighbors, it becomes occupied.</p>
</blockquote>
<p><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/1401092</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1401092</guid><dc:creator><![CDATA[Game of Death]]></dc:creator><pubDate>Sat, 10 Nov 2007 18:55:51 GMT</pubDate></item><item><title><![CDATA[Reply to [C#] Game Of Life: Rückwärts on Sat, 10 Nov 2007 19:15:18 GMT]]></title><description><![CDATA[<p>Algorithmus schreibt man mit i.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1401103</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1401103</guid><dc:creator><![CDATA[Anmerker]]></dc:creator><pubDate>Sat, 10 Nov 2007 19:15:18 GMT</pubDate></item><item><title><![CDATA[Reply to [C#] Game Of Life: Rückwärts on Sat, 10 Nov 2007 19:26:32 GMT]]></title><description><![CDATA[<p>Anmerker schrieb:</p>
<blockquote>
<p>Algorithmus schreibt man mit i.</p>
</blockquote>
<p>das hätte den alten Al-Hwarizmi auch nicht gestört <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1401109</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1401109</guid><dc:creator><![CDATA[Kim Possible]]></dc:creator><pubDate>Sat, 10 Nov 2007 19:26:32 GMT</pubDate></item></channel></rss>