<?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++ array ringförmig]]></title><description><![CDATA[<p>Hallo,</p>
<p>ich schreibe gerade aus Spaß meine eigene Version von Conways Spiel des Lebens.<br />
Ich bin fast damit fertig, aber ich würde es gerne so gestalten dass ein Objekt was an den Rand fliegt am entgegengesetzten Ende wieder da ist.</p>
<p>Ich wollte das eigentlich so lösen:</p>
<pre><code class="language-cpp">if (cell.Position().y + 1 &lt; 60 &amp;&amp; field_[cell.Position().x ][ cell.Position().y + 1].IsAlive())
			++neighbours;
else if (cell.Position().y + 1 &gt; 60 &amp;&amp; field_[cell.Position().x ][0].IsAlive())
			++neighbours;
</code></pre>
<p>Also auf Deutsch das beim Zählen der Nachbarn implementieren. Dass ist jedoch wirkungslos und Google half mir auch nicht. Ich hab sogar schon andere Versionen angeschaut, aber die verwenden dieses Feature nicht.</p>
<p>Deshalb würde ich mich über jegliche Lösungsvorschläge freuen!</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/304362/c-array-ringförmig</link><generator>RSS for Node</generator><lastBuildDate>Mon, 10 Aug 2026 00:49:58 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/304362.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 04 Jun 2012 16:54:44 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to C++ array ringförmig on Mon, 04 Jun 2012 16:54:44 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>ich schreibe gerade aus Spaß meine eigene Version von Conways Spiel des Lebens.<br />
Ich bin fast damit fertig, aber ich würde es gerne so gestalten dass ein Objekt was an den Rand fliegt am entgegengesetzten Ende wieder da ist.</p>
<p>Ich wollte das eigentlich so lösen:</p>
<pre><code class="language-cpp">if (cell.Position().y + 1 &lt; 60 &amp;&amp; field_[cell.Position().x ][ cell.Position().y + 1].IsAlive())
			++neighbours;
else if (cell.Position().y + 1 &gt; 60 &amp;&amp; field_[cell.Position().x ][0].IsAlive())
			++neighbours;
</code></pre>
<p>Also auf Deutsch das beim Zählen der Nachbarn implementieren. Dass ist jedoch wirkungslos und Google half mir auch nicht. Ich hab sogar schon andere Versionen angeschaut, aber die verwenden dieses Feature nicht.</p>
<p>Deshalb würde ich mich über jegliche Lösungsvorschläge freuen!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2219331</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2219331</guid><dc:creator><![CDATA[IrgendeinName]]></dc:creator><pubDate>Mon, 04 Jun 2012 16:54:44 GMT</pubDate></item><item><title><![CDATA[Reply to C++ array ringförmig on Mon, 04 Jun 2012 17:18:31 GMT]]></title><description><![CDATA[<p>Ich schlage vor:<br />
<a href="http://en.wikipedia.org/wiki/Modulo_operation" rel="nofollow">http://en.wikipedia.org/wiki/Modulo_operation</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/2219340</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2219340</guid><dc:creator><![CDATA[SeppJ]]></dc:creator><pubDate>Mon, 04 Jun 2012 17:18:31 GMT</pubDate></item><item><title><![CDATA[Reply to C++ array ringförmig on Mon, 04 Jun 2012 17:27:08 GMT]]></title><description><![CDATA[<p>SeppJ schrieb:</p>
<blockquote>
<p>Ich schlage vor:<br />
<a href="http://en.wikipedia.org/wiki/Modulo_operation" rel="nofollow">http://en.wikipedia.org/wiki/Modulo_operation</a></p>
</blockquote>
<p><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="😕"
    /> Was hat das mit einem Array zu tun? Das Ding ist fixed sized<br />
(T foo[const][const]), also müsste das mit konditionalen Statements doch zu lösen sein? Verstehe ich hier irgendwas nicht?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2219341</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2219341</guid><dc:creator><![CDATA[IrgendeinName]]></dc:creator><pubDate>Mon, 04 Jun 2012 17:27:08 GMT</pubDate></item><item><title><![CDATA[Reply to C++ array ringförmig on Mon, 04 Jun 2012 17:37:39 GMT]]></title><description><![CDATA[<p>0 mod 5 = 0<br />
1 mod 5 = 1<br />
2 mod 5 = 2<br />
3 mod 5 = 3<br />
4 mod 5 = 4<br />
5 mod 5 = 0<br />
6 mod 5 = 1<br />
7 mod 5 = 2<br />
8 mod 5 = 3<br />
9 mod 5 = 4</p>
<p>Fällt dir was auf?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2219344</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2219344</guid><dc:creator><![CDATA[Kellerautomat]]></dc:creator><pubDate>Mon, 04 Jun 2012 17:37:39 GMT</pubDate></item><item><title><![CDATA[Reply to C++ array ringförmig on Mon, 04 Jun 2012 17:37:51 GMT]]></title><description><![CDATA[<p>IrgendeinName schrieb:</p>
<blockquote>
<p>Verstehe ich hier irgendwas nicht?</p>
</blockquote>
<p>Ja. Rechner mal 61 % 60 aus.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2219346</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2219346</guid><dc:creator><![CDATA[SeppJ]]></dc:creator><pubDate>Mon, 04 Jun 2012 17:37:51 GMT</pubDate></item><item><title><![CDATA[Reply to C++ array ringförmig on Mon, 04 Jun 2012 20:08:35 GMT]]></title><description><![CDATA[<p>Mein Hauptproblem war eigentlich schlechtes Funktionsdesign, hab deshalb die Übersicht verloren. Außerdem sollte ich mir ein paar Kapitel in einem anderen Buch ansehen, da meins schlecht war. Das Problem existiert zwar noch, ist aber nur durch besseres Funktionsdesign lösbar und deshalb nicht forum-geeignet.</p>
<p>Trotzdem danke an alle!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2219443</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2219443</guid><dc:creator><![CDATA[Kann nicht einloggen]]></dc:creator><pubDate>Mon, 04 Jun 2012 20:08:35 GMT</pubDate></item></channel></rss>