From dbbf776cf1ce74cd2e52a06493a0ff80df598932 Mon Sep 17 00:00:00 2001 From: normanmenesCDV Date: Mon, 4 Dec 2023 10:16:39 +0100 Subject: [PATCH] =?UTF-8?q?Projekt=20-=20gra=20k=C3=B3=C5=82ko=20i=20krzy?= =?UTF-8?q?=C5=BCyk?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zaawansowane programowanie obiektowe.sln | 18 +- [5]projekt/Form1.Designer.cs | 597 ++++++++++++++++++++ [5]projekt/Form1.cs | 504 +++++++++++++++++ [5]projekt/Form1.resx | 120 ++++ [5]projekt/Program.cs | 17 + [5]projekt/Properties/Resources.Designer.cs | 73 +++ [5]projekt/Properties/Resources.resx | 124 ++++ [5]projekt/Ustawienia.cs | 47 ++ [5]projekt/Wyniki.cs | 42 ++ [5]projekt/files/back.png | Bin 0 -> 2754 bytes [5]projekt/kolko_i_krzyzyk.csproj | 26 + 11 files changed, 1562 insertions(+), 6 deletions(-) create mode 100644 [5]projekt/Form1.Designer.cs create mode 100644 [5]projekt/Form1.cs create mode 100644 [5]projekt/Form1.resx create mode 100644 [5]projekt/Program.cs create mode 100644 [5]projekt/Properties/Resources.Designer.cs create mode 100644 [5]projekt/Properties/Resources.resx create mode 100644 [5]projekt/Ustawienia.cs create mode 100644 [5]projekt/Wyniki.cs create mode 100644 [5]projekt/files/back.png create mode 100644 [5]projekt/kolko_i_krzyzyk.csproj diff --git a/Zaawansowane programowanie obiektowe.sln b/Zaawansowane programowanie obiektowe.sln index ab18c1f..c3875f3 100644 --- a/Zaawansowane programowanie obiektowe.sln +++ b/Zaawansowane programowanie obiektowe.sln @@ -3,30 +3,36 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 VisualStudioVersion = 17.2.32616.157 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "[2]zajecia", "[2]zajecia\[2]zajecia.csproj", "{57713726-15D0-43C9-A5B4-7B74ECBC1049}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "[1]zajecia", "[1]zajecia\[1]zajecia.csproj", "{6DA3F5D3-156C-4379-8E5D-CDCFF755C175}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "[2]zajecia", "[2]zajecia\[2]zajecia.csproj", "{57713726-15D0-43C9-A5B4-7B74ECBC1049}" +EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "[3]zajecia", "[3]zajecia\[3]zajecia.csproj", "{BD5C86AA-90A8-4D50-A9CA-00CC090EDB01}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "kolko_i_krzyzyk", "[5]projekt\kolko_i_krzyzyk.csproj", "{D88CCA7C-98B5-4A9D-8CBA-7240904BE838}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {57713726-15D0-43C9-A5B4-7B74ECBC1049}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {57713726-15D0-43C9-A5B4-7B74ECBC1049}.Debug|Any CPU.Build.0 = Debug|Any CPU - {57713726-15D0-43C9-A5B4-7B74ECBC1049}.Release|Any CPU.ActiveCfg = Release|Any CPU - {57713726-15D0-43C9-A5B4-7B74ECBC1049}.Release|Any CPU.Build.0 = Release|Any CPU {6DA3F5D3-156C-4379-8E5D-CDCFF755C175}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {6DA3F5D3-156C-4379-8E5D-CDCFF755C175}.Debug|Any CPU.Build.0 = Debug|Any CPU {6DA3F5D3-156C-4379-8E5D-CDCFF755C175}.Release|Any CPU.ActiveCfg = Release|Any CPU {6DA3F5D3-156C-4379-8E5D-CDCFF755C175}.Release|Any CPU.Build.0 = Release|Any CPU + {57713726-15D0-43C9-A5B4-7B74ECBC1049}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {57713726-15D0-43C9-A5B4-7B74ECBC1049}.Debug|Any CPU.Build.0 = Debug|Any CPU + {57713726-15D0-43C9-A5B4-7B74ECBC1049}.Release|Any CPU.ActiveCfg = Release|Any CPU + {57713726-15D0-43C9-A5B4-7B74ECBC1049}.Release|Any CPU.Build.0 = Release|Any CPU {BD5C86AA-90A8-4D50-A9CA-00CC090EDB01}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {BD5C86AA-90A8-4D50-A9CA-00CC090EDB01}.Debug|Any CPU.Build.0 = Debug|Any CPU {BD5C86AA-90A8-4D50-A9CA-00CC090EDB01}.Release|Any CPU.ActiveCfg = Release|Any CPU {BD5C86AA-90A8-4D50-A9CA-00CC090EDB01}.Release|Any CPU.Build.0 = Release|Any CPU + {D88CCA7C-98B5-4A9D-8CBA-7240904BE838}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D88CCA7C-98B5-4A9D-8CBA-7240904BE838}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D88CCA7C-98B5-4A9D-8CBA-7240904BE838}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D88CCA7C-98B5-4A9D-8CBA-7240904BE838}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/[5]projekt/Form1.Designer.cs b/[5]projekt/Form1.Designer.cs new file mode 100644 index 0000000..cee59d7 --- /dev/null +++ b/[5]projekt/Form1.Designer.cs @@ -0,0 +1,597 @@ +namespace kolko_i_krzyzyk +{ + partial class Form1 + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + tabControl1 = new TabControl(); + tabPage1 = new TabPage(); + label2 = new Label(); + buttonHomeTabelaWynikow = new Button(); + buttonHomeUstawienia = new Button(); + buttonHomeGraj = new Button(); + tabPage2 = new TabPage(); + pictureBox1 = new PictureBox(); + label1 = new Label(); + progressBar1 = new ProgressBar(); + button9 = new Button(); + button8 = new Button(); + button7 = new Button(); + button6 = new Button(); + button5 = new Button(); + button4 = new Button(); + button3 = new Button(); + button2 = new Button(); + button1 = new Button(); + tabPage3 = new TabPage(); + label3 = new Label(); + pictureBox2 = new PictureBox(); + groupBoxPoziomTrudnosci = new GroupBox(); + radioButtonTrudny = new RadioButton(); + radioButtonSredni = new RadioButton(); + radioButtonLatwy = new RadioButton(); + groupBoxTypGry = new GroupBox(); + radioButtonMultiplayer = new RadioButton(); + radioButtonZKomputerem = new RadioButton(); + tabPage4 = new TabPage(); + button10 = new Button(); + label8 = new Label(); + label7 = new Label(); + label6 = new Label(); + label5 = new Label(); + label4 = new Label(); + pictureBox3 = new PictureBox(); + tabControl1.SuspendLayout(); + tabPage1.SuspendLayout(); + tabPage2.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)pictureBox1).BeginInit(); + tabPage3.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)pictureBox2).BeginInit(); + groupBoxPoziomTrudnosci.SuspendLayout(); + groupBoxTypGry.SuspendLayout(); + tabPage4.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)pictureBox3).BeginInit(); + SuspendLayout(); + // + // tabControl1 + // + tabControl1.Controls.Add(tabPage1); + tabControl1.Controls.Add(tabPage2); + tabControl1.Controls.Add(tabPage3); + tabControl1.Controls.Add(tabPage4); + tabControl1.Location = new Point(1, 1); + tabControl1.Margin = new Padding(3, 4, 3, 4); + tabControl1.Name = "tabControl1"; + tabControl1.SelectedIndex = 0; + tabControl1.Size = new Size(383, 597); + tabControl1.TabIndex = 12; + // + // tabPage1 + // + tabPage1.Controls.Add(label2); + tabPage1.Controls.Add(buttonHomeTabelaWynikow); + tabPage1.Controls.Add(buttonHomeUstawienia); + tabPage1.Controls.Add(buttonHomeGraj); + tabPage1.Location = new Point(4, 29); + tabPage1.Margin = new Padding(3, 4, 3, 4); + tabPage1.Name = "tabPage1"; + tabPage1.Padding = new Padding(3, 4, 3, 4); + tabPage1.Size = new Size(375, 564); + tabPage1.TabIndex = 0; + tabPage1.Text = "tabPage1"; + tabPage1.UseVisualStyleBackColor = true; + // + // label2 + // + label2.AutoSize = true; + label2.Font = new Font("Segoe UI", 24F, FontStyle.Bold, GraphicsUnit.Point); + label2.Location = new Point(38, 32); + label2.Name = "label2"; + label2.Size = new Size(307, 54); + label2.TabIndex = 3; + label2.Text = "Kółko i krzyżyk"; + // + // buttonHomeTabelaWynikow + // + buttonHomeTabelaWynikow.Location = new Point(110, 319); + buttonHomeTabelaWynikow.Margin = new Padding(3, 4, 3, 4); + buttonHomeTabelaWynikow.Name = "buttonHomeTabelaWynikow"; + buttonHomeTabelaWynikow.Size = new Size(143, 49); + buttonHomeTabelaWynikow.TabIndex = 2; + buttonHomeTabelaWynikow.Text = "Tabela wyników"; + buttonHomeTabelaWynikow.UseVisualStyleBackColor = true; + buttonHomeTabelaWynikow.Click += buttonHomeTabelaWynikow_Click; + // + // buttonHomeUstawienia + // + buttonHomeUstawienia.Location = new Point(110, 234); + buttonHomeUstawienia.Margin = new Padding(3, 4, 3, 4); + buttonHomeUstawienia.Name = "buttonHomeUstawienia"; + buttonHomeUstawienia.Size = new Size(143, 49); + buttonHomeUstawienia.TabIndex = 1; + buttonHomeUstawienia.Text = "Ustawienia"; + buttonHomeUstawienia.UseVisualStyleBackColor = true; + buttonHomeUstawienia.Click += buttonHomeUstawienia_Click; + // + // buttonHomeGraj + // + buttonHomeGraj.Location = new Point(110, 145); + buttonHomeGraj.Margin = new Padding(3, 4, 3, 4); + buttonHomeGraj.Name = "buttonHomeGraj"; + buttonHomeGraj.Size = new Size(143, 49); + buttonHomeGraj.TabIndex = 0; + buttonHomeGraj.Text = "Rozpocznij grę"; + buttonHomeGraj.UseVisualStyleBackColor = true; + buttonHomeGraj.Click += buttonHomeGraj_Click; + // + // tabPage2 + // + tabPage2.Controls.Add(pictureBox1); + tabPage2.Controls.Add(label1); + tabPage2.Controls.Add(progressBar1); + tabPage2.Controls.Add(button9); + tabPage2.Controls.Add(button8); + tabPage2.Controls.Add(button7); + tabPage2.Controls.Add(button6); + tabPage2.Controls.Add(button5); + tabPage2.Controls.Add(button4); + tabPage2.Controls.Add(button3); + tabPage2.Controls.Add(button2); + tabPage2.Controls.Add(button1); + tabPage2.Location = new Point(4, 29); + tabPage2.Margin = new Padding(3, 4, 3, 4); + tabPage2.Name = "tabPage2"; + tabPage2.Padding = new Padding(3, 4, 3, 4); + tabPage2.Size = new Size(375, 564); + tabPage2.TabIndex = 1; + tabPage2.Text = "tabPage2"; + tabPage2.UseVisualStyleBackColor = true; + // + // pictureBox1 + // + pictureBox1.Image = Properties.Resources.back; + pictureBox1.Location = new Point(7, 533); + pictureBox1.Name = "pictureBox1"; + pictureBox1.Size = new Size(25, 25); + pictureBox1.SizeMode = PictureBoxSizeMode.StretchImage; + pictureBox1.TabIndex = 20; + pictureBox1.TabStop = false; + pictureBox1.Click += pictureBox_Click; + // + // label1 + // + label1.Location = new Point(104, 13); + label1.Name = "label1"; + label1.Size = new Size(171, 20); + label1.TabIndex = 19; + label1.Text = "Ruch gracza"; + label1.TextAlign = ContentAlignment.MiddleCenter; + // + // progressBar1 + // + progressBar1.Location = new Point(8, 485); + progressBar1.Margin = new Padding(3, 4, 3, 4); + progressBar1.Name = "progressBar1"; + progressBar1.Size = new Size(356, 29); + progressBar1.TabIndex = 18; + progressBar1.Visible = false; + // + // button9 + // + button9.Font = new Font("Segoe UI", 50F, FontStyle.Regular, GraphicsUnit.Point); + button9.Location = new Point(250, 331); + button9.Margin = new Padding(3, 4, 3, 4); + button9.Name = "button9"; + button9.Size = new Size(114, 133); + button9.TabIndex = 17; + button9.Tag = "8"; + button9.UseVisualStyleBackColor = true; + button9.Click += button_Click; + // + // button8 + // + button8.Font = new Font("Segoe UI", 50F, FontStyle.Regular, GraphicsUnit.Point); + button8.Location = new Point(129, 331); + button8.Margin = new Padding(3, 4, 3, 4); + button8.Name = "button8"; + button8.Size = new Size(114, 133); + button8.TabIndex = 16; + button8.Tag = "7"; + button8.UseVisualStyleBackColor = true; + button8.Click += button_Click; + // + // button7 + // + button7.Font = new Font("Segoe UI", 50F, FontStyle.Regular, GraphicsUnit.Point); + button7.Location = new Point(8, 331); + button7.Margin = new Padding(3, 4, 3, 4); + button7.Name = "button7"; + button7.Size = new Size(114, 133); + button7.TabIndex = 15; + button7.Tag = "6"; + button7.UseVisualStyleBackColor = true; + button7.Click += button_Click; + // + // button6 + // + button6.Font = new Font("Segoe UI", 50F, FontStyle.Regular, GraphicsUnit.Point); + button6.Location = new Point(250, 189); + button6.Margin = new Padding(3, 4, 3, 4); + button6.Name = "button6"; + button6.Size = new Size(114, 133); + button6.TabIndex = 14; + button6.Tag = "5"; + button6.UseVisualStyleBackColor = true; + button6.Click += button_Click; + // + // button5 + // + button5.Font = new Font("Segoe UI", 50F, FontStyle.Regular, GraphicsUnit.Point); + button5.Location = new Point(129, 189); + button5.Margin = new Padding(3, 4, 3, 4); + button5.Name = "button5"; + button5.Size = new Size(114, 133); + button5.TabIndex = 13; + button5.Tag = "4"; + button5.UseVisualStyleBackColor = true; + button5.Click += button_Click; + // + // button4 + // + button4.Font = new Font("Segoe UI", 50F, FontStyle.Regular, GraphicsUnit.Point); + button4.Location = new Point(8, 189); + button4.Margin = new Padding(3, 4, 3, 4); + button4.Name = "button4"; + button4.Size = new Size(114, 133); + button4.TabIndex = 12; + button4.Tag = "3"; + button4.UseVisualStyleBackColor = true; + button4.Click += button_Click; + // + // button3 + // + button3.Font = new Font("Segoe UI", 50F, FontStyle.Regular, GraphicsUnit.Point); + button3.Location = new Point(250, 48); + button3.Margin = new Padding(3, 4, 3, 4); + button3.Name = "button3"; + button3.Size = new Size(114, 133); + button3.TabIndex = 11; + button3.Tag = "2"; + button3.UseVisualStyleBackColor = true; + button3.Click += button_Click; + // + // button2 + // + button2.Font = new Font("Segoe UI", 50F, FontStyle.Regular, GraphicsUnit.Point); + button2.Location = new Point(129, 48); + button2.Margin = new Padding(3, 4, 3, 4); + button2.Name = "button2"; + button2.Size = new Size(114, 133); + button2.TabIndex = 10; + button2.Tag = "1"; + button2.UseVisualStyleBackColor = true; + button2.Click += button_Click; + // + // button1 + // + button1.Font = new Font("Segoe UI", 50F, FontStyle.Regular, GraphicsUnit.Point); + button1.Location = new Point(8, 48); + button1.Margin = new Padding(3, 4, 3, 4); + button1.Name = "button1"; + button1.Size = new Size(114, 133); + button1.TabIndex = 9; + button1.Tag = "0"; + button1.UseVisualStyleBackColor = true; + button1.Click += button_Click; + // + // tabPage3 + // + tabPage3.Controls.Add(label3); + tabPage3.Controls.Add(pictureBox2); + tabPage3.Controls.Add(groupBoxPoziomTrudnosci); + tabPage3.Controls.Add(groupBoxTypGry); + tabPage3.Location = new Point(4, 29); + tabPage3.Margin = new Padding(3, 4, 3, 4); + tabPage3.Name = "tabPage3"; + tabPage3.Padding = new Padding(3, 4, 3, 4); + tabPage3.Size = new Size(375, 564); + tabPage3.TabIndex = 2; + tabPage3.Text = "tabPage3"; + tabPage3.UseVisualStyleBackColor = true; + // + // label3 + // + label3.AutoSize = true; + label3.Font = new Font("Segoe UI", 16F, FontStyle.Bold, GraphicsUnit.Point); + label3.Location = new Point(100, 33); + label3.Name = "label3"; + label3.Size = new Size(159, 37); + label3.TabIndex = 22; + label3.Text = "Ustawienia"; + // + // pictureBox2 + // + pictureBox2.Image = Properties.Resources.back; + pictureBox2.Location = new Point(7, 533); + pictureBox2.Name = "pictureBox2"; + pictureBox2.Size = new Size(25, 25); + pictureBox2.SizeMode = PictureBoxSizeMode.StretchImage; + pictureBox2.TabIndex = 21; + pictureBox2.TabStop = false; + pictureBox2.Click += pictureBox_Click; + // + // groupBoxPoziomTrudnosci + // + groupBoxPoziomTrudnosci.Controls.Add(radioButtonTrudny); + groupBoxPoziomTrudnosci.Controls.Add(radioButtonSredni); + groupBoxPoziomTrudnosci.Controls.Add(radioButtonLatwy); + groupBoxPoziomTrudnosci.Location = new Point(23, 275); + groupBoxPoziomTrudnosci.Margin = new Padding(3, 4, 3, 4); + groupBoxPoziomTrudnosci.Name = "groupBoxPoziomTrudnosci"; + groupBoxPoziomTrudnosci.Padding = new Padding(3, 4, 3, 4); + groupBoxPoziomTrudnosci.Size = new Size(327, 159); + groupBoxPoziomTrudnosci.TabIndex = 18; + groupBoxPoziomTrudnosci.TabStop = false; + groupBoxPoziomTrudnosci.Text = "poziom trudności"; + // + // radioButtonTrudny + // + radioButtonTrudny.AutoSize = true; + radioButtonTrudny.Location = new Point(122, 107); + radioButtonTrudny.Margin = new Padding(3, 4, 3, 4); + radioButtonTrudny.Name = "radioButtonTrudny"; + radioButtonTrudny.Size = new Size(74, 24); + radioButtonTrudny.TabIndex = 17; + radioButtonTrudny.TabStop = true; + radioButtonTrudny.Text = "Trudny"; + radioButtonTrudny.UseVisualStyleBackColor = true; + radioButtonTrudny.CheckedChanged += radioButtonTrudny_CheckedChanged; + // + // radioButtonSredni + // + radioButtonSredni.AutoSize = true; + radioButtonSredni.Location = new Point(122, 73); + radioButtonSredni.Margin = new Padding(3, 4, 3, 4); + radioButtonSredni.Name = "radioButtonSredni"; + radioButtonSredni.Size = new Size(72, 24); + radioButtonSredni.TabIndex = 16; + radioButtonSredni.TabStop = true; + radioButtonSredni.Text = "Średni"; + radioButtonSredni.UseVisualStyleBackColor = true; + radioButtonSredni.CheckedChanged += radioButtonSredni_CheckedChanged; + // + // radioButtonLatwy + // + radioButtonLatwy.AutoSize = true; + radioButtonLatwy.Checked = true; + radioButtonLatwy.Location = new Point(122, 40); + radioButtonLatwy.Margin = new Padding(3, 4, 3, 4); + radioButtonLatwy.Name = "radioButtonLatwy"; + radioButtonLatwy.Size = new Size(68, 24); + radioButtonLatwy.TabIndex = 15; + radioButtonLatwy.TabStop = true; + radioButtonLatwy.Text = "Łatwy"; + radioButtonLatwy.UseVisualStyleBackColor = true; + radioButtonLatwy.CheckedChanged += radioButtonLatwy_CheckedChanged; + // + // groupBoxTypGry + // + groupBoxTypGry.Controls.Add(radioButtonMultiplayer); + groupBoxTypGry.Controls.Add(radioButtonZKomputerem); + groupBoxTypGry.Location = new Point(23, 99); + groupBoxTypGry.Margin = new Padding(3, 4, 3, 4); + groupBoxTypGry.Name = "groupBoxTypGry"; + groupBoxTypGry.Padding = new Padding(3, 4, 3, 4); + groupBoxTypGry.Size = new Size(327, 113); + groupBoxTypGry.TabIndex = 17; + groupBoxTypGry.TabStop = false; + groupBoxTypGry.Text = "typ gry"; + // + // radioButtonMultiplayer + // + radioButtonMultiplayer.AutoSize = true; + radioButtonMultiplayer.Location = new Point(173, 51); + radioButtonMultiplayer.Margin = new Padding(3, 4, 3, 4); + radioButtonMultiplayer.Name = "radioButtonMultiplayer"; + radioButtonMultiplayer.Size = new Size(105, 24); + radioButtonMultiplayer.TabIndex = 18; + radioButtonMultiplayer.Text = "multiplayer"; + radioButtonMultiplayer.UseVisualStyleBackColor = true; + radioButtonMultiplayer.CheckedChanged += radioButtonMultiplayer_CheckedChanged; + // + // radioButtonZKomputerem + // + radioButtonZKomputerem.AutoSize = true; + radioButtonZKomputerem.Checked = true; + radioButtonZKomputerem.Location = new Point(33, 48); + radioButtonZKomputerem.Margin = new Padding(3, 4, 3, 4); + radioButtonZKomputerem.Name = "radioButtonZKomputerem"; + radioButtonZKomputerem.Size = new Size(126, 24); + radioButtonZKomputerem.TabIndex = 17; + radioButtonZKomputerem.TabStop = true; + radioButtonZKomputerem.Text = "z komputerem"; + radioButtonZKomputerem.UseVisualStyleBackColor = true; + radioButtonZKomputerem.CheckedChanged += radioButtonZKomputerem_CheckedChanged; + // + // tabPage4 + // + tabPage4.Controls.Add(button10); + tabPage4.Controls.Add(label8); + tabPage4.Controls.Add(label7); + tabPage4.Controls.Add(label6); + tabPage4.Controls.Add(label5); + tabPage4.Controls.Add(label4); + tabPage4.Controls.Add(pictureBox3); + tabPage4.Location = new Point(4, 29); + tabPage4.Margin = new Padding(3, 4, 3, 4); + tabPage4.Name = "tabPage4"; + tabPage4.Padding = new Padding(3, 4, 3, 4); + tabPage4.Size = new Size(375, 564); + tabPage4.TabIndex = 3; + tabPage4.Text = "tabPage4"; + tabPage4.UseVisualStyleBackColor = true; + // + // button10 + // + button10.Location = new Point(131, 363); + button10.Name = "button10"; + button10.Size = new Size(124, 45); + button10.TabIndex = 28; + button10.Text = "resetuj wyniki"; + button10.UseVisualStyleBackColor = true; + button10.Click += button10_Click; + // + // label8 + // + label8.AutoSize = true; + label8.Font = new Font("Segoe UI", 12F, FontStyle.Bold, GraphicsUnit.Point); + label8.Location = new Point(232, 247); + label8.Name = "label8"; + label8.Size = new Size(24, 28); + label8.TabIndex = 27; + label8.Text = "0"; + // + // label7 + // + label7.AutoSize = true; + label7.Font = new Font("Segoe UI", 12F, FontStyle.Bold, GraphicsUnit.Point); + label7.Location = new Point(232, 161); + label7.Name = "label7"; + label7.Size = new Size(24, 28); + label7.TabIndex = 26; + label7.Text = "0"; + // + // label6 + // + label6.AutoSize = true; + label6.Location = new Point(89, 254); + label6.Name = "label6"; + label6.Size = new Size(120, 20); + label6.TabIndex = 25; + label6.Text = "Punkty gracza B: "; + // + // label5 + // + label5.AutoSize = true; + label5.Location = new Point(89, 169); + label5.Name = "label5"; + label5.Size = new Size(121, 20); + label5.TabIndex = 24; + label5.Text = "Punkty gracza A: "; + // + // label4 + // + label4.AutoSize = true; + label4.Font = new Font("Segoe UI", 16F, FontStyle.Bold, GraphicsUnit.Point); + label4.Location = new Point(131, 33); + label4.Name = "label4"; + label4.Size = new Size(106, 37); + label4.TabIndex = 23; + label4.Text = "Wyniki"; + // + // pictureBox3 + // + pictureBox3.Image = Properties.Resources.back; + pictureBox3.Location = new Point(7, 533); + pictureBox3.Name = "pictureBox3"; + pictureBox3.Size = new Size(25, 25); + pictureBox3.SizeMode = PictureBoxSizeMode.StretchImage; + pictureBox3.TabIndex = 21; + pictureBox3.TabStop = false; + pictureBox3.Click += pictureBox_Click; + // + // Form1 + // + AutoScaleDimensions = new SizeF(8F, 20F); + AutoScaleMode = AutoScaleMode.Font; + ClientSize = new Size(384, 600); + Controls.Add(tabControl1); + FormBorderStyle = FormBorderStyle.FixedSingle; + Margin = new Padding(3, 4, 3, 4); + MaximizeBox = false; + MinimizeBox = false; + Name = "Form1"; + Text = "Gra - Kółko i krzyżyk"; + tabControl1.ResumeLayout(false); + tabPage1.ResumeLayout(false); + tabPage1.PerformLayout(); + tabPage2.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)pictureBox1).EndInit(); + tabPage3.ResumeLayout(false); + tabPage3.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)pictureBox2).EndInit(); + groupBoxPoziomTrudnosci.ResumeLayout(false); + groupBoxPoziomTrudnosci.PerformLayout(); + groupBoxTypGry.ResumeLayout(false); + groupBoxTypGry.PerformLayout(); + tabPage4.ResumeLayout(false); + tabPage4.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)pictureBox3).EndInit(); + ResumeLayout(false); + } + + #endregion + + private TabControl tabControl1; + private TabPage tabPage1; + private TabPage tabPage2; + private Button button9; + private Button button8; + private Button button7; + private Button button6; + private Button button5; + private Button button4; + private Button button3; + private Button button2; + private Button button1; + private TabPage tabPage3; + private TabPage tabPage4; + private Button buttonHomeTabelaWynikow; + private Button buttonHomeUstawienia; + private Button buttonHomeGraj; + private ProgressBar progressBar1; + private GroupBox groupBoxPoziomTrudnosci; + private RadioButton radioButtonTrudny; + private RadioButton radioButtonSredni; + private RadioButton radioButtonLatwy; + private GroupBox groupBoxTypGry; + private RadioButton radioButtonMultiplayer; + private RadioButton radioButtonZKomputerem; + private Label label1; + private PictureBox pictureBox1; + private PictureBox pictureBox2; + private PictureBox pictureBox3; + private Label label2; + private Label label3; + private Label label4; + private Label label8; + private Label label7; + private Label label6; + private Label label5; + private Button button10; + } +} \ No newline at end of file diff --git a/[5]projekt/Form1.cs b/[5]projekt/Form1.cs new file mode 100644 index 0000000..a5eff9c --- /dev/null +++ b/[5]projekt/Form1.cs @@ -0,0 +1,504 @@ +using System; +using System.Windows.Forms; +using System.Threading.Tasks; + +namespace kolko_i_krzyzyk +{ + public partial class Form1 : Form + { + public enum EnumGracz + { + graczA, + graczB + }; + + private EnumGracz czyjaKolej = EnumGracz.graczA; + + private char graczA = 'X'; + private char graczB = 'O'; + private char[] plansza; + private Ustawienia ustawienia; + private Wyniki wyniki; + + public Form1() + { + InitializeComponent(); + ustawienia = new Ustawienia(); + wyniki = new Wyniki(); + tabControl1.Appearance = TabAppearance.FlatButtons; + tabControl1.ItemSize = new Size(0, 1); + tabControl1.SizeMode = TabSizeMode.Fixed; + resetujGre(); + + } + + #region PROGRAM + #region program-menu + private void buttonHomeGraj_Click(object sender, EventArgs e) + { + tabControl1.SelectTab(tabPage2); + resetujGre(); + } + + private void buttonHomeUstawienia_Click(object sender, EventArgs e) + { + tabControl1.SelectTab(tabPage3); + } + + private void buttonHomeTabelaWynikow_Click(object sender, EventArgs e) + { + label7.Text = wyniki.LiczbaPunktowGraczaA.ToString(); + label8.Text = wyniki.LiczbaPunktowGraczaB.ToString(); + tabControl1.SelectTab(tabPage4); + } + #endregion + + #region program-ustawienia + private void radioButtonZKomputerem_CheckedChanged(object sender, EventArgs e) + { + ustawienia.TypGry = Ustawienia.EnumTypGry.ZKomputerem; + radioButtonLatwy.Checked = true; + ustawienia.PoziomTrudnosci = Ustawienia.EnumPoziomTrudnosci.Latwy; + groupBoxPoziomTrudnosci.Visible = radioButtonZKomputerem.Checked; + } + + private void radioButtonMultiplayer_CheckedChanged(object sender, EventArgs e) + { + ustawienia.TypGry = Ustawienia.EnumTypGry.Multiplayer; + ustawienia.PoziomTrudnosci = Ustawienia.EnumPoziomTrudnosci.NieDotyczy; + groupBoxPoziomTrudnosci.Visible = radioButtonZKomputerem.Checked; + } + private void radioButtonLatwy_CheckedChanged(object sender, EventArgs e) + { + ustawienia.PoziomTrudnosci = Ustawienia.EnumPoziomTrudnosci.Latwy; + } + + private void radioButtonSredni_CheckedChanged(object sender, EventArgs e) + { + ustawienia.PoziomTrudnosci = Ustawienia.EnumPoziomTrudnosci.Sredni; + } + + private void radioButtonTrudny_CheckedChanged(object sender, EventArgs e) + { + ustawienia.PoziomTrudnosci = Ustawienia.EnumPoziomTrudnosci.Trudny; + } + + #endregion + + #region program-wyniki + private void button10_Click(object sender, EventArgs e) + { + wyniki.ResetujWyniki(); + label7.Text = wyniki.LiczbaPunktowGraczaA.ToString(); + label8.Text = wyniki.LiczbaPunktowGraczaB.ToString(); + } + #endregion + + #region program-sterowaniePoProgramie + private void pictureBox_Click(object sender, EventArgs e) + { + tabControl1.SelectTab(tabPage1); + } + #endregion + #endregion + + #region GRA + #region gra-sterowanie + private void resetujGre() + { + plansza = new char[9]; + for (int i = 0; i < 9; i++) + { + plansza[i] = ' '; + } + + aktualizujPrzyciski(); + + czyjaKolej = EnumGracz.graczA; + switch (ustawienia.TypGry) + { + case Ustawienia.EnumTypGry.ZKomputerem: + label1.Text = "Ruch gracza"; + break; + case Ustawienia.EnumTypGry.Multiplayer: + label1.Text = "Ruch gracza A"; + break; + } + + progressBar1.Visible = false; + } + + private void aktualizujPrzyciski() + { + button1.Text = plansza[0].ToString(); + button2.Text = plansza[1].ToString(); + button3.Text = plansza[2].ToString(); + button4.Text = plansza[3].ToString(); + button5.Text = plansza[4].ToString(); + button6.Text = plansza[5].ToString(); + button7.Text = plansza[6].ToString(); + button8.Text = plansza[7].ToString(); + button9.Text = plansza[8].ToString(); + } + + private void zmienKolejGracza() + { + switch (czyjaKolej) + { + case EnumGracz.graczA: + czyjaKolej = EnumGracz.graczB; + switch (ustawienia.TypGry) + { + case Ustawienia.EnumTypGry.ZKomputerem: + label1.Text = "Ruch komputera"; + break; + case Ustawienia.EnumTypGry.Multiplayer: + label1.Text = "Ruch gracza B"; + break; + } + break; + case EnumGracz.graczB: + czyjaKolej = EnumGracz.graczA; + switch (ustawienia.TypGry) + { + case Ustawienia.EnumTypGry.ZKomputerem: + label1.Text = "Ruch gracza"; + break; + case Ustawienia.EnumTypGry.Multiplayer: + label1.Text = "Ruch gracza A"; + break; + } + break; + } + } + #endregion + + #region gra-ruch + private void wykonajRuchGraczaA(int pole) + { + if (plansza[pole] == ' ') + { + plansza[pole] = graczA; + aktualizujPrzyciski(); + + bool koniecGry = sprawdzCzyKoniecGry(); + if (koniecGry) return; + + zmienKolejGracza(); + if (ustawienia.TypGry == Ustawienia.EnumTypGry.ZKomputerem) wykonajRuchGraczaB(-1); + } + } + + private void wykonajRuchGraczaB(int pole) + { + switch (ustawienia.TypGry) + { + case Ustawienia.EnumTypGry.ZKomputerem: + { + progressBar1.Value = 0; + progressBar1.Visible = true; + pokazPseudoMyslenieKomputera(); + + int ruch; + + switch (ustawienia.PoziomTrudnosci) + { + case Ustawienia.EnumPoziomTrudnosci.Latwy: + ruch = losowyRuch(); + break; + case Ustawienia.EnumPoziomTrudnosci.Sredni: + ruch = znajdzRuchSredni(); + break; + case Ustawienia.EnumPoziomTrudnosci.Trudny: + ruch = ZnajdzRuchTrudny(); + break; + default: + return; + } + + plansza[ruch] = graczB; + aktualizujPrzyciski(); + + bool koniecGry = sprawdzCzyKoniecGry(); + if (koniecGry) return; + + progressBar1.Visible = false; + break; + } + case Ustawienia.EnumTypGry.Multiplayer: + if (plansza[pole] == ' ') + { + plansza[pole] = graczB; + aktualizujPrzyciski(); + + bool koniecGry = sprawdzCzyKoniecGry(); + if (koniecGry) return; + } + break; + } + zmienKolejGracza(); + } + + private void button_Click(object sender, EventArgs e) + { + System.Windows.Forms.Button przycisk = (System.Windows.Forms.Button)sender; + int pole = Convert.ToInt32(przycisk.Tag); + + switch (czyjaKolej) + { + case EnumGracz.graczA: + wykonajRuchGraczaA(pole); + break; + case EnumGracz.graczB: + wykonajRuchGraczaB(pole); + break; + } + } + #endregion + + #region gra-wyborKomputera + private void pokazPseudoMyslenieKomputera() + { + int totalTime = 3000; + int updateInterval = 50; + + int progress = 0; + int increment = (int)Math.Ceiling(100.0 / (totalTime / updateInterval)); + + while (progress < 100) + { + progress += increment; + if (progress > 100) + progress = 100; + + progressBar1.Value = progress; + Task.Delay(updateInterval).Wait(); + } + } + + private int losowyRuch() + { + Random losowa = new Random(); + int ruch; + + do + { + ruch = losowa.Next(0, 9); + } + while (plansza[ruch] != ' '); + + return ruch; + } + + private int znajdzRuchSredni() + { + // Sprawd, czy moemy wygra + for (int i = 0; i < 9; i++) + { + if (plansza[i] == ' ') + { + plansza[i] = graczB; + if (sprawdzCzyWygrana(graczB)) + { + plansza[i] = ' '; + return i; + } + plansza[i] = ' '; + } + } + + // Sprawd, czy przeciwnik moe wygra + for (int i = 0; i < 9; i++) + { + if (plansza[i] == ' ') + { + plansza[i] = graczA; + if (sprawdzCzyWygrana(graczA)) + { + plansza[i] = ' '; + return i; + } + plansza[i] = ' '; + } + } + + // Wykonaj ruch rodkowy + if (plansza[4] == ' ') + { + return 4; + } + + // Wykonaj ruch w pobliu istniejcego symbolu + int[] preferredMoves = { 0, 2, 6, 8 }; + + foreach (int move in preferredMoves) + { + if (plansza[move] == ' ') + { + return move; + } + } + + // Wykonaj dowolny dostpny ruch + for (int i = 0; i < 9; i++) + { + if (plansza[i] == ' ') + { + return i; + } + } + + return -1; // Ten kod nie zostanie osignity, ale kompilator wymaga zwrotu wartoci + } + + private int ZnajdzRuchTrudny() + { + int najlepszyRuch = -1; + int najlepszyWynik = int.MinValue; + + for (int i = 0; i < 9; i++) + { + if (plansza[i] == ' ') + { + plansza[i] = graczB; + int wynik = Minimax(0, false); + plansza[i] = ' '; + + if (wynik > najlepszyWynik) + { + najlepszyWynik = wynik; + najlepszyRuch = i; + } + } + } + return najlepszyRuch; + } + + private int Minimax(int depth, bool isMaximizingPlayer) + { + if (sprawdzCzyWygrana(graczA)) + { + return -10 + depth; + } + else if (sprawdzCzyWygrana(graczB)) + { + return 10 - depth; + } + else if (sprawdzCzyPlanszaPelna()) + { + return 0; + } + + if (isMaximizingPlayer) + { + int bestScore = int.MinValue; + + for (int i = 0; i < 9; i++) + { + if (plansza[i] == ' ') + { + plansza[i] = graczB; + int score = Minimax(depth + 1, false); + plansza[i] = ' '; + bestScore = Math.Max(score, bestScore); + } + } + + return bestScore; + } + else + { + int bestScore = int.MaxValue; + + for (int i = 0; i < 9; i++) + { + if (plansza[i] == ' ') + { + plansza[i] = graczA; + int score = Minimax(depth + 1, true); + plansza[i] = ' '; + bestScore = Math.Min(score, bestScore); + } + } + + return bestScore; + } + } + #endregion + + #region gra-sprawdzaniePlanszy + private bool sprawdzCzyPlanszaPelna() + { + foreach (char pole in plansza) + { + if (pole == ' ') + { + return false; + } + } + + return true; + } + + private bool sprawdzCzyKoniecGry() + { + if (czyjaKolej == EnumGracz.graczA && sprawdzCzyWygrana(graczA)) + { + switch (ustawienia.TypGry) + { + case Ustawienia.EnumTypGry.ZKomputerem: + MessageBox.Show("Wygrae!"); + break; + case Ustawienia.EnumTypGry.Multiplayer: + MessageBox.Show("Wygra gracz A!"); + break; + } + wyniki.DodajPunkt(EnumGracz.graczA); + resetujGre(); + return true; + } + + else if (czyjaKolej == EnumGracz.graczB && sprawdzCzyWygrana(graczB)) + { + switch (ustawienia.TypGry) + { + case Ustawienia.EnumTypGry.ZKomputerem: + MessageBox.Show("Wygra komputer!"); + break; + case Ustawienia.EnumTypGry.Multiplayer: + MessageBox.Show("Wygra gracz B!"); + break; + } + wyniki.DodajPunkt(EnumGracz.graczB); + resetujGre(); + return true; + } + + else if (sprawdzCzyPlanszaPelna()) + { + MessageBox.Show("Remis!"); + resetujGre(); + return true; + } + return false; + } + + private bool sprawdzCzyWygrana(char symbol) + { + return ( + (plansza[0] == symbol && plansza[1] == symbol && plansza[2] == symbol) || + (plansza[3] == symbol && plansza[4] == symbol && plansza[5] == symbol) || + (plansza[6] == symbol && plansza[7] == symbol && plansza[8] == symbol) || + (plansza[0] == symbol && plansza[3] == symbol && plansza[6] == symbol) || + (plansza[1] == symbol && plansza[4] == symbol && plansza[7] == symbol) || + (plansza[2] == symbol && plansza[5] == symbol && plansza[8] == symbol) || + (plansza[0] == symbol && plansza[4] == symbol && plansza[8] == symbol) || + (plansza[2] == symbol && plansza[4] == symbol && plansza[6] == symbol) + ); + } + + #endregion + #endregion + + } +} diff --git a/[5]projekt/Form1.resx b/[5]projekt/Form1.resx new file mode 100644 index 0000000..a395bff --- /dev/null +++ b/[5]projekt/Form1.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/[5]projekt/Program.cs b/[5]projekt/Program.cs new file mode 100644 index 0000000..ccb372d --- /dev/null +++ b/[5]projekt/Program.cs @@ -0,0 +1,17 @@ +namespace kolko_i_krzyzyk +{ + internal static class Program + { + /// + /// The main entry point for the application. + /// + [STAThread] + static void Main() + { + // To customize application configuration such as set high DPI settings or default font, + // see https://aka.ms/applicationconfiguration. + ApplicationConfiguration.Initialize(); + Application.Run(new Form1()); + } + } +} \ No newline at end of file diff --git a/[5]projekt/Properties/Resources.Designer.cs b/[5]projekt/Properties/Resources.Designer.cs new file mode 100644 index 0000000..bd3c630 --- /dev/null +++ b/[5]projekt/Properties/Resources.Designer.cs @@ -0,0 +1,73 @@ +//------------------------------------------------------------------------------ +// +// Ten kod został wygenerowany przez narzędzie. +// Wersja wykonawcza:4.0.30319.42000 +// +// Zmiany w tym pliku mogą spowodować nieprawidłowe zachowanie i zostaną utracone, jeśli +// kod zostanie ponownie wygenerowany. +// +//------------------------------------------------------------------------------ + +namespace kolko_i_krzyzyk.Properties { + using System; + + + /// + /// Klasa zasobu wymagająca zdefiniowania typu do wyszukiwania zlokalizowanych ciągów itd. + /// + // Ta klasa została automatycznie wygenerowana za pomocą klasy StronglyTypedResourceBuilder + // przez narzędzie, takie jak ResGen lub Visual Studio. + // Aby dodać lub usunąć składową, edytuj plik ResX, a następnie ponownie uruchom narzędzie ResGen + // z opcją /str lub ponownie utwórz projekt VS. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// + /// Zwraca buforowane wystąpienie ResourceManager używane przez tę klasę. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("kolko_i_krzyzyk.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Przesłania właściwość CurrentUICulture bieżącego wątku dla wszystkich + /// przypadków przeszukiwania zasobów za pomocą tej klasy zasobów wymagającej zdefiniowania typu. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Wyszukuje zlokalizowany zasób typu System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap back { + get { + object obj = ResourceManager.GetObject("back", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + } +} diff --git a/[5]projekt/Properties/Resources.resx b/[5]projekt/Properties/Resources.resx new file mode 100644 index 0000000..0a92bd2 --- /dev/null +++ b/[5]projekt/Properties/Resources.resx @@ -0,0 +1,124 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + ..\files\back.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + \ No newline at end of file diff --git a/[5]projekt/Ustawienia.cs b/[5]projekt/Ustawienia.cs new file mode 100644 index 0000000..f13ddc0 --- /dev/null +++ b/[5]projekt/Ustawienia.cs @@ -0,0 +1,47 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace kolko_i_krzyzyk +{ + internal class Ustawienia + { + public enum EnumPoziomTrudnosci + { + Latwy, + Sredni, + Trudny, + NieDotyczy + } + + public enum EnumTypGry + { + ZKomputerem, + Multiplayer + } + + private EnumPoziomTrudnosci poziomTrudnosci; + + public EnumPoziomTrudnosci PoziomTrudnosci + { + get { return poziomTrudnosci; } + set { poziomTrudnosci = value; } + } + + private EnumTypGry typGry; + + public EnumTypGry TypGry + { + get { return typGry; } + set { typGry = value; } + } + + public Ustawienia(EnumTypGry typGry = EnumTypGry.ZKomputerem, EnumPoziomTrudnosci poziomTrudnosci = EnumPoziomTrudnosci.Latwy) + { + this.TypGry = typGry; + this.PoziomTrudnosci = poziomTrudnosci; + } + } +} diff --git a/[5]projekt/Wyniki.cs b/[5]projekt/Wyniki.cs new file mode 100644 index 0000000..b3b2cdf --- /dev/null +++ b/[5]projekt/Wyniki.cs @@ -0,0 +1,42 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace kolko_i_krzyzyk +{ + internal class Wyniki + { + private int liczbaPunktowGraczaA; + public int LiczbaPunktowGraczaA { get { return liczbaPunktowGraczaA; } } + + private int liczbaPunktowGraczaB; + public int LiczbaPunktowGraczaB { get { return liczbaPunktowGraczaB; } } + + public Wyniki() + { + liczbaPunktowGraczaA = 0; + liczbaPunktowGraczaB = 0; + } + + public void DodajPunkt(Form1.EnumGracz gracz) + { + switch (gracz) + { + case Form1.EnumGracz.graczA: + liczbaPunktowGraczaA++; + break; + case Form1.EnumGracz.graczB: + liczbaPunktowGraczaB++; + break; + } + } + + public void ResetujWyniki() + { + liczbaPunktowGraczaA = 0; + liczbaPunktowGraczaB = 0; + } + } +} diff --git a/[5]projekt/files/back.png b/[5]projekt/files/back.png new file mode 100644 index 0000000000000000000000000000000000000000..aafa5a63c7e3457dd2b7341256f6c79a8e2726c7 GIT binary patch literal 2754 zcmeHJ`BxKH6rRLJS)^D+5P{Ox4G>1b)5cUGse*t&u*|OE%VVk3q^L7_kH=_Hu-oAc20|JA;BS%qUsIf=l zjvhNsJ9#SpY{E~8$rmoBUP{Ygve=w!S=VpmqvKS5#agC>4szetqy;d4>2< zbxnQ4y(%952X=!b1mv(kNe<6GMS9kxw;Lz~M-}2X^W8)JFrE0To>`n+;5bSLK zjn@w?y-#BqNfcvo#8s!Xg)N?*DIWP`&Y8!h9-&XRXs^0xZ;`P0(zS{Lm-$=MGNc=N zq+eU77rXD{b`OtlK8cey#q|}}30#H8<-$YFTOaw5Lv8E; z%B0@kj|`=CKM^5L$x6ZEMSY~0B2ocutOmtVK1zm{^^)%4g0Eq3F;sgKjkZlN_9lT) zW@Pz(#HP}aqtxBikyNSr(}a3nzD{@J_XSA9FK|W=DXj#!Wt~LeW=2%)N0g`9Y$U>{ z69KCy80F#q6QQjDvrLONmn->g@ahI8Bd`tK%Uoh)Uoh1 zm11mIHpk(&eyUR3I>4-)buR10S6Pou;qdJ4`_C@LKS0c8!?`zyeF%Q4VPT8$jN`cc zHpMhLR@LZ>WdL@?D)H!h{N4c2OqzaG^ApI)k?&7f|6*|NR8wsgW2{jAsBZ*SRX%IJ z+0zJ#{Bs{x2jGzSZ8iT@>%))7BR`HNM^{^nn@;oS?=0=Ao4kozd1SlUVoj&19c1Sr z)W04JWB3f($bEz%U?vT?w-0=!sx-QtKpWZJX)5R@4kouBP&F{?%kf9L#~kxAX!6YG zEJ2NeL#=dHHSmS6RnnonfwZBz_U$T3s|X*rX>?z|uSzoE07+W=+zIl=xW(xLo?v0R zz(BC*vfxa+*2DG-OMuC4|F||&_w?!hZKj&q()pP0`}Iw=b)^%f%Tfg0$G)^Y>T(W! z6&u7s=VJ@JQIdn_eZgx4z1HY0!)$bCF)q z(&jLX8QZ#*qbBgSRvn(qYHY%~yyH39`+^_Ak)yS&H~meLWg%SvI+=@dcp1|Zy<<6Z zP7u|QEd1bP^vu3Ej2UQLi8&wP3aH$SWFEJFuk{?^2q;5l)+{YY!ttP^T7k(a{C1-l zxR6y?@0nOPFvdQU+RtH1Xv_ljiT=6hX$@w80a|2oK3cDyjfSaemQ#Y|c#1xsn(K(* z*rXnt=3exiW^XCjho!th}r^;^Z>TQn*mIEJiV$<{-fT&*{vZ41DTtEkrAk%x?}@zZ>|LF`2d&Q! zh(UE-u_~e08C&t`&f)rjqIg(8kRaQ*;2bQ2|D=?{Nz>* literal 0 HcmV?d00001 diff --git a/[5]projekt/kolko_i_krzyzyk.csproj b/[5]projekt/kolko_i_krzyzyk.csproj new file mode 100644 index 0000000..13ee123 --- /dev/null +++ b/[5]projekt/kolko_i_krzyzyk.csproj @@ -0,0 +1,26 @@ + + + + WinExe + net6.0-windows + enable + true + enable + + + + + True + True + Resources.resx + + + + + + ResXFileCodeGenerator + Resources.Designer.cs + + + + \ No newline at end of file