Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #pragma once
- namespace Löfferschöck {
- using namespace System;
- using namespace System::ComponentModel;
- using namespace System::Collections;
- using namespace System::Windows::Forms;
- using namespace System::Data;
- using namespace System::Drawing;
- using namespace std;
- /// <summary>
- /// Summary for Form1
- /// </summary>
- public ref class Form1 : public System::Windows::Forms::Form
- {
- public:
- Form1(void)
- {
- InitializeComponent();
- //
- //TODO: Add the constructor code here
- //
- }
- protected:
- /// <summary>
- /// Clean up any resources being used.
- /// </summary>
- ~Form1()
- {
- if (components)
- {
- delete components;
- }
- }
- private: System::Windows::Forms::Button^ button1;
- private: System::Windows::Forms::Label^ currentPlayer;
- private: System::Windows::Forms::Button^ button2;
- private: System::Windows::Forms::Button^ debugger;
- private: System::Windows::Forms::Button^ button3;
- private: System::Windows::Forms::Button^ button4;
- private: System::Windows::Forms::Button^ button5;
- private: System::Windows::Forms::Button^ button6;
- private: System::Windows::Forms::Button^ button7;
- private: System::Windows::Forms::Button^ button8;
- private: System::Windows::Forms::Button^ button9;
- private: System::Windows::Forms::Button^ c1;
- private: System::Windows::Forms::Button^ c2;
- private: System::Windows::Forms::Button^ c3;
- private: System::Windows::Forms::Button^ c4;
- private: System::Windows::Forms::Button^ c5;
- private: System::Windows::Forms::Button^ c6;
- private: System::Windows::Forms::Button^ c7;
- private: System::Windows::Forms::Button^ c8;
- private: System::Windows::Forms::Button^ c9;
- private: System::Windows::Forms::Label^ label1;
- protected:
- private:
- /// <summary>
- /// Required designer variable.
- /// </summary>
- System::ComponentModel::Container ^components;
- #pragma region Windows Form Designer generated code
- /// <summary>
- /// Required method for Designer support - do not modify
- /// the contents of this method with the code editor.
- /// </summary>
- void InitializeComponent(void)
- {
- this->button1 = (gcnew System::Windows::Forms::Button());
- this->currentPlayer = (gcnew System::Windows::Forms::Label());
- this->button2 = (gcnew System::Windows::Forms::Button());
- this->debugger = (gcnew System::Windows::Forms::Button());
- this->button3 = (gcnew System::Windows::Forms::Button());
- this->button4 = (gcnew System::Windows::Forms::Button());
- this->button5 = (gcnew System::Windows::Forms::Button());
- this->button6 = (gcnew System::Windows::Forms::Button());
- this->button7 = (gcnew System::Windows::Forms::Button());
- this->button8 = (gcnew System::Windows::Forms::Button());
- this->button9 = (gcnew System::Windows::Forms::Button());
- this->c1 = (gcnew System::Windows::Forms::Button());
- this->c2 = (gcnew System::Windows::Forms::Button());
- this->c3 = (gcnew System::Windows::Forms::Button());
- this->c4 = (gcnew System::Windows::Forms::Button());
- this->c5 = (gcnew System::Windows::Forms::Button());
- this->c6 = (gcnew System::Windows::Forms::Button());
- this->c7 = (gcnew System::Windows::Forms::Button());
- this->c8 = (gcnew System::Windows::Forms::Button());
- this->c9 = (gcnew System::Windows::Forms::Button());
- this->label1 = (gcnew System::Windows::Forms::Label());
- this->SuspendLayout();
- //
- // button1
- //
- this->button1->BackColor = System::Drawing::Color::FromArgb(static_cast<System::Int32>(static_cast<System::Byte>(30)), static_cast<System::Int32>(static_cast<System::Byte>(30)),
- static_cast<System::Int32>(static_cast<System::Byte>(30)));
- this->button1->FlatStyle = System::Windows::Forms::FlatStyle::Flat;
- this->button1->Font = (gcnew System::Drawing::Font(L"MicroSquare", 14.25F, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point,
- static_cast<System::Byte>(0)));
- this->button1->ForeColor = System::Drawing::Color::FromArgb(static_cast<System::Int32>(static_cast<System::Byte>(192)), static_cast<System::Int32>(static_cast<System::Byte>(0)),
- static_cast<System::Int32>(static_cast<System::Byte>(0)));
- this->button1->Location = System::Drawing::Point(12, 12);
- this->button1->Name = L"button1";
- this->button1->Size = System::Drawing::Size(35, 35);
- this->button1->TabIndex = 0;
- this->button1->Text = L" ";
- this->button1->UseVisualStyleBackColor = false;
- this->button1->Click += gcnew System::EventHandler(this, &Form1::button1_Click);
- //
- // currentPlayer
- //
- this->currentPlayer->AutoSize = true;
- this->currentPlayer->ForeColor = System::Drawing::Color::FromArgb(static_cast<System::Int32>(static_cast<System::Byte>(192)), static_cast<System::Int32>(static_cast<System::Byte>(0)),
- static_cast<System::Int32>(static_cast<System::Byte>(0)));
- this->currentPlayer->Location = System::Drawing::Point(12, 132);
- this->currentPlayer->Name = L"currentPlayer";
- this->currentPlayer->Size = System::Drawing::Size(45, 13);
- this->currentPlayer->TabIndex = 1;
- this->currentPlayer->Text = L"Player 1";
- this->currentPlayer->Click += gcnew System::EventHandler(this, &Form1::currentPlayer_Click);
- //
- // button2
- //
- this->button2->BackColor = System::Drawing::Color::FromArgb(static_cast<System::Int32>(static_cast<System::Byte>(30)), static_cast<System::Int32>(static_cast<System::Byte>(30)),
- static_cast<System::Int32>(static_cast<System::Byte>(30)));
- this->button2->FlatStyle = System::Windows::Forms::FlatStyle::Flat;
- this->button2->Font = (gcnew System::Drawing::Font(L"MicroSquare", 14.25F, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point,
- static_cast<System::Byte>(0)));
- this->button2->ForeColor = System::Drawing::Color::FromArgb(static_cast<System::Int32>(static_cast<System::Byte>(192)), static_cast<System::Int32>(static_cast<System::Byte>(0)),
- static_cast<System::Int32>(static_cast<System::Byte>(0)));
- this->button2->Location = System::Drawing::Point(53, 12);
- this->button2->Name = L"button2";
- this->button2->Size = System::Drawing::Size(35, 35);
- this->button2->TabIndex = 2;
- this->button2->UseVisualStyleBackColor = false;
- this->button2->Click += gcnew System::EventHandler(this, &Form1::button2_Click);
- //
- // debugger
- //
- this->debugger->Location = System::Drawing::Point(159, 23);
- this->debugger->Name = L"debugger";
- this->debugger->Size = System::Drawing::Size(125, 96);
- this->debugger->TabIndex = 3;
- this->debugger->UseVisualStyleBackColor = true;
- this->debugger->Click += gcnew System::EventHandler(this, &Form1::debugger_Click);
- //
- // button3
- //
- this->button3->BackColor = System::Drawing::Color::FromArgb(static_cast<System::Int32>(static_cast<System::Byte>(30)), static_cast<System::Int32>(static_cast<System::Byte>(30)),
- static_cast<System::Int32>(static_cast<System::Byte>(30)));
- this->button3->FlatStyle = System::Windows::Forms::FlatStyle::Flat;
- this->button3->Font = (gcnew System::Drawing::Font(L"MicroSquare", 14.25F, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point,
- static_cast<System::Byte>(0)));
- this->button3->ForeColor = System::Drawing::Color::FromArgb(static_cast<System::Int32>(static_cast<System::Byte>(192)), static_cast<System::Int32>(static_cast<System::Byte>(0)),
- static_cast<System::Int32>(static_cast<System::Byte>(0)));
- this->button3->Location = System::Drawing::Point(95, 13);
- this->button3->Name = L"button3";
- this->button3->Size = System::Drawing::Size(35, 35);
- this->button3->TabIndex = 4;
- this->button3->UseVisualStyleBackColor = false;
- this->button3->Click += gcnew System::EventHandler(this, &Form1::button3_Click);
- //
- // button4
- //
- this->button4->BackColor = System::Drawing::Color::FromArgb(static_cast<System::Int32>(static_cast<System::Byte>(30)), static_cast<System::Int32>(static_cast<System::Byte>(30)),
- static_cast<System::Int32>(static_cast<System::Byte>(30)));
- this->button4->FlatStyle = System::Windows::Forms::FlatStyle::Flat;
- this->button4->Font = (gcnew System::Drawing::Font(L"MicroSquare", 14.25F, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point,
- static_cast<System::Byte>(0)));
- this->button4->ForeColor = System::Drawing::Color::FromArgb(static_cast<System::Int32>(static_cast<System::Byte>(192)), static_cast<System::Int32>(static_cast<System::Byte>(0)),
- static_cast<System::Int32>(static_cast<System::Byte>(0)));
- this->button4->Location = System::Drawing::Point(12, 53);
- this->button4->Name = L"button4";
- this->button4->Size = System::Drawing::Size(35, 35);
- this->button4->TabIndex = 5;
- this->button4->UseVisualStyleBackColor = false;
- this->button4->Click += gcnew System::EventHandler(this, &Form1::button4_Click);
- //
- // button5
- //
- this->button5->BackColor = System::Drawing::Color::FromArgb(static_cast<System::Int32>(static_cast<System::Byte>(30)), static_cast<System::Int32>(static_cast<System::Byte>(30)),
- static_cast<System::Int32>(static_cast<System::Byte>(30)));
- this->button5->FlatStyle = System::Windows::Forms::FlatStyle::Flat;
- this->button5->Font = (gcnew System::Drawing::Font(L"MicroSquare", 14.25F, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point,
- static_cast<System::Byte>(0)));
- this->button5->ForeColor = System::Drawing::Color::FromArgb(static_cast<System::Int32>(static_cast<System::Byte>(192)), static_cast<System::Int32>(static_cast<System::Byte>(0)),
- static_cast<System::Int32>(static_cast<System::Byte>(0)));
- this->button5->Location = System::Drawing::Point(53, 53);
- this->button5->Name = L"button5";
- this->button5->Size = System::Drawing::Size(35, 35);
- this->button5->TabIndex = 6;
- this->button5->UseVisualStyleBackColor = false;
- this->button5->Click += gcnew System::EventHandler(this, &Form1::button5_Click);
- //
- // button6
- //
- this->button6->BackColor = System::Drawing::Color::FromArgb(static_cast<System::Int32>(static_cast<System::Byte>(30)), static_cast<System::Int32>(static_cast<System::Byte>(30)),
- static_cast<System::Int32>(static_cast<System::Byte>(30)));
- this->button6->FlatStyle = System::Windows::Forms::FlatStyle::Flat;
- this->button6->Font = (gcnew System::Drawing::Font(L"MicroSquare", 14.25F, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point,
- static_cast<System::Byte>(0)));
- this->button6->ForeColor = System::Drawing::Color::FromArgb(static_cast<System::Int32>(static_cast<System::Byte>(192)), static_cast<System::Int32>(static_cast<System::Byte>(0)),
- static_cast<System::Int32>(static_cast<System::Byte>(0)));
- this->button6->Location = System::Drawing::Point(94, 54);
- this->button6->Name = L"button6";
- this->button6->Size = System::Drawing::Size(35, 35);
- this->button6->TabIndex = 7;
- this->button6->UseVisualStyleBackColor = false;
- this->button6->Click += gcnew System::EventHandler(this, &Form1::button6_Click);
- //
- // button7
- //
- this->button7->BackColor = System::Drawing::Color::FromArgb(static_cast<System::Int32>(static_cast<System::Byte>(30)), static_cast<System::Int32>(static_cast<System::Byte>(30)),
- static_cast<System::Int32>(static_cast<System::Byte>(30)));
- this->button7->FlatStyle = System::Windows::Forms::FlatStyle::Flat;
- this->button7->Font = (gcnew System::Drawing::Font(L"MicroSquare", 14.25F, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point,
- static_cast<System::Byte>(0)));
- this->button7->ForeColor = System::Drawing::Color::FromArgb(static_cast<System::Int32>(static_cast<System::Byte>(192)), static_cast<System::Int32>(static_cast<System::Byte>(0)),
- static_cast<System::Int32>(static_cast<System::Byte>(0)));
- this->button7->Location = System::Drawing::Point(12, 94);
- this->button7->Name = L"button7";
- this->button7->Size = System::Drawing::Size(35, 35);
- this->button7->TabIndex = 8;
- this->button7->UseVisualStyleBackColor = false;
- this->button7->Click += gcnew System::EventHandler(this, &Form1::button7_Click);
- //
- // button8
- //
- this->button8->BackColor = System::Drawing::Color::FromArgb(static_cast<System::Int32>(static_cast<System::Byte>(30)), static_cast<System::Int32>(static_cast<System::Byte>(30)),
- static_cast<System::Int32>(static_cast<System::Byte>(30)));
- this->button8->FlatStyle = System::Windows::Forms::FlatStyle::Flat;
- this->button8->Font = (gcnew System::Drawing::Font(L"MicroSquare", 14.25F, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point,
- static_cast<System::Byte>(0)));
- this->button8->ForeColor = System::Drawing::Color::FromArgb(static_cast<System::Int32>(static_cast<System::Byte>(192)), static_cast<System::Int32>(static_cast<System::Byte>(0)),
- static_cast<System::Int32>(static_cast<System::Byte>(0)));
- this->button8->Location = System::Drawing::Point(53, 94);
- this->button8->Name = L"button8";
- this->button8->Size = System::Drawing::Size(35, 35);
- this->button8->TabIndex = 9;
- this->button8->UseVisualStyleBackColor = false;
- this->button8->Click += gcnew System::EventHandler(this, &Form1::button8_Click);
- //
- // button9
- //
- this->button9->BackColor = System::Drawing::Color::FromArgb(static_cast<System::Int32>(static_cast<System::Byte>(30)), static_cast<System::Int32>(static_cast<System::Byte>(30)),
- static_cast<System::Int32>(static_cast<System::Byte>(30)));
- this->button9->FlatStyle = System::Windows::Forms::FlatStyle::Flat;
- this->button9->Font = (gcnew System::Drawing::Font(L"MicroSquare", 14.25F, System::Drawing::FontStyle::Bold, System::Drawing::GraphicsUnit::Point,
- static_cast<System::Byte>(0)));
- this->button9->ForeColor = System::Drawing::Color::FromArgb(static_cast<System::Int32>(static_cast<System::Byte>(192)), static_cast<System::Int32>(static_cast<System::Byte>(0)),
- static_cast<System::Int32>(static_cast<System::Byte>(0)));
- this->button9->Location = System::Drawing::Point(95, 95);
- this->button9->Name = L"button9";
- this->button9->Size = System::Drawing::Size(35, 35);
- this->button9->TabIndex = 10;
- this->button9->UseVisualStyleBackColor = false;
- this->button9->Click += gcnew System::EventHandler(this, &Form1::button9_Click);
- //
- // c1
- //
- this->c1->BackColor = System::Drawing::Color::Black;
- this->c1->FlatStyle = System::Windows::Forms::FlatStyle::Flat;
- this->c1->ForeColor = System::Drawing::Color::FromArgb(static_cast<System::Int32>(static_cast<System::Byte>(192)), static_cast<System::Int32>(static_cast<System::Byte>(0)),
- static_cast<System::Int32>(static_cast<System::Byte>(0)));
- this->c1->Location = System::Drawing::Point(22, 155);
- this->c1->Name = L"c1";
- this->c1->Size = System::Drawing::Size(25, 25);
- this->c1->TabIndex = 11;
- this->c1->Text = L"1";
- this->c1->UseVisualStyleBackColor = false;
- //
- // c2
- //
- this->c2->BackColor = System::Drawing::Color::Black;
- this->c2->FlatStyle = System::Windows::Forms::FlatStyle::Flat;
- this->c2->ForeColor = System::Drawing::Color::FromArgb(static_cast<System::Int32>(static_cast<System::Byte>(192)), static_cast<System::Int32>(static_cast<System::Byte>(0)),
- static_cast<System::Int32>(static_cast<System::Byte>(0)));
- this->c2->Location = System::Drawing::Point(48, 155);
- this->c2->Name = L"c2";
- this->c2->Size = System::Drawing::Size(25, 25);
- this->c2->TabIndex = 12;
- this->c2->Text = L"2";
- this->c2->UseVisualStyleBackColor = false;
- //
- // c3
- //
- this->c3->BackColor = System::Drawing::Color::Black;
- this->c3->FlatStyle = System::Windows::Forms::FlatStyle::Flat;
- this->c3->ForeColor = System::Drawing::Color::FromArgb(static_cast<System::Int32>(static_cast<System::Byte>(192)), static_cast<System::Int32>(static_cast<System::Byte>(0)),
- static_cast<System::Int32>(static_cast<System::Byte>(0)));
- this->c3->Location = System::Drawing::Point(74, 155);
- this->c3->Name = L"c3";
- this->c3->Size = System::Drawing::Size(25, 25);
- this->c3->TabIndex = 13;
- this->c3->Text = L"3";
- this->c3->UseVisualStyleBackColor = false;
- //
- // c4
- //
- this->c4->BackColor = System::Drawing::Color::Black;
- this->c4->FlatStyle = System::Windows::Forms::FlatStyle::Flat;
- this->c4->ForeColor = System::Drawing::Color::FromArgb(static_cast<System::Int32>(static_cast<System::Byte>(192)), static_cast<System::Int32>(static_cast<System::Byte>(0)),
- static_cast<System::Int32>(static_cast<System::Byte>(0)));
- this->c4->Location = System::Drawing::Point(22, 181);
- this->c4->Name = L"c4";
- this->c4->Size = System::Drawing::Size(25, 25);
- this->c4->TabIndex = 14;
- this->c4->Text = L"4";
- this->c4->UseVisualStyleBackColor = false;
- //
- // c5
- //
- this->c5->BackColor = System::Drawing::Color::Black;
- this->c5->FlatStyle = System::Windows::Forms::FlatStyle::Flat;
- this->c5->ForeColor = System::Drawing::Color::FromArgb(static_cast<System::Int32>(static_cast<System::Byte>(192)), static_cast<System::Int32>(static_cast<System::Byte>(0)),
- static_cast<System::Int32>(static_cast<System::Byte>(0)));
- this->c5->Location = System::Drawing::Point(48, 181);
- this->c5->Name = L"c5";
- this->c5->Size = System::Drawing::Size(25, 25);
- this->c5->TabIndex = 15;
- this->c5->Text = L"5";
- this->c5->UseVisualStyleBackColor = false;
- //
- // c6
- //
- this->c6->BackColor = System::Drawing::Color::Black;
- this->c6->FlatStyle = System::Windows::Forms::FlatStyle::Flat;
- this->c6->ForeColor = System::Drawing::Color::FromArgb(static_cast<System::Int32>(static_cast<System::Byte>(192)), static_cast<System::Int32>(static_cast<System::Byte>(0)),
- static_cast<System::Int32>(static_cast<System::Byte>(0)));
- this->c6->Location = System::Drawing::Point(74, 181);
- this->c6->Name = L"c6";
- this->c6->Size = System::Drawing::Size(25, 25);
- this->c6->TabIndex = 16;
- this->c6->Text = L"6";
- this->c6->UseVisualStyleBackColor = false;
- this->c6->Click += gcnew System::EventHandler(this, &Form1::button15_Click);
- //
- // c7
- //
- this->c7->BackColor = System::Drawing::Color::Black;
- this->c7->FlatStyle = System::Windows::Forms::FlatStyle::Flat;
- this->c7->ForeColor = System::Drawing::Color::FromArgb(static_cast<System::Int32>(static_cast<System::Byte>(192)), static_cast<System::Int32>(static_cast<System::Byte>(0)),
- static_cast<System::Int32>(static_cast<System::Byte>(0)));
- this->c7->Location = System::Drawing::Point(22, 207);
- this->c7->Name = L"c7";
- this->c7->Size = System::Drawing::Size(25, 25);
- this->c7->TabIndex = 17;
- this->c7->Text = L"7";
- this->c7->UseVisualStyleBackColor = false;
- //
- // c8
- //
- this->c8->BackColor = System::Drawing::Color::Black;
- this->c8->FlatStyle = System::Windows::Forms::FlatStyle::Flat;
- this->c8->ForeColor = System::Drawing::Color::FromArgb(static_cast<System::Int32>(static_cast<System::Byte>(192)), static_cast<System::Int32>(static_cast<System::Byte>(0)),
- static_cast<System::Int32>(static_cast<System::Byte>(0)));
- this->c8->Location = System::Drawing::Point(48, 207);
- this->c8->Name = L"c8";
- this->c8->Size = System::Drawing::Size(25, 25);
- this->c8->TabIndex = 18;
- this->c8->Text = L"8";
- this->c8->UseVisualStyleBackColor = false;
- //
- // c9
- //
- this->c9->BackColor = System::Drawing::Color::Black;
- this->c9->FlatStyle = System::Windows::Forms::FlatStyle::Flat;
- this->c9->ForeColor = System::Drawing::Color::FromArgb(static_cast<System::Int32>(static_cast<System::Byte>(192)), static_cast<System::Int32>(static_cast<System::Byte>(0)),
- static_cast<System::Int32>(static_cast<System::Byte>(0)));
- this->c9->Location = System::Drawing::Point(74, 207);
- this->c9->Name = L"c9";
- this->c9->Size = System::Drawing::Size(25, 25);
- this->c9->TabIndex = 19;
- this->c9->Text = L"9";
- this->c9->UseVisualStyleBackColor = false;
- //
- // label1
- //
- this->label1->AutoSize = true;
- this->label1->ForeColor = System::Drawing::Color::FromArgb(static_cast<System::Int32>(static_cast<System::Byte>(192)), static_cast<System::Int32>(static_cast<System::Byte>(0)),
- static_cast<System::Int32>(static_cast<System::Byte>(0)));
- this->label1->Location = System::Drawing::Point(105, 176);
- this->label1->Name = L"label1";
- this->label1->Size = System::Drawing::Size(95, 39);
- this->label1->TabIndex = 20;
- this->label1->Text = L"Click to remove\r\nthe corresponding \r\nbuttons symbol.\r\n";
- //
- // Form1
- //
- this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
- this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
- this->BackColor = System::Drawing::Color::FromArgb(static_cast<System::Int32>(static_cast<System::Byte>(10)), static_cast<System::Int32>(static_cast<System::Byte>(10)),
- static_cast<System::Int32>(static_cast<System::Byte>(10)));
- this->ClientSize = System::Drawing::Size(309, 262);
- this->Controls->Add(this->label1);
- this->Controls->Add(this->c9);
- this->Controls->Add(this->c8);
- this->Controls->Add(this->c7);
- this->Controls->Add(this->c6);
- this->Controls->Add(this->c5);
- this->Controls->Add(this->c4);
- this->Controls->Add(this->c3);
- this->Controls->Add(this->c2);
- this->Controls->Add(this->c1);
- this->Controls->Add(this->button9);
- this->Controls->Add(this->button8);
- this->Controls->Add(this->button7);
- this->Controls->Add(this->button6);
- this->Controls->Add(this->button5);
- this->Controls->Add(this->button4);
- this->Controls->Add(this->button3);
- this->Controls->Add(this->debugger);
- this->Controls->Add(this->button2);
- this->Controls->Add(this->currentPlayer);
- this->Controls->Add(this->button1);
- this->FormBorderStyle = System::Windows::Forms::FormBorderStyle::FixedToolWindow;
- this->Name = L"Form1";
- this->StartPosition = System::Windows::Forms::FormStartPosition::CenterScreen;
- this->Text = L"Form1";
- this->ResumeLayout(false);
- this->PerformLayout();
- }
- bool pturn; // Stores player turn, false = p1 true = p2
- bool b1; // Stores weather or not button is clicked, allows for moving tiles
- bool b2; // Stores weather or not button is clicked, allows for moving tiles
- bool b3; // Stores weather or not button is clicked, allows for moving tiles
- bool b4; // Stores weather or not button is clicked, allows for moving tiles
- bool b5; // Stores weather or not button is clicked, allows for moving tiles
- bool b6; // Stores weather or not button is clicked, allows for moving tiles
- bool b7; // Stores weather or not button is clicked, allows for moving tiles
- bool b8; // Stores weather or not button is clicked, allows for moving tiles
- bool b9; // Stores weather or not button is clicked, allows for moving tiles
- char bu1; // What char is on button.
- char bu2;
- char bu3;
- char bu4;
- char bu5;
- char bu6;
- char bu7;
- char bu8;
- char bu9;
- int bclick1; // Stores how many times p1 has clicked buttons, runs check for 3 in a row each time this == 3
- int bclick2; // Stores how many times p2 has clicked buttons, runs check for 3 in a row each time this == 3
- #pragma endregion
- void checker(){
- if(bclick1>=3)
- {
- if(bu1=='X' && bu2=='X' && bu3=='X')
- {
- button1->Text="P";
- button2->Text="1";
- button3->Text=" ";
- button4->Text=" ";
- button5->Text=" ";
- button6->Text=" ";
- button7->Text="W";
- button8->Text="o";
- button9->Text="n";
- }
- }
- }
- private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) {
- if(pturn == true && b1!=true){
- pturn=false;
- button1->Text="X";
- bclick1 =+1;
- b1=true;
- bu1='X';
- }
- else if(pturn==false && b1!=true){
- pturn=true;
- button1->Text="O";
- bclick2 =+1;
- b1=true;
- bu1='O';
- }
- }
- private: System::Void currentPlayer_Click(System::Object^ sender, System::EventArgs^ e) {
- if(pturn == false){
- currentPlayer->Text = "Player 1";
- }
- else if(pturn==true){
- currentPlayer->Text = "Player 2";
- }
- }
- private: System::Void button2_Click(System::Object^ sender, System::EventArgs^ e) {
- if(pturn == true && b2!=true){
- pturn=false;
- button2->Text="X";
- bclick1 =+1;
- b2=true;
- }
- else if(pturn==false && b2!=true){
- pturn=true;
- button2->Text="O";
- bclick2 =+1;
- b2=true;
- }
- }
- private: System::Void debugger_Click(System::Object^ sender, System::EventArgs^ e) {
- bclick1=5;
- }
- private: System::Void button3_Click(System::Object^ sender, System::EventArgs^ e) {
- if(pturn == true && b3!=true){
- pturn=false;
- button3->Text="X";
- bclick1 =+1;
- b3=true;
- }
- else if(pturn==false && b3!=true){
- pturn=true;
- button3->Text="O";
- bclick2 =+1;
- b3=true;
- }
- }
- private: System::Void button4_Click(System::Object^ sender, System::EventArgs^ e) {
- if(pturn == true && b4!=true){
- pturn=false;
- button4->Text="X";
- bclick1 =+1;
- b4=true;
- }
- else if(pturn==false && b4!=true){
- pturn=true;
- button4->Text="O";
- bclick2 =+1;
- b4=true;
- }
- }
- private: System::Void button5_Click(System::Object^ sender, System::EventArgs^ e) {
- if(pturn == true && b5!=true){
- pturn=false;
- button5->Text="X";
- bclick1 =+1;
- b5=true;
- }
- else if(pturn==false && b5!=true){
- pturn=true;
- button5->Text="O";
- bclick2 =+1;
- b5=true;
- }
- }
- private: System::Void button6_Click(System::Object^ sender, System::EventArgs^ e) {
- if(pturn == true && b6!=true){
- pturn=false;
- button6->Text="X";
- bclick1 =+1;
- b6=true;
- }
- else if(pturn==false && b6!=true){
- pturn=true;
- button6->Text="O";
- bclick2 =+1;
- b6=true;
- }
- }
- private: System::Void button7_Click(System::Object^ sender, System::EventArgs^ e) {
- if(pturn == true && b7!=true){
- pturn=false;
- button7->Text="X";
- bclick1 =+1;
- b7=true;
- }
- else if(pturn==false && b7!=true){
- pturn=true;
- button7->Text="O";
- bclick2 =+1;
- b7=true;
- }
- }
- private: System::Void button8_Click(System::Object^ sender, System::EventArgs^ e) {
- if(pturn == true && b8!=true){
- pturn=false;
- button8->Text="X";
- bclick1 =+1;
- b8=true;
- }
- else if(pturn==false && b8!=true){
- pturn=true;
- button8->Text="O";
- bclick2 =+1;
- b8=true;
- }
- }
- private: System::Void button9_Click(System::Object^ sender, System::EventArgs^ e) {
- if(pturn == true && b9!=true){
- pturn=false;
- button9->Text="X";
- bclick1 =+1;
- b9=true;
- }
- else if(pturn==false && b9!=true){
- pturn=true;
- button9->Text="O";
- bclick2 =+1;
- b9=true;
- }
- }
- private: System::Void button15_Click(System::Object^ sender, System::EventArgs^ e) {
- }
- };
- }
Add Comment
Please, Sign In to add comment