<?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[Hangman brauche dringend hilfe]]></title><description><![CDATA[<p>Hallo,<br />
liebe Forum mitglieder, ich bin neu hier und brauche dringend euren rat.<br />
Wir sollten ein Hang man Programmieren was uns auch gelungen ist nun möchte der Lehrer aber das wir mit Funktionen einbauen, wovon ich sogut wie nichts weis.<br />
Ich möchte nicht das ihr für mich die komplette Aufgabe macht, es wäre nur nett ein paar Tipps und Hilfen zu bekommen. <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="🙂"
    /> <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>
<p>#include &lt;iostream&gt;<br />
#include &lt;conio&gt;<br />
using namespace std;</p>
<p>//---------------------------------------------------------------------------</p>
<p>char spieler_eins[30],spieler_zwei[30],wort[20],buchstabe,raten[20],fehl_buch[7],nochmal;<br />
int suchlauf,fehler,definiert,anz_buch,richtig,edurch,nv;<br />
int main(int argc, char* argv[])<br />
{<br />
cout&lt;&lt;&quot;Hangman (C) 2007 by 6players&quot;&lt;&lt;endl&lt;&lt;endl;<br />
cout&lt;&lt;&quot;Spieler eins bitte geben Sie Ihren Namen ein:&quot;;<br />
cin&gt;&gt;spieler_eins;<br />
cout&lt;&lt;&quot;Spieler zwei bitte geben Sie Ihren Namen ein:&quot;;<br />
cin&gt;&gt;spieler_zwei;</p>
<p>cout&lt;&lt;endl&lt;&lt;&quot;&quot;&lt;&lt;spieler_eins&lt;&lt;&quot; bitte das zu erratene Wort eingeben (Maximal 20 Zeichen).&quot;&lt;&lt;endl;<br />
cin&gt;&gt;wort; //Eingabe des Wortes, das von Spieler2 erraten werden soll</p>
<p>//Beginn der Umwandlung des Wortes in Unterstriche und Festlegung der Anzahl der Buchstaben<br />
for(int i=0;i&lt;=20;i=i+1)<br />
{<br />
if(wort[i]==0) //Wenn das Ende des Arrays &quot;wort&quot; erreicht wurde<br />
{<br />
anz_buch=i; //Festlegung aller Vorhandenen Buchstaben,<br />
//damit später überprüft werden kann ob Spieler2 gewinnt<br />
i=20;<br />
}<br />
else //Wenn das Array &quot;wort&quot; noch Zeichen enthält<br />
{<br />
if(raten[i]==0) //Verzweigung zum speichern der Unterstriche<br />
// für alle vorhandenen Buchstaben<br />
{<br />
raten[i]='_';<br />
}<br />
}<br />
} //Ende Umwandlung</p>
<p>for(int i=0;i&lt;=30;i=i+1) //Beginn Hauptprozess<br />
{<br />
clrscr(); //Alle sichtbaren Elemente werden gelöscht<br />
suchlauf=0; //Suchlauf wird auf 0 gesetzt</p>
<p>cout&lt;&lt;&quot;&quot;&lt;&lt;spieler_zwei&lt;&lt;&quot; muss das Wort erraten!&quot;&lt;&lt;endl&lt;&lt;endl;</p>
<p>for(int ausgabe=0;ausgabe&lt;=20;ausgabe=ausgabe+1) //for-Schleife zum Ausgeben der bisher<br />
//erratenen Buchstaben und der Unterstriche als Platzhalter<br />
{<br />
cout&lt;&lt;&quot;&quot;&lt;&lt;raten[ausgabe]&lt;&lt;&quot; &quot;;<br />
}</p>
<p>cout&lt;&lt;endl&lt;&lt;endl;</p>
<p>//Ausgaben der entsprechenden Hangmans:<br />
if(fehler==1)<br />
{<br />
cout&lt;&lt;&quot;------------|&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;| /&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;|/&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;|&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;|&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;|&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;|&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;|&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;|&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;|&quot;&lt;&lt;endl;</p>
<p>}<br />
if(fehler==2)<br />
{<br />
cout&lt;&lt;&quot;------------&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;| / |&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;|/ ---&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;| |. .|&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;| | * |&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;| | v |&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;| ---&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;|&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;|&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;|&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;|&quot;&lt;&lt;endl;</p>
<p>}<br />
if(fehler==3)<br />
{</p>
<p>cout&lt;&lt;&quot;------------&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;| / |&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;|/ ---&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;| |. .|&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;| | * |&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;| | v |&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;| ---&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;| |&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;| |&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;| |&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;| |&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;|&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;|&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;|&quot;&lt;&lt;endl;<br />
}<br />
if(fehler==4)<br />
{<br />
cout&lt;&lt;&quot; ------------&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;| / |&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;|/ ---&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;| |. .|&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;| | * |&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;| | v |&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;| ---&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;| |&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;| \---|&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;| |&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;| |&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;|&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;|&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;|&quot;&lt;&lt;endl;</p>
<p>}<br />
if(fehler==5)<br />
{<br />
cout&lt;&lt;&quot; ------------&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;| / |&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;|/ ---&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;| |. .|&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;| | * |&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;| | - |&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;| ---&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;| |&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;| \---|---/&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;| |&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;| |&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;|&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;|&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;|&quot;&lt;&lt;endl;<br />
}<br />
if(fehler==6)<br />
{<br />
cout&lt;&lt;&quot; ------------&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;| / |&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;|/ ---&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;| |. .|&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;| | * |&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;| | o | &quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;| ---&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;| |&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;| \---|---/&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;| |&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;| |&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;| / &quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;| / &quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;| / &quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;|&quot;&lt;&lt;endl;<br />
}<br />
if(fehler==7)<br />
{<br />
cout&lt;&lt;&quot; ------------&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;| / |&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;|/ ---&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;| |. .|&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;| | * |&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;| | o | Dying...&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;| ---&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;| |&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;| \---|---/&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;| |&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;| |&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;| / \&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;| / \&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;| / \&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;|&quot;&lt;&lt;endl;<br />
}<br />
if(fehler==8)<br />
{</p>
<p>cout&lt;&lt;&quot; ------------&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;| / |&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;|/ ---&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;| |x x|&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;| | * |&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;| | x | Dead!&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;| ---&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;| \&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;| \---|---/&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;| |&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;| |&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;| / \&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;| / \&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;| / \&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;|&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot; YOU LOOSE &quot;&lt;&lt;endl;</p>
<p>cout&lt;&lt;&quot;Schade &quot;&lt;&lt;spieler_zwei&lt;&lt;&quot;!&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;&quot;&lt;&lt;spieler_eins&lt;&lt;&quot; hat gewonnen!&quot;;<br />
getch();<br />
return 0; //Ende des Programms<br />
}</p>
<p>cout&lt;&lt;endl;</p>
<p>for(int fb=0;fb&lt;=8;fb=fb+1) //for-Schleife zur Ausgabe aller<br />
//falsch geratenen Buchstaben<br />
{<br />
cout&lt;&lt;&quot;&quot;&lt;&lt;fehl_buch[fb]&lt;&lt;&quot; &quot;;<br />
}</p>
<p>cout&lt;&lt;endl&lt;&lt;endl&lt;&lt;endl;</p>
<p>cin&gt;&gt;buchstabe;<br />
for(int a=0;a&lt;=19;a=a+1) //Überprüfungen nach Eingabe eines Buchstabens:<br />
{<br />
if(buchstabe==wort[a]) //wenn der erratene Buchstabe vorkommt:<br />
{<br />
if(buchstabe==raten[a]) //Fall: Schon verwendet<br />
{<br />
cout&lt;&lt;&quot;Buchstabe schon verwendet!&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;Bitte eine Taste druecken um einen anderen&quot;;<br />
cout&lt;&lt;&quot;Buchstaben einzugeben.&quot;;<br />
getch();<br />
}<br />
else //Falls noch nicht verwendet<br />
{<br />
raten[a]=buchstabe; //Unterstrich wird mit dem<br />
//entsprechenden Buchstaben überschrieben<br />
suchlauf=suchlauf-1; //Suchlauf wird -1 gerechnet,<br />
//damit die Verzweigung zur Aktualisierung der Fehler<br />
//nicht ausgeführt wird<br />
richtig=richtig+1; //Anzahl der richtig erratenen<br />
//Buchstaben wird +1 gerechnet<br />
}</p>
<p>if(richtig==anz_buch) //Hat Spieler2 gewonnen?<br />
{<br />
cout&lt;&lt;&quot;Herzlichen Glueckwunsch &quot;&lt;&lt;spieler_zwei&lt;&lt;&quot;!&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;Sie haben gewonnen!&quot;;<br />
getch();<br />
return 0;<br />
}<br />
}<br />
else //Kommt der geratene Buchstabe nicht vor?<br />
{<br />
suchlauf=suchlauf+1; //Suchlauf wird um 1 erhöht<br />
if(suchlauf==20) //Wenn 20 mal falsch geraten wurde<br />
{<br />
fehl_buch[a]=buchstabe; //der Buchstabe wird der Liste aller<br />
//falsch geratenen Buchstaben hinzugefügt<br />
fehler=fehler+1; //Anzahl der Fehler werden aktualisiert<br />
if(fehler==8) //Fehler=8? Falls ja, hat Spieler2 verloren<br />
{<br />
cout&lt;&lt;&quot;Schade &quot;&lt;&lt;spieler_zwei&lt;&lt;&quot;!&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;&quot;&lt;&lt;spieler_eins&lt;&lt;&quot; hat gewonnen!&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;Das Wort wäre &quot;&lt;&lt;wort&lt;&lt;&quot; gewesen!&quot;;<br />
}<br />
}<br />
}<br />
}<br />
} //Ende Hauptprozess<br />
return 0; //Programmende</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/185975/hangman-brauche-dringend-hilfe</link><generator>RSS for Node</generator><lastBuildDate>Sun, 16 Aug 2026 11:58:55 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/185975.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 03 Jul 2007 16:13:41 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Hangman brauche dringend hilfe on Tue, 03 Jul 2007 16:13:41 GMT]]></title><description><![CDATA[<p>Hallo,<br />
liebe Forum mitglieder, ich bin neu hier und brauche dringend euren rat.<br />
Wir sollten ein Hang man Programmieren was uns auch gelungen ist nun möchte der Lehrer aber das wir mit Funktionen einbauen, wovon ich sogut wie nichts weis.<br />
Ich möchte nicht das ihr für mich die komplette Aufgabe macht, es wäre nur nett ein paar Tipps und Hilfen zu bekommen. <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="🙂"
    /> <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>
<p>#include &lt;iostream&gt;<br />
#include &lt;conio&gt;<br />
using namespace std;</p>
<p>//---------------------------------------------------------------------------</p>
<p>char spieler_eins[30],spieler_zwei[30],wort[20],buchstabe,raten[20],fehl_buch[7],nochmal;<br />
int suchlauf,fehler,definiert,anz_buch,richtig,edurch,nv;<br />
int main(int argc, char* argv[])<br />
{<br />
cout&lt;&lt;&quot;Hangman (C) 2007 by 6players&quot;&lt;&lt;endl&lt;&lt;endl;<br />
cout&lt;&lt;&quot;Spieler eins bitte geben Sie Ihren Namen ein:&quot;;<br />
cin&gt;&gt;spieler_eins;<br />
cout&lt;&lt;&quot;Spieler zwei bitte geben Sie Ihren Namen ein:&quot;;<br />
cin&gt;&gt;spieler_zwei;</p>
<p>cout&lt;&lt;endl&lt;&lt;&quot;&quot;&lt;&lt;spieler_eins&lt;&lt;&quot; bitte das zu erratene Wort eingeben (Maximal 20 Zeichen).&quot;&lt;&lt;endl;<br />
cin&gt;&gt;wort; //Eingabe des Wortes, das von Spieler2 erraten werden soll</p>
<p>//Beginn der Umwandlung des Wortes in Unterstriche und Festlegung der Anzahl der Buchstaben<br />
for(int i=0;i&lt;=20;i=i+1)<br />
{<br />
if(wort[i]==0) //Wenn das Ende des Arrays &quot;wort&quot; erreicht wurde<br />
{<br />
anz_buch=i; //Festlegung aller Vorhandenen Buchstaben,<br />
//damit später überprüft werden kann ob Spieler2 gewinnt<br />
i=20;<br />
}<br />
else //Wenn das Array &quot;wort&quot; noch Zeichen enthält<br />
{<br />
if(raten[i]==0) //Verzweigung zum speichern der Unterstriche<br />
// für alle vorhandenen Buchstaben<br />
{<br />
raten[i]='_';<br />
}<br />
}<br />
} //Ende Umwandlung</p>
<p>for(int i=0;i&lt;=30;i=i+1) //Beginn Hauptprozess<br />
{<br />
clrscr(); //Alle sichtbaren Elemente werden gelöscht<br />
suchlauf=0; //Suchlauf wird auf 0 gesetzt</p>
<p>cout&lt;&lt;&quot;&quot;&lt;&lt;spieler_zwei&lt;&lt;&quot; muss das Wort erraten!&quot;&lt;&lt;endl&lt;&lt;endl;</p>
<p>for(int ausgabe=0;ausgabe&lt;=20;ausgabe=ausgabe+1) //for-Schleife zum Ausgeben der bisher<br />
//erratenen Buchstaben und der Unterstriche als Platzhalter<br />
{<br />
cout&lt;&lt;&quot;&quot;&lt;&lt;raten[ausgabe]&lt;&lt;&quot; &quot;;<br />
}</p>
<p>cout&lt;&lt;endl&lt;&lt;endl;</p>
<p>//Ausgaben der entsprechenden Hangmans:<br />
if(fehler==1)<br />
{<br />
cout&lt;&lt;&quot;------------|&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;| /&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;|/&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;|&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;|&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;|&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;|&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;|&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;|&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;|&quot;&lt;&lt;endl;</p>
<p>}<br />
if(fehler==2)<br />
{<br />
cout&lt;&lt;&quot;------------&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;| / |&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;|/ ---&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;| |. .|&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;| | * |&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;| | v |&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;| ---&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;|&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;|&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;|&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;|&quot;&lt;&lt;endl;</p>
<p>}<br />
if(fehler==3)<br />
{</p>
<p>cout&lt;&lt;&quot;------------&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;| / |&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;|/ ---&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;| |. .|&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;| | * |&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;| | v |&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;| ---&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;| |&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;| |&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;| |&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;| |&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;|&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;|&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;|&quot;&lt;&lt;endl;<br />
}<br />
if(fehler==4)<br />
{<br />
cout&lt;&lt;&quot; ------------&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;| / |&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;|/ ---&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;| |. .|&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;| | * |&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;| | v |&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;| ---&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;| |&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;| \---|&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;| |&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;| |&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;|&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;|&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;|&quot;&lt;&lt;endl;</p>
<p>}<br />
if(fehler==5)<br />
{<br />
cout&lt;&lt;&quot; ------------&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;| / |&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;|/ ---&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;| |. .|&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;| | * |&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;| | - |&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;| ---&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;| |&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;| \---|---/&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;| |&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;| |&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;|&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;|&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;|&quot;&lt;&lt;endl;<br />
}<br />
if(fehler==6)<br />
{<br />
cout&lt;&lt;&quot; ------------&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;| / |&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;|/ ---&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;| |. .|&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;| | * |&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;| | o | &quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;| ---&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;| |&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;| \---|---/&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;| |&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;| |&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;| / &quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;| / &quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;| / &quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;|&quot;&lt;&lt;endl;<br />
}<br />
if(fehler==7)<br />
{<br />
cout&lt;&lt;&quot; ------------&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;| / |&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;|/ ---&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;| |. .|&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;| | * |&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;| | o | Dying...&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;| ---&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;| |&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;| \---|---/&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;| |&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;| |&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;| / \&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;| / \&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;| / \&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;|&quot;&lt;&lt;endl;<br />
}<br />
if(fehler==8)<br />
{</p>
<p>cout&lt;&lt;&quot; ------------&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;| / |&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;|/ ---&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;| |x x|&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;| | * |&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;| | x | Dead!&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;| ---&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;| \&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;| \---|---/&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;| |&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;| |&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;| / \&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;| / \&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;| / \&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;|&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot; YOU LOOSE &quot;&lt;&lt;endl;</p>
<p>cout&lt;&lt;&quot;Schade &quot;&lt;&lt;spieler_zwei&lt;&lt;&quot;!&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;&quot;&lt;&lt;spieler_eins&lt;&lt;&quot; hat gewonnen!&quot;;<br />
getch();<br />
return 0; //Ende des Programms<br />
}</p>
<p>cout&lt;&lt;endl;</p>
<p>for(int fb=0;fb&lt;=8;fb=fb+1) //for-Schleife zur Ausgabe aller<br />
//falsch geratenen Buchstaben<br />
{<br />
cout&lt;&lt;&quot;&quot;&lt;&lt;fehl_buch[fb]&lt;&lt;&quot; &quot;;<br />
}</p>
<p>cout&lt;&lt;endl&lt;&lt;endl&lt;&lt;endl;</p>
<p>cin&gt;&gt;buchstabe;<br />
for(int a=0;a&lt;=19;a=a+1) //Überprüfungen nach Eingabe eines Buchstabens:<br />
{<br />
if(buchstabe==wort[a]) //wenn der erratene Buchstabe vorkommt:<br />
{<br />
if(buchstabe==raten[a]) //Fall: Schon verwendet<br />
{<br />
cout&lt;&lt;&quot;Buchstabe schon verwendet!&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;Bitte eine Taste druecken um einen anderen&quot;;<br />
cout&lt;&lt;&quot;Buchstaben einzugeben.&quot;;<br />
getch();<br />
}<br />
else //Falls noch nicht verwendet<br />
{<br />
raten[a]=buchstabe; //Unterstrich wird mit dem<br />
//entsprechenden Buchstaben überschrieben<br />
suchlauf=suchlauf-1; //Suchlauf wird -1 gerechnet,<br />
//damit die Verzweigung zur Aktualisierung der Fehler<br />
//nicht ausgeführt wird<br />
richtig=richtig+1; //Anzahl der richtig erratenen<br />
//Buchstaben wird +1 gerechnet<br />
}</p>
<p>if(richtig==anz_buch) //Hat Spieler2 gewonnen?<br />
{<br />
cout&lt;&lt;&quot;Herzlichen Glueckwunsch &quot;&lt;&lt;spieler_zwei&lt;&lt;&quot;!&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;Sie haben gewonnen!&quot;;<br />
getch();<br />
return 0;<br />
}<br />
}<br />
else //Kommt der geratene Buchstabe nicht vor?<br />
{<br />
suchlauf=suchlauf+1; //Suchlauf wird um 1 erhöht<br />
if(suchlauf==20) //Wenn 20 mal falsch geraten wurde<br />
{<br />
fehl_buch[a]=buchstabe; //der Buchstabe wird der Liste aller<br />
//falsch geratenen Buchstaben hinzugefügt<br />
fehler=fehler+1; //Anzahl der Fehler werden aktualisiert<br />
if(fehler==8) //Fehler=8? Falls ja, hat Spieler2 verloren<br />
{<br />
cout&lt;&lt;&quot;Schade &quot;&lt;&lt;spieler_zwei&lt;&lt;&quot;!&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;&quot;&lt;&lt;spieler_eins&lt;&lt;&quot; hat gewonnen!&quot;&lt;&lt;endl;<br />
cout&lt;&lt;&quot;Das Wort wäre &quot;&lt;&lt;wort&lt;&lt;&quot; gewesen!&quot;;<br />
}<br />
}<br />
}<br />
}<br />
} //Ende Hauptprozess<br />
return 0; //Programmende</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1317618</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1317618</guid><dc:creator><![CDATA[watts]]></dc:creator><pubDate>Tue, 03 Jul 2007 16:13:41 GMT</pubDate></item><item><title><![CDATA[Reply to Hangman brauche dringend hilfe on Tue, 03 Jul 2007 16:23:07 GMT]]></title><description><![CDATA[<p>Und was sind Deine konkreten Fragen?<br />
Hilfe zur Selbsthilfe:<br />
<a href="http://tutorial.schornboeck.net/funktionen.htm" rel="nofollow">http://tutorial.schornboeck.net/funktionen.htm</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1317623</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1317623</guid><dc:creator><![CDATA[Rostfrei**]]></dc:creator><pubDate>Tue, 03 Jul 2007 16:23:07 GMT</pubDate></item><item><title><![CDATA[Reply to Hangman brauche dringend hilfe on Tue, 03 Jul 2007 16:42:19 GMT]]></title><description><![CDATA[<p>Hallo</p>
<p>Nicht zu vergessen sfds.<br />
Und da du keine Builder-spezifischen Sachen benutzt sondern ein reines Konsolenprogramm shreibst gehört es ins C++ Forum.</p>
<p>bis bald<br />
akari</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1317637</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1317637</guid><dc:creator><![CDATA[akari]]></dc:creator><pubDate>Tue, 03 Jul 2007 16:42:19 GMT</pubDate></item><item><title><![CDATA[Reply to Hangman brauche dringend hilfe on Tue, 03 Jul 2007 16:42:29 GMT]]></title><description><![CDATA[<p>Dieser Thread wurde von Moderator/in <a href="http://www.c-plusplus.net/forum/profile-var-mode-is-viewprofile-and-u-is-14774.html" rel="nofollow">akari</a> aus dem Forum <a href="http://www.c-plusplus.net/forum/viewforum-var-f-is-2.html" rel="nofollow">VCL/CLX (Borland C++ Builder)</a> in das Forum <a href="http://www.c-plusplus.net/forum/viewforum-var-f-is-15.html" rel="nofollow">C++</a> verschoben.</p>
<p>Im Zweifelsfall bitte auch folgende Hinweise beachten:<br />
<a href="http://www.c-plusplus.net/forum/viewtopic-var-t-is-39405.html" rel="nofollow">C/C++ Forum :: FAQ - Sonstiges :: Wohin mit meiner Frage?</a></p>
<p><em>Dieses Posting wurde automatisch erzeugt.</em></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1317638</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1317638</guid><dc:creator><![CDATA[C++ Forumbot]]></dc:creator><pubDate>Tue, 03 Jul 2007 16:42:29 GMT</pubDate></item><item><title><![CDATA[Reply to Hangman brauche dringend hilfe on Tue, 03 Jul 2007 20:12:52 GMT]]></title><description><![CDATA[<p>Naja, ganz einfach, du suchst dir Teile des Programmes die quasi für sich alleine Sinn machen, und machst Funktionen draus.</p>
<p>Was mir als erstes ins Auge springt ist das Zeichnen des &quot;Hangman&quot;, das kann man schön als unabhängige Funktion machen. Sieht dann ca. so aus:</p>
<pre><code class="language-cpp">void ZeichneHangman(int fehler); // &lt;-- &quot;Prototyp&quot;

// ... irgendwas ...

void ZeichneHangman(int fehler)
{
   // &lt;-- Implementierung von &quot;ZeichneHangman&quot; hier
}
</code></pre>
<p>Im der &quot;main&quot; Funktion kannst du dann ZeichneHangman aufrufen wie jede andere Funktion.</p>
<p>p.S.: der Rest des Programmes ist nach meinen Standards eher fürchterlich, den würde ich persönlich wahrscheinlich grösstenteils re-implementieren. Aber vielleicht findest du selbst noch geeignete Kandidaten (Codestellen) aus denen man Funktionen machen kann <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/1317748</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1317748</guid><dc:creator><![CDATA[hustbaer]]></dc:creator><pubDate>Tue, 03 Jul 2007 20:12:52 GMT</pubDate></item><item><title><![CDATA[Reply to Hangman brauche dringend hilfe on Sun, 08 Jul 2007 19:15:06 GMT]]></title><description><![CDATA[<p>jo danke euch für eure Beiträge hab da schon gute ideen gesammelt.</p>
<p>mfg watts</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1320991</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1320991</guid><dc:creator><![CDATA[watts]]></dc:creator><pubDate>Sun, 08 Jul 2007 19:15:06 GMT</pubDate></item></channel></rss>