<?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[hilfe bei fehlersuche und codeoptimierung]]></title><description><![CDATA[<p>hallo ich hab folgendes vor:<br />
es existiert ein 2D bool feld ( dynamisch erstellt )<br />
m1[][] und m2[][] ( m2 ist eine teemporäre kopie )</p>
<p>nun hab ich noch ein feld shift[] mit länge x (m1[x][y]) , also so lang wie<br />
m1[][] in x richtung.</p>
<p>Nun will ich das m1 feld um &quot;shift[x]&quot; positionen in y richtung rotieren und hab das so realisiert aber irgendwie will es nicht</p>
<p>for(int x=0;x&lt;Width;x++)<br />
for(int y=0;y&lt;Height;y++)<br />
{<br />
int temp = y-shift[x]; // index berechnen<br />
if(temp&lt;0)m1[x][y] = m2[x][Height+temp-1]; // falls der index &lt; 0 wird<br />
else m1[x][y]=m2[x][temp]; // ansonsten wird der index genommen<br />
}<br />
for(int x=0;x&lt;Width;x++) // kopie aktualisieren<br />
for(int y=0;y&lt;Height;y++)<br />
m2[x][y]=m1[x][y];</p>
<p>Nochmal zu meinem vorhaben :</p>
<p>m[3][3] = 1,2,3<br />
2,3,4<br />
3,4,5</p>
<p>shift[3] = 1,2,3</p>
<p>als ergebnis will ich folgendes<br />
m[3][3] = 3,3,3<br />
1,4,4<br />
2,2,5</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/127364/hilfe-bei-fehlersuche-und-codeoptimierung</link><generator>RSS for Node</generator><lastBuildDate>Tue, 25 Aug 2026 02:15:47 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/127364.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 23 Nov 2005 15:56:25 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to hilfe bei fehlersuche und codeoptimierung on Wed, 23 Nov 2005 15:56:25 GMT]]></title><description><![CDATA[<p>hallo ich hab folgendes vor:<br />
es existiert ein 2D bool feld ( dynamisch erstellt )<br />
m1[][] und m2[][] ( m2 ist eine teemporäre kopie )</p>
<p>nun hab ich noch ein feld shift[] mit länge x (m1[x][y]) , also so lang wie<br />
m1[][] in x richtung.</p>
<p>Nun will ich das m1 feld um &quot;shift[x]&quot; positionen in y richtung rotieren und hab das so realisiert aber irgendwie will es nicht</p>
<p>for(int x=0;x&lt;Width;x++)<br />
for(int y=0;y&lt;Height;y++)<br />
{<br />
int temp = y-shift[x]; // index berechnen<br />
if(temp&lt;0)m1[x][y] = m2[x][Height+temp-1]; // falls der index &lt; 0 wird<br />
else m1[x][y]=m2[x][temp]; // ansonsten wird der index genommen<br />
}<br />
for(int x=0;x&lt;Width;x++) // kopie aktualisieren<br />
for(int y=0;y&lt;Height;y++)<br />
m2[x][y]=m1[x][y];</p>
<p>Nochmal zu meinem vorhaben :</p>
<p>m[3][3] = 1,2,3<br />
2,3,4<br />
3,4,5</p>
<p>shift[3] = 1,2,3</p>
<p>als ergebnis will ich folgendes<br />
m[3][3] = 3,3,3<br />
1,4,4<br />
2,2,5</p>
]]></description><link>https://www.c-plusplus.net/forum/post/925420</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/925420</guid><dc:creator><![CDATA[skoka]]></dc:creator><pubDate>Wed, 23 Nov 2005 15:56:25 GMT</pubDate></item><item><title><![CDATA[Reply to hilfe bei fehlersuche und codeoptimierung on Wed, 23 Nov 2005 15:59:58 GMT]]></title><description><![CDATA[<p>so ist ne bessere sicht</p>
<p>m[3][3] =</p>
<p>1,2,3<br />
2,3,4<br />
3,4,5</p>
<p>shift[3] = 1,2,3</p>
<p>als ergebnis will ich folgendes<br />
m[3][3] =</p>
<p>3,3,3<br />
1,4,4<br />
2,2,5</p>
]]></description><link>https://www.c-plusplus.net/forum/post/925423</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/925423</guid><dc:creator><![CDATA[skoka]]></dc:creator><pubDate>Wed, 23 Nov 2005 15:59:58 GMT</pubDate></item></channel></rss>