From 9d4aa2f40a5ab9d07f7f6f50c360495bb380edb2 Mon Sep 17 00:00:00 2001 From: Fionn Date: Wed, 2 Feb 2022 10:48:42 +0100 Subject: [PATCH] all the implementation --- .../.vs/Lernprogramm3_Matchinggame/v17/.suo | Bin 12800 -> 35328 bytes .../Form1.Designer.cs | 334 +++++++++--------- .../Lernprogramm3_Matchinggame/Form1.cs | 103 ++++++ 3 files changed, 270 insertions(+), 167 deletions(-) diff --git a/Lernprogramm3_Matchinggame/.vs/Lernprogramm3_Matchinggame/v17/.suo b/Lernprogramm3_Matchinggame/.vs/Lernprogramm3_Matchinggame/v17/.suo index 8d562f4142b5b808f5a811cb91fc97406805262f..edccf3f2ff1f0cd64677b192686e6ddf00329d42 100644 GIT binary patch literal 35328 zcmeHQYit}x9p6h@nm*_&w6vwAPM>M<9p}6A`J6OqE_c4B)Fw{PbqaChuFq@dk~^Qd zhf@=WA|WCAg%3y|fe@tvl^_8ss1>TH5PX3aDuoY#KnSTwk)SH7TD5#Yq7A>_?v8JE zeY>}NIXkhlW6eHhXXZbT|NNgb=Rcgj?)7JXddoi)TiC5^Rz5g;x$+??J%r~?;{94h zxdhKl`{3-^vrOKMh{qtTqY-#iso<}!^e98h9PU+RkyGh8+^Af-Jm>eeDfRqq2anx+ z(_ccjG2abF=21YbC`Xlt0euEfL&}qFYO#L45f~{CxAkl5w;?10ef1#V6YjiHLJO*j zhM31#sEC@G&*^qo2k<|R%Km09r2R?*P)bS>{b!t&AZL+MbpmXr1Ad5W^d3ZxL!0dS z=iRt2aN#0cj`+SjfVO9@?HiGY({&3XKi_QL`OLoXF2WUf|0v=|5N|@f74b?$*2C~& zJag=O5HpC|5br`XzMegMH=ZAm-bFg^y-4qO_$KE|BF_L~3ULr|2jWgdwjqtXoR`nH zn`xqr_U{|{eJ$7j+i(2o6xTm-wTtUNB+n14ZWlJ%`e*-1PIzzEcYc@GKg%#&igeNe zu7RuZycO|!M1GUQb!OT%xL<`xntvJM#}My8l=Ir3NvGsAu7B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Xd_xB&(T=<->FP9u|3BOHi_$Aq+JY+d8S4yx7-=bQ{!Acse zr#1|E2Rc9f@J8PUk)Np3n zH-1Kj2xTa|mRtCE7Tse^fN5ufjQm7puHthAyglLGDahDDo{qwlv*ZoIXc;AnI z`e#&eESGEf>w`To2kVedhfyDxMJ|>`bucHhGn5N?Bw~r6c>o(ji^#`PPArF7m~CUV z5J?Io#HJB-!#+40YNe?u$Agi1RpOW2G=&s_9cN?7WuIFfMm@em8tfypArkAuF0D^$ zwu!wi4qUQ)$fctYY;6vAygE!n!Qc8eb-+&ifSNZ!?XZV;D1iF#occH)8gw1>NnI6O zJz7-7-x0S;%C2HB`7Zfjry5;E3hMu_oNEdyliM(}3g>YzR8$Ap{0Y~2>}J@ca~rx> zY20d~lIMQ?28%%rS_6fGSO|7gmwZ{KEW6u9T0-tCf%Y=ZR+DZJXM>D%fH-}Ukxq~R zh8eLv#`9Cm)657n%HWG&JaLK_NhZZiGE>a6jKQRt43lL{W|}$u=z8k)#h*En5=zF2 zb}0=BxMn1s^!uQKf!(yp&(h@3Rm>YY<`=ji*(lS)@;9)XJpipR!fB*Jwviy~^aj4p zL>tzUC@Z58@e{uYGZ$q?qv}<5BHhEz2-?gkR`VCXTIE~S7kUYsmExDhexfWA#Rccw z6iv$lmr5B-oiil1N8>&hR9;?uZDK-SSxHQcO(gZ#$4)$xIyqJ@pPw8{C0Eu~SJx7H z>SUQbe?ouhcO2im*Cn1MR2l1LORkW|YHgz7vlrifGckVt%HS*3>Xr2iZ@o&((9ES^ zYd?zc%e{Eb40Nb`LS~=FrWVK>BTLJhBDOBIfO9iB_ fw09ode({g*{z`onS^BYb>HE)aU9NmYoa*v_km8q< diff --git a/Lernprogramm3_Matchinggame/Lernprogramm3_Matchinggame/Form1.Designer.cs b/Lernprogramm3_Matchinggame/Lernprogramm3_Matchinggame/Form1.Designer.cs index df0037f..0939c35 100644 --- a/Lernprogramm3_Matchinggame/Lernprogramm3_Matchinggame/Form1.Designer.cs +++ b/Lernprogramm3_Matchinggame/Lernprogramm3_Matchinggame/Form1.Designer.cs @@ -29,22 +29,22 @@ private void InitializeComponent() { this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); - this.label1 = new System.Windows.Forms.Label(); - this.label2 = new System.Windows.Forms.Label(); - this.label3 = new System.Windows.Forms.Label(); - this.label4 = new System.Windows.Forms.Label(); - this.label5 = new System.Windows.Forms.Label(); - this.label6 = new System.Windows.Forms.Label(); - this.label7 = new System.Windows.Forms.Label(); - this.label8 = new System.Windows.Forms.Label(); - this.label9 = new System.Windows.Forms.Label(); - this.label10 = new System.Windows.Forms.Label(); - this.label11 = new System.Windows.Forms.Label(); - this.label12 = new System.Windows.Forms.Label(); - this.label13 = new System.Windows.Forms.Label(); - this.label14 = new System.Windows.Forms.Label(); - this.label15 = new System.Windows.Forms.Label(); this.label16 = new System.Windows.Forms.Label(); + this.label15 = new System.Windows.Forms.Label(); + this.label14 = new System.Windows.Forms.Label(); + this.label13 = new System.Windows.Forms.Label(); + this.label12 = new System.Windows.Forms.Label(); + this.label11 = new System.Windows.Forms.Label(); + this.label10 = new System.Windows.Forms.Label(); + this.label9 = new System.Windows.Forms.Label(); + this.label8 = new System.Windows.Forms.Label(); + this.label7 = new System.Windows.Forms.Label(); + this.label6 = new System.Windows.Forms.Label(); + this.label5 = new System.Windows.Forms.Label(); + this.label4 = new System.Windows.Forms.Label(); + this.label3 = new System.Windows.Forms.Label(); + this.label2 = new System.Windows.Forms.Label(); + this.label1 = new System.Windows.Forms.Label(); this.tableLayoutPanel1.SuspendLayout(); this.SuspendLayout(); // @@ -84,101 +84,89 @@ this.tableLayoutPanel1.Size = new System.Drawing.Size(534, 511); this.tableLayoutPanel1.TabIndex = 0; // - // label1 - // - this.label1.AutoSize = true; - this.label1.Dock = System.Windows.Forms.DockStyle.Fill; - this.label1.Font = new System.Drawing.Font("Webdings", 26.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point); - this.label1.Location = new System.Drawing.Point(3, 0); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(127, 127); - this.label1.TabIndex = 0; - this.label1.Text = "label1"; - this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; - // - // label2 + // label16 // - this.label2.AutoSize = true; - this.label2.Dock = System.Windows.Forms.DockStyle.Fill; - this.label2.Font = new System.Drawing.Font("Webdings", 26.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point); - this.label2.Location = new System.Drawing.Point(136, 0); - this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(127, 127); - this.label2.TabIndex = 1; - this.label2.Text = "label2"; - this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + this.label16.AutoSize = true; + this.label16.Dock = System.Windows.Forms.DockStyle.Fill; + this.label16.Font = new System.Drawing.Font("Webdings", 26.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point); + this.label16.Location = new System.Drawing.Point(402, 381); + this.label16.Name = "label16"; + this.label16.Size = new System.Drawing.Size(129, 130); + this.label16.TabIndex = 15; + this.label16.Text = "label16"; + this.label16.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // - // label3 + // label15 // - this.label3.AutoSize = true; - this.label3.Dock = System.Windows.Forms.DockStyle.Fill; - this.label3.Font = new System.Drawing.Font("Webdings", 26.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point); - this.label3.Location = new System.Drawing.Point(269, 0); - this.label3.Name = "label3"; - this.label3.Size = new System.Drawing.Size(127, 127); - this.label3.TabIndex = 2; - this.label3.Text = "label3"; - this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + this.label15.AutoSize = true; + this.label15.Dock = System.Windows.Forms.DockStyle.Fill; + this.label15.Font = new System.Drawing.Font("Webdings", 26.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point); + this.label15.Location = new System.Drawing.Point(269, 381); + this.label15.Name = "label15"; + this.label15.Size = new System.Drawing.Size(127, 130); + this.label15.TabIndex = 14; + this.label15.Text = "label15"; + this.label15.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // - // label4 + // label14 // - this.label4.AutoSize = true; - this.label4.Dock = System.Windows.Forms.DockStyle.Fill; - this.label4.Font = new System.Drawing.Font("Webdings", 26.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point); - this.label4.Location = new System.Drawing.Point(402, 0); - this.label4.Name = "label4"; - this.label4.Size = new System.Drawing.Size(129, 127); - this.label4.TabIndex = 3; - this.label4.Text = "label4"; - this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + this.label14.AutoSize = true; + this.label14.Dock = System.Windows.Forms.DockStyle.Fill; + this.label14.Font = new System.Drawing.Font("Webdings", 26.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point); + this.label14.Location = new System.Drawing.Point(136, 381); + this.label14.Name = "label14"; + this.label14.Size = new System.Drawing.Size(127, 130); + this.label14.TabIndex = 13; + this.label14.Text = "label14"; + this.label14.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // - // label5 + // label13 // - this.label5.AutoSize = true; - this.label5.Dock = System.Windows.Forms.DockStyle.Fill; - this.label5.Font = new System.Drawing.Font("Webdings", 26.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point); - this.label5.Location = new System.Drawing.Point(3, 127); - this.label5.Name = "label5"; - this.label5.Size = new System.Drawing.Size(127, 127); - this.label5.TabIndex = 4; - this.label5.Text = "label5"; - this.label5.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + this.label13.AutoSize = true; + this.label13.Dock = System.Windows.Forms.DockStyle.Fill; + this.label13.Font = new System.Drawing.Font("Webdings", 26.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point); + this.label13.Location = new System.Drawing.Point(3, 381); + this.label13.Name = "label13"; + this.label13.Size = new System.Drawing.Size(127, 130); + this.label13.TabIndex = 12; + this.label13.Text = "label13"; + this.label13.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // - // label6 + // label12 // - this.label6.AutoSize = true; - this.label6.Dock = System.Windows.Forms.DockStyle.Fill; - this.label6.Font = new System.Drawing.Font("Webdings", 26.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point); - this.label6.Location = new System.Drawing.Point(136, 127); - this.label6.Name = "label6"; - this.label6.Size = new System.Drawing.Size(127, 127); - this.label6.TabIndex = 5; - this.label6.Text = "label6"; - this.label6.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + this.label12.AutoSize = true; + this.label12.Dock = System.Windows.Forms.DockStyle.Fill; + this.label12.Font = new System.Drawing.Font("Webdings", 26.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point); + this.label12.Location = new System.Drawing.Point(402, 254); + this.label12.Name = "label12"; + this.label12.Size = new System.Drawing.Size(129, 127); + this.label12.TabIndex = 11; + this.label12.Text = "label12"; + this.label12.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // - // label7 + // label11 // - this.label7.AutoSize = true; - this.label7.Dock = System.Windows.Forms.DockStyle.Fill; - this.label7.Font = new System.Drawing.Font("Webdings", 26.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point); - this.label7.Location = new System.Drawing.Point(269, 127); - this.label7.Name = "label7"; - this.label7.Size = new System.Drawing.Size(127, 127); - this.label7.TabIndex = 6; - this.label7.Text = "label7"; - this.label7.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + this.label11.AutoSize = true; + this.label11.Dock = System.Windows.Forms.DockStyle.Fill; + this.label11.Font = new System.Drawing.Font("Webdings", 26.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point); + this.label11.Location = new System.Drawing.Point(269, 254); + this.label11.Name = "label11"; + this.label11.Size = new System.Drawing.Size(127, 127); + this.label11.TabIndex = 10; + this.label11.Text = "label11"; + this.label11.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // - // label8 + // label10 // - this.label8.AutoSize = true; - this.label8.Dock = System.Windows.Forms.DockStyle.Fill; - this.label8.Font = new System.Drawing.Font("Webdings", 26.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point); - this.label8.Location = new System.Drawing.Point(402, 127); - this.label8.Name = "label8"; - this.label8.Size = new System.Drawing.Size(129, 127); - this.label8.TabIndex = 7; - this.label8.Text = "label8"; - this.label8.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + this.label10.AutoSize = true; + this.label10.Dock = System.Windows.Forms.DockStyle.Fill; + this.label10.Font = new System.Drawing.Font("Webdings", 26.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point); + this.label10.Location = new System.Drawing.Point(136, 254); + this.label10.Name = "label10"; + this.label10.Size = new System.Drawing.Size(127, 127); + this.label10.TabIndex = 9; + this.label10.Text = "label10"; + this.label10.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // // label9 // @@ -192,89 +180,101 @@ this.label9.Text = "label9"; this.label9.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // - // label10 + // label8 // - this.label10.AutoSize = true; - this.label10.Dock = System.Windows.Forms.DockStyle.Fill; - this.label10.Font = new System.Drawing.Font("Webdings", 26.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point); - this.label10.Location = new System.Drawing.Point(136, 254); - this.label10.Name = "label10"; - this.label10.Size = new System.Drawing.Size(127, 127); - this.label10.TabIndex = 9; - this.label10.Text = "label10"; - this.label10.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + this.label8.AutoSize = true; + this.label8.Dock = System.Windows.Forms.DockStyle.Fill; + this.label8.Font = new System.Drawing.Font("Webdings", 26.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point); + this.label8.Location = new System.Drawing.Point(402, 127); + this.label8.Name = "label8"; + this.label8.Size = new System.Drawing.Size(129, 127); + this.label8.TabIndex = 7; + this.label8.Text = "label8"; + this.label8.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // - // label11 + // label7 // - this.label11.AutoSize = true; - this.label11.Dock = System.Windows.Forms.DockStyle.Fill; - this.label11.Font = new System.Drawing.Font("Webdings", 26.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point); - this.label11.Location = new System.Drawing.Point(269, 254); - this.label11.Name = "label11"; - this.label11.Size = new System.Drawing.Size(127, 127); - this.label11.TabIndex = 10; - this.label11.Text = "label11"; - this.label11.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + this.label7.AutoSize = true; + this.label7.Dock = System.Windows.Forms.DockStyle.Fill; + this.label7.Font = new System.Drawing.Font("Webdings", 26.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point); + this.label7.Location = new System.Drawing.Point(269, 127); + this.label7.Name = "label7"; + this.label7.Size = new System.Drawing.Size(127, 127); + this.label7.TabIndex = 6; + this.label7.Text = "label7"; + this.label7.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // - // label12 + // label6 // - this.label12.AutoSize = true; - this.label12.Dock = System.Windows.Forms.DockStyle.Fill; - this.label12.Font = new System.Drawing.Font("Webdings", 26.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point); - this.label12.Location = new System.Drawing.Point(402, 254); - this.label12.Name = "label12"; - this.label12.Size = new System.Drawing.Size(129, 127); - this.label12.TabIndex = 11; - this.label12.Text = "label12"; - this.label12.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + this.label6.AutoSize = true; + this.label6.Dock = System.Windows.Forms.DockStyle.Fill; + this.label6.Font = new System.Drawing.Font("Webdings", 26.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point); + this.label6.Location = new System.Drawing.Point(136, 127); + this.label6.Name = "label6"; + this.label6.Size = new System.Drawing.Size(127, 127); + this.label6.TabIndex = 5; + this.label6.Text = "label6"; + this.label6.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // - // label13 + // label5 // - this.label13.AutoSize = true; - this.label13.Dock = System.Windows.Forms.DockStyle.Fill; - this.label13.Font = new System.Drawing.Font("Webdings", 26.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point); - this.label13.Location = new System.Drawing.Point(3, 381); - this.label13.Name = "label13"; - this.label13.Size = new System.Drawing.Size(127, 130); - this.label13.TabIndex = 12; - this.label13.Text = "label13"; - this.label13.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + this.label5.AutoSize = true; + this.label5.Dock = System.Windows.Forms.DockStyle.Fill; + this.label5.Font = new System.Drawing.Font("Webdings", 26.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point); + this.label5.Location = new System.Drawing.Point(3, 127); + this.label5.Name = "label5"; + this.label5.Size = new System.Drawing.Size(127, 127); + this.label5.TabIndex = 4; + this.label5.Text = "label5"; + this.label5.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // - // label14 + // label4 // - this.label14.AutoSize = true; - this.label14.Dock = System.Windows.Forms.DockStyle.Fill; - this.label14.Font = new System.Drawing.Font("Webdings", 26.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point); - this.label14.Location = new System.Drawing.Point(136, 381); - this.label14.Name = "label14"; - this.label14.Size = new System.Drawing.Size(127, 130); - this.label14.TabIndex = 13; - this.label14.Text = "label14"; - this.label14.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + this.label4.AutoSize = true; + this.label4.Dock = System.Windows.Forms.DockStyle.Fill; + this.label4.Font = new System.Drawing.Font("Webdings", 26.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point); + this.label4.Location = new System.Drawing.Point(402, 0); + this.label4.Name = "label4"; + this.label4.Size = new System.Drawing.Size(129, 127); + this.label4.TabIndex = 3; + this.label4.Text = "label4"; + this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // - // label15 + // label3 // - this.label15.AutoSize = true; - this.label15.Dock = System.Windows.Forms.DockStyle.Fill; - this.label15.Font = new System.Drawing.Font("Webdings", 26.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point); - this.label15.Location = new System.Drawing.Point(269, 381); - this.label15.Name = "label15"; - this.label15.Size = new System.Drawing.Size(127, 130); - this.label15.TabIndex = 14; - this.label15.Text = "label15"; - this.label15.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + this.label3.AutoSize = true; + this.label3.Dock = System.Windows.Forms.DockStyle.Fill; + this.label3.Font = new System.Drawing.Font("Webdings", 26.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point); + this.label3.Location = new System.Drawing.Point(269, 0); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(127, 127); + this.label3.TabIndex = 2; + this.label3.Text = "label3"; + this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // - // label16 + // label2 // - this.label16.AutoSize = true; - this.label16.Dock = System.Windows.Forms.DockStyle.Fill; - this.label16.Font = new System.Drawing.Font("Webdings", 26.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point); - this.label16.Location = new System.Drawing.Point(402, 381); - this.label16.Name = "label16"; - this.label16.Size = new System.Drawing.Size(129, 130); - this.label16.TabIndex = 15; - this.label16.Text = "label16"; - this.label16.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + this.label2.AutoSize = true; + this.label2.Dock = System.Windows.Forms.DockStyle.Fill; + this.label2.Font = new System.Drawing.Font("Webdings", 26.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point); + this.label2.Location = new System.Drawing.Point(136, 0); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(127, 127); + this.label2.TabIndex = 1; + this.label2.Text = "label2"; + this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Dock = System.Windows.Forms.DockStyle.Fill; + this.label1.Font = new System.Drawing.Font("Webdings", 26.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point); + this.label1.Location = new System.Drawing.Point(3, 0); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(127, 127); + this.label1.TabIndex = 0; + this.label1.Text = "label1"; + this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // // Form1 // diff --git a/Lernprogramm3_Matchinggame/Lernprogramm3_Matchinggame/Form1.cs b/Lernprogramm3_Matchinggame/Lernprogramm3_Matchinggame/Form1.cs index 3ee54e3..57a40b3 100644 --- a/Lernprogramm3_Matchinggame/Lernprogramm3_Matchinggame/Form1.cs +++ b/Lernprogramm3_Matchinggame/Lernprogramm3_Matchinggame/Form1.cs @@ -6,5 +6,108 @@ namespace Lernprogramm3_Matchinggame { InitializeComponent(); } + + private void RefreshWindowTitle() + { + Text = string.Format("Lernprogramm 3: MatchingGame [Moves: {0}]", Math.Floor((double)moves / 2)); + } + + Random rdm = new(); + + List icons = new() + { + "!", + "!", + "N", + "N", + ",", + ",", + "k", + "k", + "b", + "b", + "v", + "v", + "w", + "w", + "z", + "z" + }; + + Dictionary controlIcons = new(); + + Control flipped1; + Control flipped2; + + int moves = 0; + + private void Form1_Load(object sender, EventArgs e) + { + foreach (Control con in tableLayoutPanel1.Controls) + { + int nextIndex = rdm.Next(icons.Count); + + string icon = icons[nextIndex]; + icons.RemoveAt(nextIndex); + + con.Text = ""; + controlIcons[con] = new ControlIconDefinition() { Icon = icon }; + + con.Click += (_, _) => + { + if (flipped1 != null && flipped2 != null) + { + flipped1.BackColor = Color.CornflowerBlue; + flipped2.BackColor = Color.CornflowerBlue; + flipped1.Text = ""; + flipped2.Text = ""; + flipped1 = null; + flipped2 = null; + } + if (controlIcons[con].Found) + { + return; + } + + moves++; + RefreshWindowTitle(); + + con.BackColor = Color.Orange; + + if (flipped1 == null) + { + flipped1 = con; + + flipped1.Text = controlIcons[flipped1].Icon; + + return; + } + if (flipped2 == null) + { + flipped2 = con; + + flipped2.Text = controlIcons[flipped2].Icon; + + if (flipped2.Text == flipped1.Text) + { + // success + foreach (Control cont in new Control[] { flipped1, flipped2 }) + { + cont.BackColor = Color.Green; + controlIcons[cont].Found = true; + } + flipped1 = null; + flipped2 = null; + } + } + }; + } + } + } + + class ControlIconDefinition + { + public string Icon { get; set; } + public bool Found { get; set; } = false; } } \ No newline at end of file