<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=iso-8859-1"><meta name=Generator content="Microsoft Word 14 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
        {mso-style-priority:34;
        margin-top:0cm;
        margin-right:0cm;
        margin-bottom:0cm;
        margin-left:36.0pt;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
span.E-MailFormatvorlage17
        {mso-style-type:personal-compose;
        font-family:"Calibri","sans-serif";
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.WordSection1
        {page:WordSection1;}
/* List Definitions */
@list l0
        {mso-list-id:1895580542;
        mso-list-type:hybrid;
        mso-list-template-ids:-949606466 67567631 67567641 67567643 67567631 67567641 67567643 67567631 67567641 67567643;}
@list l0:level1
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level2
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level3
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
@list l0:level4
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level5
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level6
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
@list l0:level7
        {mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level8
        {mso-level-number-format:alpha-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
@list l0:level9
        {mso-level-number-format:roman-lower;
        mso-level-tab-stop:none;
        mso-level-number-position:right;
        text-indent:-9.0pt;}
ol
        {margin-bottom:0cm;}
ul
        {margin-bottom:0cm;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=DE link=blue vlink=purple><div class=WordSection1><p class=MsoNormal>Hi zusammen,<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>vielen lieben Dank für’s „auf machen“ dieses coolen Spielzeugs. Ich habe eben das Tic-Tac-Toe Spiel aus der Einleitung durch geklickert.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Nun möchte ich als Fingerübung ein Simon Says bauen, um rauszufinden was TipToi kann und wo die Grenzen sind. Wer’s nicht kennt: Vier Farben, rot, gelb, blau grün. Der Spieler bekommt eine Farbe gesagt, die er dann drücken darf, danach bekommt er zwei gesagt, der Spieler drückt sie in der richtigen Reihenfolge und wird mit der dritten Farbe belohnt. Das Spiel endet mit der Grenze des Gedächtnisses des Spielers.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Meine Überlegung war, dass ich ja cool die Variable $row mit der Reihenfolge der gedrückten Tasten, 1,2,3 oder 4 bestücken kann, wobei die Ziffern den vier Farben entsprechen. Wenn das Spiel dran ist würfle ich mit einem vierseitigen Würfel und hänge $row die gewürfelte Zahl an. Bevor der Spieler dran ist lese ich $row Ziffer für Ziffer durch und lese die entsprechende Farbe vor. Wenn der Spieler dran ist füllt das Programm mit jedem Klick eine Variable $player_row. Zudem kann ich $player_turns easy mitzählen. Hier kommen meine beiden Problemchen:<o:p></o:p></p><p class=MsoListParagraph style='text-indent:-18.0pt;mso-list:l0 level1 lfo1'><![if !supportLists]><span style='mso-list:Ignore'>1.<span style='font:7.0pt "Times New Roman"'>       </span></span><![endif]>Wie kann ich an eine Variable ein Zeichen anhängen?<o:p></o:p></p><p class=MsoListParagraph style='text-indent:-18.0pt;mso-list:l0 level1 lfo1'><![if !supportLists]><span style='mso-list:Ignore'>2.<span style='font:7.0pt "Times New Roman"'>       </span></span><![endif]>Wie kann ich eine Variable auf eine vorgegebene Anzahl Bytes kürzen?<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Die Antworten auf diese Fragen lassen mich $row und $player_row aufbauen und $row mit Hilfe von $player_turns kürzer, um die Bedingung $row == $player_row aufstellen und darauf reagieren.<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Ich freue mich auf eure Ideen und alternativen Lösungsvorschläge. :)<o:p></o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Viele Grüße<o:p></o:p></p><p class=MsoNormal>Andi<o:p></o:p></p></div></body></html>