<?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[Programmieren lernen ist so trocken... Mögliche Learning by Doing tipps?]]></title><description><![CDATA[<p>Hallo. Vor gut einem halben Jahr holte ich mir einen dicken C++ Wälzer. Ich hab ihn bis zur hälfte gelernt und es wurde mir schnell zu langweilig. Jetzt, nach einem halben Jahr, habe ich mir C++ für Spieleprogrammierer geholt und es fängt irgendwie an mich zu langweilen... Ich glaub nicht, dass das am Buch liegt, sondern eher, das ich nicht alles erlesen will. Das langweilt mich total. Gibt es irgendwelche Möglichkeiten für Anfänger sich dieses Wissen per Learning by Doing anzueignen? Ich stelle mir z.b. open source quellcode von simplen Spielen dabei vor. Z.b. Spiele wie Mario (2D) <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="🙄"
    /> . Halt irgendwas, wo man sich das anschauen kann und einen Überblick bekommen kann und wo man vllt. sogar schon mit magerem Wissen oder mit logischem Denken und Erfassen sachen im quellcode verändern kann, die dann schon das Spiel verändern.</p>
<p>Ich rede hier von Spielen. Es dürfen natürlich auch Programme sein, allerdings nicht diese Beispielquellcodes.</p>
<p>Was haltet ihr von meiner Idee? Habt ihr opensource quelltexte für mich?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/153986/programmieren-lernen-ist-so-trocken-mögliche-learning-by-doing-tipps</link><generator>RSS for Node</generator><lastBuildDate>Mon, 07 Sep 2026 23:30:22 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/153986.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 23 Jul 2006 09:49:39 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Programmieren lernen ist so trocken... Mögliche Learning by Doing tipps? on Sun, 23 Jul 2006 09:49:39 GMT]]></title><description><![CDATA[<p>Hallo. Vor gut einem halben Jahr holte ich mir einen dicken C++ Wälzer. Ich hab ihn bis zur hälfte gelernt und es wurde mir schnell zu langweilig. Jetzt, nach einem halben Jahr, habe ich mir C++ für Spieleprogrammierer geholt und es fängt irgendwie an mich zu langweilen... Ich glaub nicht, dass das am Buch liegt, sondern eher, das ich nicht alles erlesen will. Das langweilt mich total. Gibt es irgendwelche Möglichkeiten für Anfänger sich dieses Wissen per Learning by Doing anzueignen? Ich stelle mir z.b. open source quellcode von simplen Spielen dabei vor. Z.b. Spiele wie Mario (2D) <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="🙄"
    /> . Halt irgendwas, wo man sich das anschauen kann und einen Überblick bekommen kann und wo man vllt. sogar schon mit magerem Wissen oder mit logischem Denken und Erfassen sachen im quellcode verändern kann, die dann schon das Spiel verändern.</p>
<p>Ich rede hier von Spielen. Es dürfen natürlich auch Programme sein, allerdings nicht diese Beispielquellcodes.</p>
<p>Was haltet ihr von meiner Idee? Habt ihr opensource quelltexte für mich?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1102467</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1102467</guid><dc:creator><![CDATA[C++-Anfänger]]></dc:creator><pubDate>Sun, 23 Jul 2006 09:49:39 GMT</pubDate></item><item><title><![CDATA[Reply to Programmieren lernen ist so trocken... Mögliche Learning by Doing tipps? on Sun, 23 Jul 2006 09:52:51 GMT]]></title><description><![CDATA[<p>C++-Anfänger schrieb:</p>
<blockquote>
<p>Ich rede hier von Spielen. Es dürfen natürlich auch Programme sein, allerdings nicht diese Beispielquellcodes.</p>
<p>Was haltet ihr von meiner Idee? Habt ihr opensource quelltexte für mich?</p>
</blockquote>
<p>am besten selber ein spiel machen.<br />
ganz basismäßig reichen dafür unter windows die improved konsole aus dem dos/win32 konsolenfaq. dazu eine gute idee und anfangen. vor allem übers design nachdenken.</p>
<p>unter linux wäre die ncurses oder eine zusatzlib (unter windows natürlich auch, siehe faq spieleprogrammierung) nützlich.</p>
<p>das selber machen schult am meisten.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1102468</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1102468</guid><dc:creator><![CDATA[elise]]></dc:creator><pubDate>Sun, 23 Jul 2006 09:52:51 GMT</pubDate></item><item><title><![CDATA[Reply to Programmieren lernen ist so trocken... Mögliche Learning by Doing tipps? on Sun, 23 Jul 2006 10:03:27 GMT]]></title><description><![CDATA[<p>Ich habe bisher lediglich im Konsolenfenster meines Microsoft Visual C++´es rumoperiert und habe gerade mal variablen, operatoren, if, else, else if, cout, cin , switch und case und for-schleifen gelernt.</p>
<p>Wie soll ich daraus ein Spiel basteln? bzw. Wie kann ich denn das für Dos machen... Wie meinst du das?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1102472</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1102472</guid><dc:creator><![CDATA[C++-Anfänger]]></dc:creator><pubDate>Sun, 23 Jul 2006 10:03:27 GMT</pubDate></item><item><title><![CDATA[Reply to Programmieren lernen ist so trocken... Mögliche Learning by Doing tipps? on Sun, 23 Jul 2006 10:16:16 GMT]]></title><description><![CDATA[<p>man schaue ins dos/win32konsolenfaq und in schnüffele mal ein wenig im dos/win32 konsolenunterforum.</p>
<p>ist genau der richtige moment, damit anzufangen <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/1102478</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1102478</guid><dc:creator><![CDATA[elise]]></dc:creator><pubDate>Sun, 23 Jul 2006 10:16:16 GMT</pubDate></item><item><title><![CDATA[Reply to Programmieren lernen ist so trocken... Mögliche Learning by Doing tipps? on Sun, 23 Jul 2006 10:23:12 GMT]]></title><description><![CDATA[<p>Ach ich steig durch das ganze nicht durch. Ich zieh mich wieder in mein Buch zurück und mach kein Murks.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1102480</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1102480</guid><dc:creator><![CDATA[C++-Anfänger]]></dc:creator><pubDate>Sun, 23 Jul 2006 10:23:12 GMT</pubDate></item><item><title><![CDATA[Reply to Programmieren lernen ist so trocken... Mögliche Learning by Doing tipps? on Sun, 23 Jul 2006 10:31:58 GMT]]></title><description><![CDATA[<p>hier gibts unten einen link zu einem code<br />
<a href="http://de.wikipedia.org/wiki/Call_To_Power_II" rel="nofollow">http://de.wikipedia.org/wiki/Call_To_Power_II</a></p>
<p>kannst ja mal reinriechen <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/1102483</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1102483</guid><dc:creator><![CDATA[elise]]></dc:creator><pubDate>Sun, 23 Jul 2006 10:31:58 GMT</pubDate></item><item><title><![CDATA[Reply to Programmieren lernen ist so trocken... Mögliche Learning by Doing tipps? on Sun, 23 Jul 2006 10:38:24 GMT]]></title><description><![CDATA[<p>Ich hab mir das ganze total anders vorgestellt.<br />
Ich dachte, ich könnte irgendeine quelltext datei bekommen, wo ich reinschnüffeln kann und die ich so kompilen könnte und dann die exe starten und dann hab ich ein, wenn auch simples und langweiliges, spiel vor mir. Das hätte ich wirklich super gefunden, denn das könnte ich sofort nachvollziehen und verändern. Gibts denn so was nicht? z.b. so eine Art Mario quelltext oder Commander Keen oder ähnliches.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1102485</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1102485</guid><dc:creator><![CDATA[C++-Anfänger]]></dc:creator><pubDate>Sun, 23 Jul 2006 10:38:24 GMT</pubDate></item><item><title><![CDATA[Reply to Programmieren lernen ist so trocken... Mögliche Learning by Doing tipps? on Sun, 23 Jul 2006 10:38:50 GMT]]></title><description><![CDATA[<p>Wie kommst Du denn darauf, dass so ein Spiel wie Super-Mario in 2D leicht zu programmieren ist? Auf jeden Fall brauchst Du dafür auch erst mal jede Menge Kenntnisse der Grafikschnittstelle und dafür kaufst Du Dir am besten gleich noch ein Buch, dass Dich mit theoretischem Wissen langweilen wird.</p>
<p>Versuchs doch erstmal mit einer Art Galgenmännchen oder Minesweeper für Konsolen, dass kann man dann tatsächlich mit ein bisschen Nachdenken lösen. :p</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1102486</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1102486</guid><dc:creator><![CDATA[Turing]]></dc:creator><pubDate>Sun, 23 Jul 2006 10:38:50 GMT</pubDate></item><item><title><![CDATA[Reply to Programmieren lernen ist so trocken... Mögliche Learning by Doing tipps? on Sun, 23 Jul 2006 10:54:08 GMT]]></title><description><![CDATA[<p>Hallo,<br />
ich glaube, die <a href="http://nehe.gamedev.net/" rel="nofollow">NeHe-Tutorials</a> wären etwas für Dich. Bei den einzelnen Tutorials ist auch immer Quelltext dabei. Es gibt sogar eine <a href="http://www.joachimrohde.com/cms/xoops/modules/articles/index.php?cat_id=1" rel="nofollow">deutsche Übersetzung</a>.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1102490</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1102490</guid><dc:creator><![CDATA[tipp]]></dc:creator><pubDate>Sun, 23 Jul 2006 10:54:08 GMT</pubDate></item><item><title><![CDATA[Reply to Programmieren lernen ist so trocken... Mögliche Learning by Doing tipps? on Sun, 23 Jul 2006 10:54:58 GMT]]></title><description><![CDATA[<p>Turing schrieb:</p>
<blockquote>
<p>Versuchs doch erstmal mit einer Art Galgenmännchen oder Minesweeper für Konsolen, dass kann man dann tatsächlich mit ein bisschen Nachdenken lösen. :p</p>
</blockquote>
<p>das würde mir total genügen. Nur wie? - bzw - Wie mache ich ein Spiel für Konsolen? und wie mache ich denn eine Oberfläche mit Buttons?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1102491</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1102491</guid><dc:creator><![CDATA[C++-Anfänger]]></dc:creator><pubDate>Sun, 23 Jul 2006 10:54:58 GMT</pubDate></item><item><title><![CDATA[Reply to Programmieren lernen ist so trocken... Mögliche Learning by Doing tipps? on Sun, 23 Jul 2006 11:06:23 GMT]]></title><description><![CDATA[<p>C++-Anfänger schrieb:</p>
<blockquote>
<p>das würde mir total genügen. Nur wie? - bzw - Wie mache ich ein Spiel für Konsolen? und wie mache ich denn eine Oberfläche mit Buttons?</p>
</blockquote>
<p>wobei wir wieder am anfang der runde wären: schau endlich ins dos/win32 konsolenfaq. und danach frag dort weiter <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/1102497</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1102497</guid><dc:creator><![CDATA[elise]]></dc:creator><pubDate>Sun, 23 Jul 2006 11:06:23 GMT</pubDate></item><item><title><![CDATA[Reply to Programmieren lernen ist so trocken... Mögliche Learning by Doing tipps? on Sun, 23 Jul 2006 11:08:24 GMT]]></title><description><![CDATA[<p>C++-Anfänger schrieb:</p>
<blockquote>
<p>Wie mache ich ein Spiel für Konsolen?</p>
</blockquote>
<p>Na, einfach programmieren. Z.B. so:</p>
<pre><code class="language-cpp">#include &lt;iostream&gt;
#include &lt;ctime&gt;

int main()
{
    srand(time(0));
    int zahl = rand() % 101;
    std::cout &lt;&lt; &quot;Gebe eine Zahl zwischen 0 und 100 ein!&quot;;
    int rate;
    do
    {
        std::cout &lt;&lt; std::endl;
        std::cin &gt;&gt; rate;
        if(zahl &lt; rate)
        {
            std::cout &lt;&lt; &quot;Die gesuchte Zahl ist kleiner!&quot;;
        }
        if(zahl &gt; rate)
        {
            std::cout &lt;&lt; &quot;Die gesuchte Zahl ist größer!&quot;;
        }
    }
    while (zahl != rate);
    std::cout &lt;&lt; &quot;Du hast gewonnen!&quot;;
    return 0;
}
</code></pre>
<p>Lässt sich dann z.B. um eine Begrenzung der Versuche ergänzen.</p>
<p>mfg.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1102498</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1102498</guid><dc:creator><![CDATA[asdfghjklöä]]></dc:creator><pubDate>Sun, 23 Jul 2006 11:08:24 GMT</pubDate></item><item><title><![CDATA[Reply to Programmieren lernen ist so trocken... Mögliche Learning by Doing tipps? on Sun, 23 Jul 2006 12:27:33 GMT]]></title><description><![CDATA[<p>Hmm - das gepostete Programm ist zwar ganz lustig (naja^^) aber ich dachte da schon an eher größere Spiele, wie eben z.b. etwas mit einer hintergrund fläche und nicht mit diesem nervigen Schwarzen Hintergrund...^^ Wo ist denn das was du meinst elsi? Ich find das nicht. Und wenn ich es doch richtig verstanden habe, dann versteh ich nicht was ich in dem Forum soll...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1102508</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1102508</guid><dc:creator><![CDATA[C++-Anfänger]]></dc:creator><pubDate>Sun, 23 Jul 2006 12:27:33 GMT</pubDate></item><item><title><![CDATA[Reply to Programmieren lernen ist so trocken... Mögliche Learning by Doing tipps? on Sun, 23 Jul 2006 12:30:37 GMT]]></title><description><![CDATA[<p>Gibt hier leider kein Edit als unregestrierter...</p>
<p>Ich würde gerne ne spielfigur haben (darf auch ein quadrat sein) und ein level (darf auch aus 2 quadraten bestehen, dem boden und dem hintergrun).</p>
<p>Oder ist das zu kompliziert?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1102510</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1102510</guid><dc:creator><![CDATA[C++-Anfänger]]></dc:creator><pubDate>Sun, 23 Jul 2006 12:30:37 GMT</pubDate></item><item><title><![CDATA[Reply to Programmieren lernen ist so trocken... Mögliche Learning by Doing tipps? on Sun, 23 Jul 2006 12:33:30 GMT]]></title><description><![CDATA[<p>Hallo</p>
<p>zum Thema GUI lies erstmal <a href="http://www.c-plusplus.net/forum/viewtopic-var-t-is-151578-and-start-is-0.html" rel="nofollow">hier</a> die Antwort auf die erste Frage (und die andern auch gleich am besten)</p>
<p>Elise meint natürlich <a href="http://www.c-plusplus.net/forum/viewforum-var-f-is-13.html" rel="nofollow">dieses Forum</a>. Dort erfährst du wie du in der Konsole Farben und Positionen setzt, um deine Ausgabe zu gestalten. Insbesondere sollst du dir <a href="http://www.c-plusplus.net/forum/viewtopic-var-t-is-131915.html" rel="nofollow">diesen Thread</a> anschauen.</p>
<p>bis bald<br />
akari</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1102513</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1102513</guid><dc:creator><![CDATA[akari]]></dc:creator><pubDate>Sun, 23 Jul 2006 12:33:30 GMT</pubDate></item><item><title><![CDATA[Reply to Programmieren lernen ist so trocken... Mögliche Learning by Doing tipps? on Sun, 23 Jul 2006 13:18:52 GMT]]></title><description><![CDATA[<p>Du stellst interessante Anforderungen. Beginne mit TicTacToe. Das ist noch überschaubar. In der Konsole kannst Du das mit der IDE <strong>Dev-C++</strong> laufen lassen. Vergiss bloß nicht, <strong>libconio.a</strong> dazu zu linken!<br />
Es gibt auch ein TicTacToe von Jeff Prosise in Kap. 3 seines Buchs über die MFC, falls Du MSVC++ incl. MFC zur Verfügung hast.</p>
<pre><code class="language-cpp">/*
*   Program: Tic-Tac-Toe
*   Author:  Joshua Dean Thompson
*   Last Update: June 30, 2000
*   Language: C
*   Compiler: DJGPP
*   File: t3.c 
*   Description: main source file
*/

/*
  angepasst an Dev-C++ von Dr. Erhard Henkes
*/

#include &lt;conio2.h&gt; //Linken mit libconio.a nicht vergessen!
#include &lt;cstdlib&gt;
#include &lt;ctime&gt;
using namespace std;

/* Global Data */

static char Board[3][3] = { { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }  };	
static char Icons[3] = { ' ', 'X', 'O' };

/* Function Prototypes */

int wanna_play( void );
void init_board( void );
void init_screen( void );
void update_board( void );
int check_if_winner();
void get_player_move( int player );
void get_computer_move( int player );
void play_game( int gametype );
void print_credits( void );
int main( void );

int main()
{
     int gametype, ans;

	if( ( gametype = wanna_play() ) != 0 )
	{
        	do
	     {
		     init_board();
     		init_screen(); 

               play_game( gametype );

		     gotoxy( 3, 24 );
     		cputs( &quot;Do you wish to play again? y/n:  &quot; );
	     	do
	          {
			     ans = getch();
     			if( ans == 'y' || ans == 'n' )
	     			break;
     		} while(1);

	     	gotoxy( 3, 24 );
		     cputs( &quot;                                          &quot; );

     	} while( ans == 'y' );
	}

	print_credits();
    	return 0;
}

/* Tell user about game and see if they want to play */
int wanna_play( void )
{
	int ans;

	clrscr();
	cputs( &quot;+-----------------------------------------------------------------------------+\r\n&quot; );
     cputs( &quot;|                                   WELCOME                                   |\r\n&quot; );
     cputs( &quot;+-----------------------------------------------------------------------------+\r\n\r\n&quot; );
	cputs( &quot;    Welcome to the classic game of Tic-Tac-Toe. This simple\r\n&quot;);
	cputs( &quot;game is played on a 3 x 3 grid. Each player takes a choice of\r\n&quot;);
	cputs( &quot;either X or O, then using only wit, try to creat a simple line\r\n&quot;);
	cputs( &quot;of 3 of their respective symbol.  Whoever does so first, wins.\r\n\r\n&quot;);
	cputs( &quot;    If all the squares are filled, but no lines created, a draw\r\n&quot;);
	cputs( &quot;is the result. The game switches between who goes first, X or O.\r\n\r\n&quot;);
	cputs( &quot;What kind of game do you wish to play?\r\n&quot;);
     cputs( &quot;(0) None - just quit\r\n&quot;);
     cputs( &quot;(1) Player vs Player - Play against another human\r\n&quot; );
     cputs( &quot;(2) Player vs Computer - Play against a beatable computer\r\n\r\n&quot; );
     cputs( &quot;Enter Choice:&quot; );

	do
     {
		ans = getch();
		switch( ans )
          {
               case '0': return 0;
               case '1': return 1;
               case '2': return 2;
          }

	} while(1);
}

/* Initialize Board to Default Values */
void init_board( void )
{	
     int i, j;

	for( i = 0; i &lt; 3; i++ )
		for( j = 0; j &lt; 3; j++ )
			Board[i][j] = 0;
}

/* Set up Screen to show Game Board */
void init_screen( void )
{
	clrscr();
     cputs( &quot;+-----------------------------------------------------------------------------+\r\n&quot; );
     cputs( &quot;|                                 TIC-TAC-TOE                                 |\r\n&quot; );
     cputs( &quot;+-----------------------------------------------------------------------------+\r\n\r\n&quot; );
	cputs( &quot;                                 C O L U M N S\r\n&quot; ); 
     cputs( &quot;                                [1]   [2]   [3]\r\n&quot; );
	cputs( &quot;                              +-----+-----+-----+\r\n&quot; );
     cputs( &quot;                              |     |     |     |\r\n&quot; );
     cputs( &quot;                           [1]|     |     |     |\r\n&quot; );
     cputs( &quot;                         R    |     |     |     |\r\n&quot; );
     cputs( &quot;                              +-----+-----+-----+\r\n&quot; );
     cputs( &quot;                         O    |     |     |     |\r\n&quot; );
     cputs( &quot;                           [2]|     |     |     |\r\n&quot; );
     cputs( &quot;                         W    |     |     |     |\r\n&quot; );
     cputs( &quot;                              +-----+-----+-----+\r\n&quot; );
     cputs( &quot;                         S    |     |     |     |\r\n&quot; );
     cputs( &quot;                           [3]|     |     |     |\r\n&quot; );
     cputs( &quot;                              |     |     |     |\r\n&quot; );
     cputs( &quot;                              +-----+-----+-----+\r\n\r\n&quot; );
     cputs( &quot;+-----------------------------------------------------------------------------+\r\n&quot; );
     cputs( &quot;|                                                                             |\r\n&quot; );
     cputs( &quot;|                                                                             |\r\n&quot; );
     cputs( &quot;|                                                                             |\r\n&quot; );
     cputs( &quot;+-----------------------------------------------------------------------------+&quot; );
}

/* Update the screen with the current Board */
void update_board( void )
{
	gotoxy( 34, 9 );
     putch( Board[0][0] );
     gotoxy( 40, 9 );
     putch( Board[0][1] );
     gotoxy( 46, 9 );
     putch( Board[0][2] );

     gotoxy( 34, 13 );
     putch( Board[1][0] );
     gotoxy( 40, 13 );
     putch( Board[1][1] );
     gotoxy( 46, 13 );
     putch( Board[1][2] );

     gotoxy( 34, 17 );
     putch( Board[2][0] );
     gotoxy( 40, 17 );
     putch( Board[2][1] );
     gotoxy( 46, 17 );
     putch( Board[2][2] );

     gotoxy( 3, 23 );
}

/* Check if any player has completed a line */
int check_if_winner()
{
     int i, k, j;
	for( i = 1; i &lt; 3; i++ )
     {
     	for( k = 0; k &lt; 3; k++ )
	    		if( Board[k][0] == Icons[i] &amp;&amp; Board[k][1] == Icons[i] &amp;&amp; Board[k][2] == Icons[i] )
             		return i;

          for( j = 0; j &lt; 3; j++ )
	    		if( Board[0][j] == Icons[i] &amp;&amp; Board[1][j] == Icons[i] &amp;&amp; Board[2][j] == Icons[i] )
             		return i;

          if( Board[0][0] == Icons[i] &amp;&amp; Board[1][1] == Icons[i] &amp;&amp; Board[2][2] == Icons[i] )
				return i;

          if( Board[0][2] == Icons[i] &amp;&amp; Board[1][1] == Icons[i] &amp;&amp; Board[2][0] == Icons[i] )
				return i;
     }

     return 0;
}

/* Get a user's move */
void get_player_move( int player )
{
     int row, column;

     do
	{
		gotoxy( 3, 23 );
		cprintf( &quot;Player[%i]: Enter Row Number: &quot;, player );
    		do {  row = getch(); } while( row &lt; '0' || row &gt; '4' ); 
    		gotoxy( 3, 23 );

	     cprintf( &quot;Player[%i]: Enter Column Number: &quot;, player );
 		do {  column = getch(); } while( column &lt; '0' || column &gt; '4' );
     	gotoxy( 3, 23 );

	     cputs( &quot;                                   &quot; );

	} while( Board[ row - 0x31 ][ column - 0x31 ] != 0 );

     Board[ row - 0x31 ][ column - 0x31 ] = Icons[player]; 
}

/* Get the computer's move */
void get_computer_move( int player )
{
     int row, column;
     srand(unsigned(time(0)));
     do
     {
          row = rand() % 3;
          column = rand() % 3;
     } while( Board[ row ][ column ] != 0 );

     Board[ row ][ column ] = Icons[player]; 
}

/* Play the game */
void play_game( int gametype )
{
     int i = 0, player = 1;

	while( i &lt; 9 )
	{
          get_player_move(player);
         	update_board();

		if( player == 1 )
			player = 2;
		else
			player = 1;		

		gotoxy( 3, 23 );
          i++;

	     if( check_if_winner() == 1 )
		{
		     cputs ( &quot;Player 1 (X) Wins!                        &quot; );
			return;
          }
          else if( check_if_winner() == 2 )
          {
                cputs ( &quot;Player 2 (0) Wins!                        &quot; );
     		 return;
          }

          if( gametype == 2 )
          {
               get_computer_move( player );

               i++;
               update_board();
               if( player == 1 )
     			player = 2;
	     	else
		     	player = 1;

               if( check_if_winner() == 1 )
     		{
	     	     cputs ( &quot;Player 1 (X) Wins!                        &quot; );
		     	return;
               }
               else if( check_if_winner() == 2 )
               {
                     cputs ( &quot;Player 2 (0) Wins!                        &quot; );
          		 return;
               }
          }	     
     }
}

/* Print the game credits */
void print_credits( void )
{
     clrscr();
     cputs( &quot;+-----------------------------------------------------------------------------+\r\n&quot; );
     cputs( &quot;|                                    CREDITS                                  |\r\n&quot; );
     cputs( &quot;+-----------------------------------------------------------------------------+\r\n\r\n&quot; );
     cputs( &quot;Author: Joshua Dean Thompson\r\n&quot; );
     cputs( &quot;Inspiration: SHARIQ HASEEB's Tic-Tac-Toe\r\n\r\n&quot; );
     cputs( &quot;For original game and code by Shariq Haseeb goto:\r\n&quot; );
     cputs( &quot;www.planet-source-code.com\r\n\r\n&quot;);
     cputs( &quot;Thank you for using this program, hope you had fun.\r\n&quot; );
     cputs( &quot;Send comments, questions, etc to: fd72@msn.com\r\n&quot; );
}
</code></pre>
<p>Wenn Dir das auch noch zu poplig ist, musst Du zur Spieleprogrammierung wechseln. Da gibt es z.B. Ultris von U.Kaiser mit entsprechendem Buch: <a href="http://www.fh-info.de/Spiele/Ultris/ultris.html" rel="nofollow">http://www.fh-info.de/Spiele/Ultris/ultris.html</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1102527</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1102527</guid><dc:creator><![CDATA[Erhard Henkes]]></dc:creator><pubDate>Sun, 23 Jul 2006 13:18:52 GMT</pubDate></item><item><title><![CDATA[Reply to Programmieren lernen ist so trocken... Mögliche Learning by Doing tipps? on Sun, 23 Jul 2006 13:27:19 GMT]]></title><description><![CDATA[<p>Thx.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1102536</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1102536</guid><dc:creator><![CDATA[C++-Anfänger]]></dc:creator><pubDate>Sun, 23 Jul 2006 13:27:19 GMT</pubDate></item><item><title><![CDATA[Reply to Programmieren lernen ist so trocken... Mögliche Learning by Doing tipps? on Sun, 23 Jul 2006 13:35:38 GMT]]></title><description><![CDATA[<p>Pls.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1102538</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1102538</guid><dc:creator><![CDATA[Erhard Henkes]]></dc:creator><pubDate>Sun, 23 Jul 2006 13:35:38 GMT</pubDate></item><item><title><![CDATA[Reply to Programmieren lernen ist so trocken... Mögliche Learning by Doing tipps? on Sun, 23 Jul 2006 18:40:46 GMT]]></title><description><![CDATA[<p>such doch einfach mal bei Google nach Open Source und Quelltexten und so.</p>
<p>Hier &quot;Das Abenteuerspiel&quot; <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="🙂"
    /> bin ich gerade drauf gestoßen.</p>
<p><a href="http://www.geocities.com/SiliconValley/Pines/6622/" rel="nofollow">http://www.geocities.com/SiliconValley/Pines/6622/</a></p>
<p>vielleicht hilft es dir ja auch weiter.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1102747</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1102747</guid><dc:creator><![CDATA[nki]]></dc:creator><pubDate>Sun, 23 Jul 2006 18:40:46 GMT</pubDate></item><item><title><![CDATA[Reply to Programmieren lernen ist so trocken... Mögliche Learning by Doing tipps? on Sun, 23 Jul 2006 19:13:53 GMT]]></title><description><![CDATA[<p>Für Minesweeper brauchst du keine buttons du fragst einfach zwei Zahlen ab die die Koordinaten darstellen...dabei musst du dir immer den grundgedanken vorhalten dass ein Character einen &quot;pixel&quot; oder ein bild auf dem spielfeld darstellt...<br />
z.B.:</p>
<pre><code class="language-cpp">123456789
1#########            &quot;M&quot;.......Mine
2#       #            &quot;x&quot;.......Fragliches Feld
3# M     #            &quot; &quot;.......keine Mine
4#       #
5#    x  #
6#       #
7#########
</code></pre>
<p>Geben Sie die X-Koordinate des nächsten Feldes ein:<br />
cin&gt;&gt;x<br />
und dann das gleiche für y...und schon gehts...</p>
<p>Auf diese weise kannst du dir auch Dungeons bauen und stellst die Spielfigur als ein &quot;T&quot; oder &quot;S&quot; oder dgl. dar....</p>
<p>Selbst wenn du Quellcode für Mario oder ähnliches bekommst und dir den ansiehst wirst du nichts damit anfangen können wenn du die ganzen Funktionen nicht kennst....</p>
<p>Schnapp dir am Besten ein Buch und klopf alle Beispiele in den Rechner rein...<br />
eben &quot;Learning by Doing&quot;</p>
<p>MfG Kuldren</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1102759</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1102759</guid><dc:creator><![CDATA[Kuldren]]></dc:creator><pubDate>Sun, 23 Jul 2006 19:13:53 GMT</pubDate></item><item><title><![CDATA[Reply to Programmieren lernen ist so trocken... Mögliche Learning by Doing tipps? on Wed, 26 Jul 2006 07:08:11 GMT]]></title><description><![CDATA[<p>Hi C++-Anfänger,</p>
<p>hab keine Angst vor dem Programmieren!<br />
Quelltext ansehen und verstehen ist eine sehr gute Möglichkeit Programmieren zu verstehen und zu erlernen, aber irgendwann mußt auch mal selber Hand anlegen.</p>
<p>Ich selber habe meine ersten Schritte in C++ unternommen, in dem ich das Spiel Tetris auf die DOS-Konole gebracht habe. Alles ausschließlich mit Schleifen, if-Abfragen und ein paar Arrays und statt Grafik für die Klötzchen, habe ich Zeichen genommen (beispielsweise das &quot;*&quot;)</p>
<p>Um die Koordinaten auf der DOS-Ebene anzusprechen, hat mir die freie Headerdatei &quot;coniox&quot; geholfen - mußt mal googeln, weiß nicht mehr, wo ich die her hatte.</p>
<p>Wenn Du immer die ersten Seiten Deiner langweiligen Bücher gelesen hast, dann müßtest Du sowas eigentlich hinbekommen. Und wenns beim ersten Mal nicht funzt - Du machst es für Dich, also setz Dich nicht zu sehr unter Druck.</p>
<p>Nur: Anfangen mußt irgendwann mal.<br />
Wobei die genannten Spiele &quot;TicTacTo&quot;, etc. ebenfalls gute Übungen sind.</p>
<p>Wenn Du allerdings SuperMario programmieren willst, solltest Du unbedingt zunächst bei TicTacTo sicher sein <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>Gruß<br />
Arlecchino</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1104299</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1104299</guid><dc:creator><![CDATA[Arlecchino]]></dc:creator><pubDate>Wed, 26 Jul 2006 07:08:11 GMT</pubDate></item><item><title><![CDATA[Reply to Programmieren lernen ist so trocken... Mögliche Learning by Doing tipps? on Wed, 26 Jul 2006 10:03:43 GMT]]></title><description><![CDATA[<p>Will ich auch noch was simples dazu sagen:<br />
Such dir ein anderes Buch! ^^</p>
<p>Ich hatte auch schon mal so ein Buch gekauft, da wurde einfach nur Trocken runtergeplappert, da lernt man meiner Meinung nach gar nix. Das ist einfach nur tot langweilig. Aber es gibt ja soooo viele Bücher zu C++ und Co. Ich habe zum Beispiel C++ mit &quot;Visual C++ 6 Schritt für Schritt&quot; von Chuck Sphar von der Microsoft Press (natürlich übersetzt ^^) gelernt. Da programmiert man Schritt für Schritt eine Art von Paint. Mit jedem Kapitel kommt eigentlich fast immer etwas neuen Code hinzu. Gibt aber auch andere Bücher die sowas haben, musst halt nur ein wenig suchen, dir Informationen zu den Bücher holen, oder sie halt nicht nur im Inet anschauen, sondern im Buchladen <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>Grüssli</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1104433</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1104433</guid><dc:creator><![CDATA[Dravere]]></dc:creator><pubDate>Wed, 26 Jul 2006 10:03:43 GMT</pubDate></item></channel></rss>