4 Gewinnt - Ich bekomm die Abfrage einfach nicht hin



  • Hey Leute, ich hoffe ihr könnt mir helfen:)

    Ich bin grad dabei 4 Gewinnt für die Schule zu programmieren.
    Die grafische Oberfläche hab ich schon hinbekommen. Auch das die Steine runterfallen ist kein Problem mehr. Mein Problem ist einfach die Gewinnabfrage die mich total überfordert.

    Mein Versuch mit 2 dimensionalen Arrays ist gescheitert, weil ich einfach keine Ahnung davon hab und die auch noch nie verwendet habe 😃
    Auch wenn mein Lehrer sagt mit denen bekommt man das hin 😃
    Wäre total gut, wenn mir jemand zeigen könnte, wie sowas vom Prinzip aussehen muss oder mich ein bisschen über 2 dimensionale Arrays aufklärt:)

    Die Sucherei im Internet und hier im Forum hat mich leider noch nicht weiter gebracht.
    Ich hoffe ihr könnt mir Helfen bei der Programmierung der Abfrage 🙂

    Das Ganze ist in Visual C++ 2008 programmiert und hat noch 2 Wochen Zeit. Ich hoffe mit eurer Hilfe bekomm ich das in den nächsten 2 Wochen hin:) hab schon genug stress mitm Abi xD

    Hoffe ich hab nicht im Flaschen Forum gepostet und mache den Admins nicht noch unnötig Arbeit:D

    Vielen Dank schon mal an alle die Versuche mir zu helfen:)

    mfg Grinsekatze

    ps.: Ich hab schon gelesen, dass öfters Leute nach Lösungen für 4 Gewinnt fragen, bitte nicht steinigen weil ich der nächste bin:D

    #pragma once
    
    namespace Projekt1 {
    
    	using namespace System;
    	using namespace System::ComponentModel;
    	using namespace System::Collections;
    	using namespace System::Windows::Forms;
    	using namespace System::Data;
    	using namespace System::Drawing;
    
    	/// <summary>
    	/// Zusammenfassung für Form1
    	///
    	/// Warnung: Wenn Sie den Namen dieser Klasse ändern, müssen Sie auch
    	///          die Ressourcendateiname-Eigenschaft für das Tool zur Kompilierung verwalteter Ressourcen ändern,
    	///          das allen RESX-Dateien zugewiesen ist, von denen diese Klasse abhängt.
    	///          Anderenfalls können die Designer nicht korrekt mit den lokalisierten Ressourcen
    	///          arbeiten, die diesem Formular zugewiesen sind.
    	/// </summary>
    	public ref class Form1 : public System::Windows::Forms::Form
    	{
    		public:
    		Graphics ^graphics;		
    						// ***** Zeichnen in der PictureBox1
    		int a;
    		int x;											// ***** Koordinaten
    		int y;
    		int b;
    		int c;
    		int d;
    		int e;
    		int f;
    		int g;
    
    		public: 
    		SolidBrush ^BrushRed;							// ***** Zeichnen rot
    		SolidBrush ^BrushYellow;						// ***** Zeichnen gelb>>>Farben im Programm
    
    	public:
    		Form1(void)
    		{
    			InitializeComponent();
    		///////GELB??????
    			graphics = pictureBox1->CreateGraphics();   // ***** Zeichnen in der PictureBox1
    			x=100;										// ***** Startwerte der Koordinaten
    			y=pictureBox1->Height;
    														///a=pictureBox1->Height;
    			BrushRed=gcnew SolidBrush(Color::Red);		// ***** Zeichnen rot
    			BrushYellow=gcnew SolidBrush(Color::Yellow);///>>> Farben die Benutzt werden
    			//
    			//TODO: Konstruktorcode hier hinzufügen.
    			//
    		}
    
    	protected:
    		/// <summary>
    		/// Verwendete Ressourcen bereinigen.
    		/// </summary>
    		~Form1()
    		{
    			if (components)
    			{
    				delete components;
    			}
    		}
    	private: System::Windows::Forms::Button^  button1;
    	protected: 
    	private: System::Windows::Forms::Button^  button2;
    	private: System::Windows::Forms::Button^  button3;
    	private: System::Windows::Forms::Label^  label1;
    	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^  button10;
    	private: System::Windows::Forms::Button^  button11;
    	private: System::Windows::Forms::Button^  button12;
    	private: System::Windows::Forms::Button^  button13;
    	private: System::Windows::Forms::Button^  button14;
    	private: System::Windows::Forms::Button^  button15;
    	private: System::Windows::Forms::Button^  button16;
    	private: System::Windows::Forms::Button^  button17;
    	private: System::Windows::Forms::Button^  button18;
    	private: System::Windows::Forms::PictureBox^  pictureBox1;
    
    	private:
    		/// <summary>
    		/// Erforderliche Designervariable.
    		/// </summary>
    		System::ComponentModel::Container ^components;
    
    #pragma region Windows Form Designer generated code
    		/// <summary>
    		/// Erforderliche Methode für die Designerunterstützung.
    		/// Der Inhalt der Methode darf nicht mit dem Code-Editor geändert werden.
    		/// </summary>
    		void InitializeComponent(void)
    		{
    			this->button1 = (gcnew System::Windows::Forms::Button());
    			this->button2 = (gcnew System::Windows::Forms::Button());
    			this->button3 = (gcnew System::Windows::Forms::Button());
    			this->label1 = (gcnew System::Windows::Forms::Label());
    			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->button10 = (gcnew System::Windows::Forms::Button());
    			this->button11 = (gcnew System::Windows::Forms::Button());
    			this->button12 = (gcnew System::Windows::Forms::Button());
    			this->button13 = (gcnew System::Windows::Forms::Button());
    			this->button14 = (gcnew System::Windows::Forms::Button());
    			this->button15 = (gcnew System::Windows::Forms::Button());
    			this->button16 = (gcnew System::Windows::Forms::Button());
    			this->button17 = (gcnew System::Windows::Forms::Button());
    			this->button18 = (gcnew System::Windows::Forms::Button());
    			this->pictureBox1 = (gcnew System::Windows::Forms::PictureBox());
    			(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->pictureBox1))->BeginInit();
    			this->SuspendLayout();
    			// 
    			// button1
    			// 
    			this->button1->Location = System::Drawing::Point(203, 160);
    			this->button1->Name = L"button1";
    			this->button1->Size = System::Drawing::Size(249, 48);
    			this->button1->TabIndex = 0;
    			this->button1->Text = L"2 Spieler";
    			this->button1->UseVisualStyleBackColor = true;
    			this->button1->Click += gcnew System::EventHandler(this, &Form1::button1_Click);
    			// 
    			// button2
    			// 
    			this->button2->Location = System::Drawing::Point(203, 230);
    			this->button2->Name = L"button2";
    			this->button2->Size = System::Drawing::Size(249, 41);
    			this->button2->TabIndex = 1;
    			this->button2->Text = L"Spieler vs. PC";
    			this->button2->UseVisualStyleBackColor = true;
    			// 
    			// button3
    			// 
    			this->button3->Location = System::Drawing::Point(203, 293);
    			this->button3->Name = L"button3";
    			this->button3->Size = System::Drawing::Size(249, 46);
    			this->button3->TabIndex = 2;
    			this->button3->Text = L"Beenden";
    			this->button3->UseVisualStyleBackColor = true;
    			this->button3->Click += gcnew System::EventHandler(this, &Form1::button3_Click);
    			// 
    			// label1
    			// 
    			this->label1->AutoSize = true;
    			this->label1->BackColor = System::Drawing::SystemColors::HotTrack;
    			this->label1->ForeColor = System::Drawing::Color::FromArgb(static_cast<System::Int32>(static_cast<System::Byte>(255)), static_cast<System::Int32>(static_cast<System::Byte>(128)), 
    				static_cast<System::Int32>(static_cast<System::Byte>(0)));
    			this->label1->Location = System::Drawing::Point(291, 8);
    			this->label1->Name = L"label1";
    			this->label1->Size = System::Drawing::Size(62, 13);
    			this->label1->TabIndex = 3;
    			this->label1->Text = L"Viergewinnt";
    			this->label1->Visible = false;
    			// 
    			// button4
    			// 
    			this->button4->Location = System::Drawing::Point(242, 473);
    			this->button4->Name = L"button4";
    			this->button4->Size = System::Drawing::Size(129, 23);
    			this->button4->TabIndex = 4;
    			this->button4->Text = L"Zurück";
    			this->button4->UseVisualStyleBackColor = true;
    			this->button4->Visible = false;
    			this->button4->Click += gcnew System::EventHandler(this, &Form1::button4_Click);
    			// 
    			// button5
    			// 
    			this->button5->Location = System::Drawing::Point(28, 28);
    			this->button5->Name = L"button5";
    			this->button5->Size = System::Drawing::Size(51, 23);
    			this->button5->TabIndex = 5;
    			this->button5->Text = L"Rot1";
    			this->button5->UseVisualStyleBackColor = true;
    			this->button5->Visible = false;
    			this->button5->Click += gcnew System::EventHandler(this, &Form1::button5_Click);
    			// 
    			// button6
    			// 
    			this->button6->Location = System::Drawing::Point(88, 29);
    			this->button6->Name = L"button6";
    			this->button6->Size = System::Drawing::Size(53, 23);
    			this->button6->TabIndex = 6;
    			this->button6->Text = L"Rot2";
    			this->button6->UseVisualStyleBackColor = true;
    			this->button6->Visible = false;
    			this->button6->Click += gcnew System::EventHandler(this, &Form1::button6_Click);
    			// 
    			// button7
    			// 
    			this->button7->Location = System::Drawing::Point(147, 29);
    			this->button7->Name = L"button7";
    			this->button7->Size = System::Drawing::Size(55, 23);
    			this->button7->TabIndex = 7;
    			this->button7->Text = L"Rot3";
    			this->button7->UseVisualStyleBackColor = true;
    			this->button7->Visible = false;
    			this->button7->Click += gcnew System::EventHandler(this, &Form1::button7_Click);
    			// 
    			// button8
    			// 
    			this->button8->Location = System::Drawing::Point(208, 29);
    			this->button8->Name = L"button8";
    			this->button8->Size = System::Drawing::Size(55, 23);
    			this->button8->TabIndex = 8;
    			this->button8->Text = L"Rot4";
    			this->button8->UseVisualStyleBackColor = true;
    			this->button8->Visible = false;
    			this->button8->Click += gcnew System::EventHandler(this, &Form1::button8_Click);
    			// 
    			// button9
    			// 
    			this->button9->Location = System::Drawing::Point(269, 29);
    			this->button9->Name = L"button9";
    			this->button9->Size = System::Drawing::Size(52, 23);
    			this->button9->TabIndex = 9;
    			this->button9->Text = L"Rot5";
    			this->button9->UseVisualStyleBackColor = true;
    			this->button9->Visible = false;
    			this->button9->Click += gcnew System::EventHandler(this, &Form1::button9_Click);
    			// 
    			// button10
    			// 
    			this->button10->Location = System::Drawing::Point(327, 29);
    			this->button10->Name = L"button10";
    			this->button10->Size = System::Drawing::Size(58, 23);
    			this->button10->TabIndex = 10;
    			this->button10->Text = L"Rot6";
    			this->button10->UseVisualStyleBackColor = true;
    			this->button10->Visible = false;
    			this->button10->Click += gcnew System::EventHandler(this, &Form1::button10_Click);
    			// 
    			// button11
    			// 
    			this->button11->Location = System::Drawing::Point(391, 28);
    			this->button11->Name = L"button11";
    			this->button11->Size = System::Drawing::Size(59, 23);
    			this->button11->TabIndex = 11;
    			this->button11->Text = L"Rot7";
    			this->button11->UseVisualStyleBackColor = true;
    			this->button11->Visible = false;
    			this->button11->Click += gcnew System::EventHandler(this, &Form1::button11_Click);
    			// 
    			// button12
    			// 
    			this->button12->Location = System::Drawing::Point(28, 58);
    			this->button12->Name = L"button12";
    			this->button12->Size = System::Drawing::Size(51, 23);
    			this->button12->TabIndex = 12;
    			this->button12->Text = L"Gelb1";
    			this->button12->UseVisualStyleBackColor = true;
    			this->button12->Visible = false;
    			this->button12->Click += gcnew System::EventHandler(this, &Form1::button12_Click);
    			// 
    			// button13
    			// 
    			this->button13->Location = System::Drawing::Point(88, 58);
    			this->button13->Name = L"button13";
    			this->button13->Size = System::Drawing::Size(53, 23);
    			this->button13->TabIndex = 13;
    			this->button13->Text = L"Gelb2";
    			this->button13->UseVisualStyleBackColor = true;
    			this->button13->Visible = false;
    			this->button13->Click += gcnew System::EventHandler(this, &Form1::button13_Click);
    			// 
    			// button14
    			// 
    			this->button14->Location = System::Drawing::Point(147, 58);
    			this->button14->Name = L"button14";
    			this->button14->Size = System::Drawing::Size(55, 23);
    			this->button14->TabIndex = 14;
    			this->button14->Text = L"Gelb3";
    			this->button14->UseVisualStyleBackColor = true;
    			this->button14->Visible = false;
    			this->button14->Click += gcnew System::EventHandler(this, &Form1::button14_Click);
    			// 
    			// button15
    			// 
    			this->button15->Location = System::Drawing::Point(208, 56);
    			this->button15->Name = L"button15";
    			this->button15->Size = System::Drawing::Size(55, 23);
    			this->button15->TabIndex = 15;
    			this->button15->Text = L"Gelb4";
    			this->button15->UseVisualStyleBackColor = true;
    			this->button15->Visible = false;
    			this->button15->Click += gcnew System::EventHandler(this, &Form1::button15_Click);
    			// 
    			// button16
    			// 
    			this->button16->Location = System::Drawing::Point(269, 58);
    			this->button16->Name = L"button16";
    			this->button16->Size = System::Drawing::Size(52, 23);
    			this->button16->TabIndex = 16;
    			this->button16->Text = L"Gelb5";
    			this->button16->UseVisualStyleBackColor = true;
    			this->button16->Visible = false;
    			this->button16->Click += gcnew System::EventHandler(this, &Form1::button16_Click);
    			// 
    			// button17
    			// 
    			this->button17->Location = System::Drawing::Point(327, 58);
    			this->button17->Name = L"button17";
    			this->button17->Size = System::Drawing::Size(58, 23);
    			this->button17->TabIndex = 17;
    			this->button17->Text = L"Gelb6";
    			this->button17->UseVisualStyleBackColor = true;
    			this->button17->Visible = false;
    			this->button17->Click += gcnew System::EventHandler(this, &Form1::button17_Click);
    			// 
    			// button18
    			// 
    			this->button18->Location = System::Drawing::Point(391, 58);
    			this->button18->Name = L"button18";
    			this->button18->Size = System::Drawing::Size(61, 23);
    			this->button18->TabIndex = 18;
    			this->button18->Text = L"Gelb7";
    			this->button18->UseVisualStyleBackColor = true;
    			this->button18->Visible = false;
    			this->button18->Click += gcnew System::EventHandler(this, &Form1::button18_Click);
    			// 
    			// pictureBox1
    			// 
    			this->pictureBox1->Location = System::Drawing::Point(19, 86);
    			this->pictureBox1->Name = L"pictureBox1";
    			this->pictureBox1->Size = System::Drawing::Size(631, 381);
    			this->pictureBox1->TabIndex = 19;
    			this->pictureBox1->TabStop = false;
    			this->pictureBox1->Visible = false;
    			// 
    			// Form1
    			// 
    			this->AutoScaleDimensions = System::Drawing::SizeF(6, 13);
    			this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
    			this->BackColor = System::Drawing::SystemColors::HotTrack;
    			this->ClientSize = System::Drawing::Size(662, 508);
    			this->Controls->Add(this->pictureBox1);
    			this->Controls->Add(this->button18);
    			this->Controls->Add(this->button17);
    			this->Controls->Add(this->button16);
    			this->Controls->Add(this->button15);
    			this->Controls->Add(this->button14);
    			this->Controls->Add(this->button13);
    			this->Controls->Add(this->button12);
    			this->Controls->Add(this->button11);
    			this->Controls->Add(this->button10);
    			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->label1);
    			this->Controls->Add(this->button3);
    			this->Controls->Add(this->button2);
    			this->Controls->Add(this->button1);
    			this->Name = L"Form1";
    			this->Text = L"Form1";
    			(cli::safe_cast<System::ComponentModel::ISupportInitialize^  >(this->pictureBox1))->EndInit();
    			this->ResumeLayout(false);
    			this->PerformLayout();
    
    		}
    #pragma endregion
    
    	/// Programm schließen
    private: System::Void button3_Click(System::Object^  sender, System::EventArgs^  e) {
    			 Close();
    		 }
    
    		 ///// Buttons Ausblenden ///Start
    private: System::Void button1_Click(System::Object^  sender, System::EventArgs^  e) {
    			 int feld [7][7];			////////FELD    ____________________________________________________________
    			 button3->Visible=false;
    			 button2->Visible=false;
    			 button1->Visible=false;
    			 button4->Visible=true;
    			 pictureBox1->Visible=true;
    			 button5->Visible=true;
    			 button6->Visible=true;
    			 button7->Visible=true;
    			 button8->Visible=true;
    			 button9->Visible=true;
    			 button10->Visible=true;
    			 button11->Visible=true;
    			 a=360;							/////y-Achse
    			 b=360;
    			 c=360;
    			 d=360;
    
    			 f=360;
    			 g=360;
    			 y=360;
    
    		 }
    
    		 /// Zurück 
    
    private: System::Void button4_Click(System::Object^  sender, System::EventArgs^  e) {	
    			 button3->Visible=true;
    			 button2->Visible=true;
    			 button1->Visible=true;
    			 button4->Visible=false;
    			 pictureBox1->Visible=false;
    			 button5->Visible=false;
    			 button6->Visible=false;
    			 button7->Visible=false;
    			 button8->Visible=false;
    			 button9->Visible=false;
    			 button10->Visible=false;
    			 button11->Visible=false;
    			 button12->Visible=false;
    			 button13->Visible=false;
    			 button14->Visible=false;
    			 button15->Visible=false;
    			 button16->Visible=false;
    			 button17->Visible=false;
    			 button18->Visible=false;
    
    		 }
    private: System::Void button5_Click(System::Object^  sender, System::EventArgs^  e) {
    			  y=y-50;		///Abstand
    				 x=15;		///Start
    			 if(y>0)
    				    graphics->FillEllipse(BrushRed,Rectangle(x,y,40,40));	
    				int i;
    			int summe=0;
    		///	int feld[15][7];					FRAGEN WIE DAS GEHT 
    		///	 for (i=0;i<6;i++)
    		//		feld [15][i]=-1;
    		//		summe= summe + feld[15][i] ; 
    		///	if (summe==-4)
    		///			Close();//
    
    			 button5->Visible=false;
    			 button6->Visible=false;
    			 button7->Visible=false;
    			 button8->Visible=false;
    			 button9->Visible=false;
    			 button10->Visible=false;
    			 button11->Visible=false;
    			 button12->Visible=true;
    			 button13->Visible=true;
    			 button14->Visible=true;
    			 button15->Visible=true;
    			 button16->Visible=true;
    			 button17->Visible=true;
    			 button18->Visible=true;
    		 }
    private: System::Void button6_Click(System::Object^  sender, System::EventArgs^  e) {
    	int x2;
    
    			 a=a-50;
    				 x2=75;
    			if(a>0)
    				    graphics->FillEllipse(BrushRed,Rectangle(x2,a,40,40));
    			button5->Visible=false;
    			 button6->Visible=false;
    			 button7->Visible=false;
    			 button8->Visible=false;
    			 button9->Visible=false;
    			 button10->Visible=false;
    			 button11->Visible=false;
    			 button12->Visible=true;
    			 button13->Visible=true;
    			 button14->Visible=true;
    			 button15->Visible=true;
    			 button16->Visible=true;
    			 button17->Visible=true;
    			 button18->Visible=true;
    
    		 }
    private: System::Void button7_Click(System::Object^  sender, System::EventArgs^  e) {
    			 	int x3;
    
    			 b=b-50;
    				 x3=135;
    			if(b>0)
    				    graphics->FillEllipse(BrushRed,Rectangle(x3,b,40,40));
    			button5->Visible=false;
    			 button6->Visible=false;
    			 button7->Visible=false;
    			 button8->Visible=false;
    			 button9->Visible=false;
    			 button10->Visible=false;
    			 button11->Visible=false;
    			 button12->Visible=true;
    			 button13->Visible=true;
    			 button14->Visible=true;
    			 button15->Visible=true;
    			 button16->Visible=true;
    			 button17->Visible=true;
    			 button18->Visible=true;
    		 }
    private: System::Void button8_Click(System::Object^  sender, System::EventArgs^  e) {
    			 	int x4;
    
    			 c=c-50;
    				 x4=195;
    			if(c>0)
    				    graphics->FillEllipse(BrushRed,Rectangle(x4,c,40,40));
    			button5->Visible=false;
    			 button6->Visible=false;
    			 button7->Visible=false;
    			 button8->Visible=false;
    			 button9->Visible=false;
    			 button10->Visible=false;
    			 button11->Visible=false;
    			 button12->Visible=true;
    			 button13->Visible=true;
    			 button14->Visible=true;
    			 button15->Visible=true;
    			 button16->Visible=true;
    			 button17->Visible=true;
    			 button18->Visible=true;
    		 }
    private: System::Void button9_Click(System::Object^  sender, System::EventArgs^  e) {	
    			 int x5;
    
    			 d=d-50;
    				 x5=255;
    			if(d>0)
    				    graphics->FillEllipse(BrushRed,Rectangle(x5,d,40,40));
    			button5->Visible=false;
    			 button6->Visible=false;
    			 button7->Visible=false;
    			 button8->Visible=false;
    			 button9->Visible=false;
    			 button10->Visible=false;
    			 button11->Visible=false;
    			 button12->Visible=true;
    			 button13->Visible=true;
    			 button14->Visible=true;
    			 button15->Visible=true;
    			 button16->Visible=true;
    			 button17->Visible=true;
    			 button18->Visible=true;
    		 }
    private: System::Void button10_Click(System::Object^  sender, System::EventArgs^  e) {
    			 	int x6;
    
    			 g=g-50;
    				 x6=315;
    			if(g>0)
    				    graphics->FillEllipse(BrushRed,Rectangle(x6,g,40,40));
    			button5->Visible=false;
    			 button6->Visible=false;
    			 button7->Visible=false;
    			 button8->Visible=false;
    			 button9->Visible=false;
    			 button10->Visible=false;
    			 button11->Visible=false;
    			 button12->Visible=true;
    			 button13->Visible=true;
    			 button14->Visible=true;
    			 button15->Visible=true;
    			 button16->Visible=true;
    			 button17->Visible=true;
    			 button18->Visible=true;
    		 }
    private: System::Void button11_Click(System::Object^  sender, System::EventArgs^  e) {
    			 	int x7;
    
    				f=f-50;
    				 x7=375;
    			if(f>0)
    				    graphics->FillEllipse(BrushRed,Rectangle(x7,f,40,40));
    			button5->Visible=false;
    			 button6->Visible=false;
    			 button7->Visible=false;
    			 button8->Visible=false;
    			 button9->Visible=false;
    			 button10->Visible=false;
    			 button11->Visible=false;
    			 button12->Visible=true;
    			 button13->Visible=true;
    			 button14->Visible=true;
    			 button15->Visible=true;
    			 button16->Visible=true;
    			 button17->Visible=true;
    			 button18->Visible=true;
    		 }
    private: System::Void button12_Click(System::Object^  sender, System::EventArgs^  e) {  
    			 y=y-50;		///Abstand
    				 x=15;		///Start
    			 if(y>0)
    				    graphics->FillEllipse(BrushYellow,Rectangle(x,y,40,40));
    			 button5->Visible=true;
    			 button6->Visible=true;
    			 button7->Visible=true;
    			 button8->Visible=true;
    			 button9->Visible=true;
    			 button10->Visible=true;
    			 button11->Visible=true;
    			 button12->Visible=false;
    			 button13->Visible=false;
    			 button14->Visible=false;
    			 button15->Visible=false;
    			 button16->Visible=false;
    			 button17->Visible=false;
    			 button18->Visible=false;
    		 }
    private: System::Void button13_Click(System::Object^  sender, System::EventArgs^  e) {
    			 int x2;
    
    			 a=a-50;
    				 x2=75;
    			if(a>0)
    				    graphics->FillEllipse(BrushYellow,Rectangle(x2,a,40,40));
    			button5->Visible=true;
    			 button6->Visible=true;
    			 button7->Visible=true;
    			 button8->Visible=true;
    			 button9->Visible=true;
    			 button10->Visible=true;
    			 button11->Visible=true;
    			 button12->Visible=false;
    			 button13->Visible=false;
    			 button14->Visible=false;
    			 button15->Visible=false;
    			 button16->Visible=false;
    			 button17->Visible=false;
    			 button18->Visible=false;
    		 }
    private: System::Void button14_Click(System::Object^  sender, System::EventArgs^  e) {
    			 int x3;
    
    			 b=b-50;
    				 x3=135;
    			if(b>0)
    				    graphics->FillEllipse(BrushYellow,Rectangle(x3,b,40,40));
    			button5->Visible=true;
    			 button6->Visible=true;
    			 button7->Visible=true;
    			 button8->Visible=true;
    			 button9->Visible=true;
    			 button10->Visible=true;
    			 button11->Visible=true;
    			 button12->Visible=false;
    			 button13->Visible=false;
    			 button14->Visible=false;
    			 button15->Visible=false;
    			 button16->Visible=false;
    			 button17->Visible=false;
    			 button18->Visible=false;
    
    		 }
    private: System::Void button15_Click(System::Object^  sender, System::EventArgs^  e) {
    			 	 	int x4;
    
    			 c=c-50;
    				 x4=195;
    			if(c>0)
    				    graphics->FillEllipse(BrushYellow,Rectangle(x4,c,40,40));
    			button5->Visible=true;
    			 button6->Visible=true;
    			 button7->Visible=true;
    			 button8->Visible=true;
    			 button9->Visible=true;
    			 button10->Visible=true;
    			 button11->Visible=true;
    			 button12->Visible=false;
    			 button13->Visible=false;
    			 button14->Visible=false;
    			 button15->Visible=false;
    			 button16->Visible=false;
    			 button17->Visible=false;
    			 button18->Visible=false;
    		 }
    private: System::Void button16_Click(System::Object^  sender, System::EventArgs^  e) {
    			  int x5;
    
    			 d=d-50;
    				 x5=255;
    			if(d>0)
    				    graphics->FillEllipse(BrushYellow,Rectangle(x5,d,40,40));
    			button5->Visible=true;
    			 button6->Visible=true;
    			 button7->Visible=true;
    			 button8->Visible=true;
    			 button9->Visible=true;
    			 button10->Visible=true;
    			 button11->Visible=true;
    			 button12->Visible=false;
    			 button13->Visible=false;
    			 button14->Visible=false;
    			 button15->Visible=false;
    			 button16->Visible=false;
    			 button17->Visible=false;
    			 button18->Visible=false;
    		 }
    private: System::Void button17_Click(System::Object^  sender, System::EventArgs^  e) {
    			 int x6;
    
    			 g=g-50;
    				 x6=315;
    			if(g>0)
    				    graphics->FillEllipse(BrushYellow,Rectangle(x6,g,40,40));
    			button5->Visible=true;
    			 button6->Visible=true;
    			 button7->Visible=true;
    			 button8->Visible=true;
    			 button9->Visible=true;
    			 button10->Visible=true;
    			 button11->Visible=true;
    			 button12->Visible=false;
    			 button13->Visible=false;
    			 button14->Visible=false;
    			 button15->Visible=false;
    			 button16->Visible=false;
    			 button17->Visible=false;
    			 button18->Visible=false;
    		 }
    private: System::Void button18_Click(System::Object^  sender, System::EventArgs^  e) {
    			 int x7;
    
    				f=f-50;
    				 x7=375;
    			if(f>0)
    				    graphics->FillEllipse(BrushYellow,Rectangle(x7,f,40,40));
    			 button5->Visible=true;
    			 button6->Visible=true;
    			 button7->Visible=true;
    			 button8->Visible=true;
    			 button9->Visible=true;
    			 button10->Visible=true;
    			 button11->Visible=true;
    			 button12->Visible=false;
    			 button13->Visible=false;
    			 button14->Visible=false;
    			 button15->Visible=false;
    			 button16->Visible=false;
    			 button17->Visible=false;
    			 button18->Visible=false;
    		 }
    };
    }
    


  • Sgt. Nukem schrieb:

    Glaub' mir: Deinen Code liesst sich hier kein Schwein durch...!



  • Swordfish schrieb:

    Sgt. Nukem schrieb:

    Glaub' mir: Deinen Code liesst sich hier kein Schwein durch...!

    Richtig. Aber was ich sehe (ohne zu lesen), ist Bullshit pur. Button1-ButtonX... Vergiss es.



  • Swordfish schrieb:

    Sgt. Nukem schrieb:

    Glaub' mir: Deinen Code liesst sich hier kein Schwein durch...!

    LOL, genau das war auch mein erster Gedanke beim endlosen scrollen.

    Edit:
    und MFC ist es auch nicht



  • GrinseKatze schrieb:

    Hoffe ich hab nicht im Flaschen Forum gepostet

    Grundsätzlich nein, wobei es hier genug Flaschen gibt. Aber MFC ist es sicher nicht, was du machst.



  • Ich hab halt leider keine Ahnung von c++ und hab deshalb den gesamten Quelltext eingefügt.....

    Und warum sind die Buttons falsch?
    Mein Lehrer hat gesagt ich soll das mit Buttons lösen und das Feld baut sich ja schon auf und ich häng nur noch an der Abfrage, welcher Spieler gewonnen hat:(



  • Dieser Thread wurde von Moderator/in Martin Richter aus dem Forum MFC (Visual C++) in das Forum C++/CLI mit .NET verschoben.

    Im Zweifelsfall bitte auch folgende Hinweise beachten:
    C/C++ Forum :: FAQ - Sonstiges :: Wohin mit meiner Frage?

    Dieses Posting wurde automatisch erzeugt.


  • Mod

    GrinseKatze schrieb:

    Ich hab halt leider keine Ahnung von c++ und hab deshalb den gesamten Quelltext eingefügt.....

    Und warum sind die Buttons falsch?
    Mein Lehrer hat gesagt ich soll das mit Buttons lösen und das Feld baut sich ja schon auf und ich häng nur noch an der Abfrage, welcher Spieler gewonnen hat:(

    Buttons sind schon OK. Aber vielleicht sollte Dir das Konzept von einem Array erst einmal klar werden...


Anmelden zum Antworten