<?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[In einer Matrix gleiche Elemente finden]]></title><description><![CDATA[<p>Hallo. Ich versuche gerade das <a href="http://de.wikipedia.org/wiki/SameGame" rel="nofollow">samegame</a> zu programmieren. Meine frage ist: Wie findet man wirklich alle Elemente, die zusammengehören. Auch solche &quot;komplizierten&quot; wie folgend:</p>
<pre><code>xxxxxx
     x    x
     x x  x
     x xxxx
    xx
xxxxxxxxxxx
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/topic/311903/in-einer-matrix-gleiche-elemente-finden</link><generator>RSS for Node</generator><lastBuildDate>Mon, 03 Aug 2026 06:26:07 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/311903.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 18 Dec 2012 08:38:36 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to In einer Matrix gleiche Elemente finden on Tue, 18 Dec 2012 08:38:36 GMT]]></title><description><![CDATA[<p>Hallo. Ich versuche gerade das <a href="http://de.wikipedia.org/wiki/SameGame" rel="nofollow">samegame</a> zu programmieren. Meine frage ist: Wie findet man wirklich alle Elemente, die zusammengehören. Auch solche &quot;komplizierten&quot; wie folgend:</p>
<pre><code>xxxxxx
     x    x
     x x  x
     x xxxx
    xx
xxxxxxxxxxx
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/2281062</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2281062</guid><dc:creator><![CDATA[Namal]]></dc:creator><pubDate>Tue, 18 Dec 2012 08:38:36 GMT</pubDate></item><item><title><![CDATA[Reply to In einer Matrix gleiche Elemente finden on Tue, 18 Dec 2012 08:41:52 GMT]]></title><description><![CDATA[<p>Du fängst bei einem Stein an, und prüfst alle umliegenden Steine.<br />
Für die, die du findest, machst du es ganz genauso, prüfst also wieder alle Umliegenden Steine - ignorierst aber diejenigen, die du schon &quot;registriert&quot; hast.<br />
Bis alle gefunden sind.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2281063</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2281063</guid><dc:creator><![CDATA[Sone]]></dc:creator><pubDate>Tue, 18 Dec 2012 08:41:52 GMT</pubDate></item><item><title><![CDATA[Reply to In einer Matrix gleiche Elemente finden on Tue, 18 Dec 2012 12:12:36 GMT]]></title><description><![CDATA[<p><a href="http://de.wikipedia.org/wiki/Floodfill" rel="nofollow">http://de.wikipedia.org/wiki/Floodfill</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/2281168</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2281168</guid><dc:creator><![CDATA[samenlappen]]></dc:creator><pubDate>Tue, 18 Dec 2012 12:12:36 GMT</pubDate></item><item><title><![CDATA[Reply to In einer Matrix gleiche Elemente finden on Tue, 18 Dec 2012 16:49:34 GMT]]></title><description><![CDATA[<p>vielen Dank, hat mir sehr geholfen :xmas1:</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2281250</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2281250</guid><dc:creator><![CDATA[Namal]]></dc:creator><pubDate>Tue, 18 Dec 2012 16:49:34 GMT</pubDate></item><item><title><![CDATA[Reply to In einer Matrix gleiche Elemente finden on Tue, 18 Dec 2012 20:40:20 GMT]]></title><description><![CDATA[<p>Es funktioniert nun soweit, ich habe aber nur das Problem, dass bei der Auswahl des obersten Steins ich die Steine nicht löschen kann. Also ich weiß wie ich sie dann löschenmuss, aber ich weiß nicht wie man übeprüfen kann, dass die Spalten zu denen gehören, bei denen die oberen Steine gelöscht werden.</p>
<p>Bisher habe ich</p>
<pre><code>for (int m=2;m&lt;11;++m){		
				int anzx=0;

				for (int n=2;n&lt;11;++n)
					if(feld[n][m]=='x')
						anzx++;

					for(int n=10;n&gt;1;--n){
						if(feld[n][m]=='x'){
							for(n;n&gt;1+anzx;--n){
								feld[n][m]=feld[n-anzx][m];
								feld[n-anzx][m]=' ';
							}
						}	

					}

		 	}
</code></pre>
<p>Da bei mir die zweite Zeile in der Matrix sowieso leer ist hab ich mit</p>
<pre><code>if (feld[n][m]=='x' &amp;&amp; feld[n-1][m]==' ')
</code></pre>
<p>versucht, aber warum auch immer wird diese Bedingung nicht erfüllt <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/2281324</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2281324</guid><dc:creator><![CDATA[Namal]]></dc:creator><pubDate>Tue, 18 Dec 2012 20:40:20 GMT</pubDate></item><item><title><![CDATA[Reply to In einer Matrix gleiche Elemente finden on Tue, 18 Dec 2012 21:51:14 GMT]]></title><description><![CDATA[<p>Weil es so Spass macht, hier meine Implementation: <a href="http://ideone.com/522LDI" rel="nofollow">http://ideone.com/522LDI</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/2281342</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2281342</guid><dc:creator><![CDATA[samenlappen]]></dc:creator><pubDate>Tue, 18 Dec 2012 21:51:14 GMT</pubDate></item><item><title><![CDATA[Reply to In einer Matrix gleiche Elemente finden on Tue, 18 Dec 2012 22:44:23 GMT]]></title><description><![CDATA[<p>danke, war alles falsch bei mir vorhin...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2281354</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2281354</guid><dc:creator><![CDATA[Namal]]></dc:creator><pubDate>Tue, 18 Dec 2012 22:44:23 GMT</pubDate></item></channel></rss>