Hallo Leute!!
Ich hoffe Ihr könnt mir weiterhelfen ! Ich sollte ein vier Gewinnt Spiel programmieren aber irgendwie gelingt mir das nicht so ganz (bin nicht gerade ein Profi mit C++ ;-))
(Borland)
Alles anzeigen
Ich hoffe Ihr könnt mir weiterhelfen ! Ich sollte ein vier Gewinnt Spiel programmieren aber irgendwie gelingt mir das nicht so ganz (bin nicht gerade ein Profi mit C++ ;-))
(Borland)
Quellcode
- //---------------------------------------------------------------------------
- #include <vcl.h>
- #pragma hdrstop
- #include "FuckofPesiU.h"
- //---------------------------------------------------------------------------
- #pragma package(smart_init)
- #pragma resource "*.dfm"
- TForm1 *Form1;
- //---------------------------------------------------------------------------
- __fastcall TForm1::TForm1(TComponent* Owner)
- : TForm(Owner)
- {
- Stein[0]=Shape1;
- Stein[1]=Shape2;
- Stein[2]=Shape3;
- Stein[3]=Shape4;
- Stein[4]=Shape5;
- Stein[5]=Shape6;
- Stein[6]=Shape7;
- Stein[7]=Shape8;
- Stein[8]=Shape9;
- Stein[9]=Shape10;
- Stein[10]=Shape11;
- Stein[11]=Shape12;
- Stein[12]=Shape13;
- Stein[13]=Shape14;
- Stein[14]=Shape15;
- Stein[15]=Shape16;
- Spielfeld [0] [0] = Shape17;
- Spielfeld [0] [1] = Shape18;
- Spielfeld [0] [2] = Shape19;
- Spielfeld [0] [3] = Shape20;
- Spielfeld [1] [0] = Shape21;
- Spielfeld [1] [1] = Shape22;
- Spielfeld [1] [2] = Shape23;
- Spielfeld [1] [3] = Shape24;
- Spielfeld [2] [0] = Shape25;
- Spielfeld [2] [1] = Shape26;
- Spielfeld [2] [2] = Shape27;
- Spielfeld [2] [3] = Shape28;
- Spielfeld [3] [0] = Shape29;
- Spielfeld [3] [1] = Shape30;
- Spielfeld [3] [2] = Shape31;
- Spielfeld [3] [3] = Shape32;
- for (int spalte=0; spalte <=3; spalte++)
- for (int zeile=0; zeile <=3; zeile++)
- {
- Spielfeld [zeile][spalte] -> Left = 200 + spalte * 49;
- Spielfeld [zeile][spalte] -> Top = 200 + zeile * 49;
- Feld[zeile][spalte]=NULL;
- }
- for (int cnt=0; cnt<=15; cnt++)
- {
- if (cnt<=7)
- {Stein[cnt]->Left=60+cnt*45;
- Stein [cnt]->Top=65;}
- if (cnt<=7)
- {Stein[cnt]->Left=400+(cnt-8)*45;
- Stein [cnt]->Top=65;}
- }
- }
- //---------------------------------------------------------------------------
- void __fastcall TForm1::Shape1MouseDown(TObject *Sender,
- TMouseButton Button, TShiftState Shift, int X, int Y)
- {
- Stone = Shape1;
- Stone -> Left = xrich=0;
- Stone -> Top = yrich=0;
- }
- //---------------------------------------------------------------------------
- void __fastcall TForm1::Shape2MouseDown(TObject *Sender,
- TMouseButton Button, TShiftState Shift, int X, int Y)
- {
- Stone = Shape2;
- Stone -> Left = xrich=0;
- Stone -> Top = yrich=0;
- }
- //---------------------------------------------------------------------------
- void __fastcall TForm1::Shape3MouseDown(TObject *Sender,
- TMouseButton Button, TShiftState Shift, int X, int Y)
- {
- Stone = Shape3;
- Stone -> Left = xrich=0;
- Stone -> Top = yrich=0;
- }
- //---------------------------------------------------------------------------
- void __fastcall TForm1::Shape4MouseDown(TObject *Sender,
- TMouseButton Button, TShiftState Shift, int X, int Y)
- {
- Stone = Shape4;
- Stone -> Left = xrich=0;
- Stone -> Top = yrich=0;
- }
- //---------------------------------------------------------------------------
- void __fastcall TForm1::Shape5MouseDown(TObject *Sender,
- TMouseButton Button, TShiftState Shift, int X, int Y)
- {
- Stone = Shape5;
- Stone -> Left = xrich=0;
- Stone -> Top = yrich=0;
- }
- //---------------------------------------------------------------------------
- void __fastcall TForm1::Shape6MouseDown(TObject *Sender,
- TMouseButton Button, TShiftState Shift, int X, int Y)
- {
- Stone = Shape6;
- Stone -> Left = xrich=0;
- Stone -> Top = yrich=0;
- }
- //---------------------------------------------------------------------------
- void __fastcall TForm1::Shape7MouseDown(TObject *Sender,
- TMouseButton Button, TShiftState Shift, int X, int Y)
- {
- Stone = Shape7;
- Stone -> Left = xrich=0;
- Stone -> Top = yrich=0;
- }
- //---------------------------------------------------------------------------
- void __fastcall TForm1::Shape8MouseDown(TObject *Sender,
- TMouseButton Button, TShiftState Shift, int X, int Y)
- {
- Stone = Shape8;
- Stone -> Left = xrich=0;
- Stone -> Top = yrich=0;
- }
- //---------------------------------------------------------------------------
- void __fastcall TForm1::Shape9MouseDown(TObject *Sender,
- TMouseButton Button, TShiftState Shift, int X, int Y)
- {
- Stone = Shape9;
- Stone -> Left = xrich=0;
- Stone -> Top = yrich=0;
- }
- //---------------------------------------------------------------------------
- void __fastcall TForm1::Shape10MouseDown(TObject *Sender,
- TMouseButton Button, TShiftState Shift, int X, int Y)
- {
- Stone = Shape10;
- Stone -> Left = xrich=0;
- Stone -> Top = yrich=0;
- }
- //---------------------------------------------------------------------------
- void __fastcall TForm1::Shape11MouseDown(TObject *Sender,
- TMouseButton Button, TShiftState Shift, int X, int Y)
- {
- Stone = Shape11;
- Stone -> Left = xrich=0;
- Stone -> Top = yrich=0;
- }
- //---------------------------------------------------------------------------
- void __fastcall TForm1::Shape12MouseDown(TObject *Sender,
- TMouseButton Button, TShiftState Shift, int X, int Y)
- {
- Stone = Shape12;
- Stone -> Left = xrich=0;
- Stone -> Top = yrich=0;
- }
- //---------------------------------------------------------------------------
- void __fastcall TForm1::Shape13MouseDown(TObject *Sender,
- TMouseButton Button, TShiftState Shift, int X, int Y)
- {
- Stone = Shape13;
- Stone -> Left = xrich=0;
- Stone -> Top = yrich=0;
- }
- //---------------------------------------------------------------------------