![]() |
AW: tic tac toe.... mal wieder:) versteh aufgabestellung nicht ganz
Oder rechte Maustaste aufs Fomular -> Ansicht als Text/Ansicht als Formular ;)
|
AW: tic tac toe.... mal wieder:) versteh aufgabestellung nicht ganz
Zitat:
Mach das so:
Delphi-Quellcode:
//...
TMyArr = array[1..9] of string; TForm1 = class(TForm) //... function CheckForWin(AIndex:TMyArr): Boolean; //... GBuffer: TMyArr; //... function TForm1.CheckForWin(AIndex: TMyArr): Boolean; |
AW: tic tac toe.... mal wieder:) versteh aufgabestellung nicht ganz
Delphi-Quellcode:
object Form1: TForm1
Left = 0 Top = 0 Caption = 'TicTacToe' ClientHeight = 455 ClientWidth = 582 Color = clBtnFace Font.Charset = DEFAULT_CHARSET Font.Color = clWindowText Font.Height = -11 Font.Name = 'Tahoma' Font.Style = [] OldCreateOrder = False OnCreate = FormCreate PixelsPerInch = 96 TextHeight = 13 object Label1: TLabel Left = 8 Top = 8 Width = 137 Height = 129 Alignment = taCenter AutoSize = False Color = clWhite Font.Charset = DEFAULT_CHARSET Font.Color = clWindowText Font.Height = -107 Font.Name = 'Tahoma' Font.Style = [] ParentColor = False ParentFont = False OnClick = Label1Click end object Label2: TLabel Left = 151 Top = 8 Width = 137 Height = 129 Alignment = taCenter AutoSize = False Color = clWhite Font.Charset = DEFAULT_CHARSET Font.Color = clWindowText Font.Height = -107 Font.Name = 'Tahoma' Font.Style = [] ParentColor = False ParentFont = False OnClick = Label2Click end object Label3: TLabel Left = 294 Top = 8 Width = 137 Height = 129 Alignment = taCenter AutoSize = False Color = clWhite Font.Charset = DEFAULT_CHARSET Font.Color = clWindowText Font.Height = -107 Font.Name = 'Tahoma' Font.Style = [] ParentColor = False ParentFont = False OnClick = Label3Click end object Label4: TLabel Left = 8 Top = 143 Width = 137 Height = 129 Alignment = taCenter AutoSize = False Color = clWhite Font.Charset = DEFAULT_CHARSET Font.Color = clWindowText Font.Height = -107 Font.Name = 'Tahoma' Font.Style = [] ParentColor = False ParentFont = False OnClick = Label4Click end object Label5: TLabel Left = 151 Top = 143 Width = 137 Height = 129 Alignment = taCenter AutoSize = False Color = clWhite Font.Charset = DEFAULT_CHARSET Font.Color = clWindowText Font.Height = -107 Font.Name = 'Tahoma' Font.Style = [] ParentColor = False ParentFont = False OnClick = Label5Click end object Label6: TLabel Left = 294 Top = 143 Width = 137 Height = 129 Alignment = taCenter AutoSize = False Color = clWhite Font.Charset = DEFAULT_CHARSET Font.Color = clWindowText Font.Height = -107 Font.Name = 'Tahoma' Font.Style = [] ParentColor = False ParentFont = False OnClick = Label6Click end object Label8: TLabel Left = 151 Top = 278 Width = 137 Height = 129 Alignment = taCenter AutoSize = False Color = clWhite Font.Charset = DEFAULT_CHARSET Font.Color = clWindowText Font.Height = -107 Font.Name = 'Tahoma' Font.Style = [] ParentColor = False ParentFont = False OnClick = Label8Click end object Label9: TLabel Left = 294 Top = 278 Width = 137 Height = 129 Alignment = taCenter AutoSize = False Color = clWhite Font.Charset = DEFAULT_CHARSET Font.Color = clWindowText Font.Height = -107 Font.Name = 'Tahoma' Font.Style = [] ParentColor = False ParentFont = False OnClick = Label9Click end object Label10: TLabel Left = 437 Top = 8 Width = 221 Height = 33 AutoSize = False end object Label7: TLabel Left = 8 Top = 278 Width = 137 Height = 129 Alignment = taCenter AutoSize = False Color = clBtnHighlight Font.Charset = DEFAULT_CHARSET Font.Color = clWindowText Font.Height = -107 Font.Name = 'Tahoma' Font.Style = [] ParentColor = False ParentFont = False OnClick = Label7Click end object CloseButton: TButton Left = 437 Top = 342 Width = 137 Height = 65 Caption = 'Schlie'#223'en' TabOrder = 0 OnClick = CloseButtonClick end object NewGameButton: TButton Left = 437 Top = 271 Width = 137 Height = 65 Caption = 'Neues Spiel' TabOrder = 1 OnClick = NewGameButtonClick end end ach du liebe Zeit... was ist denn das?!:shock: |
AW: tic tac toe.... mal wieder:) versteh aufgabestellung nicht ganz
Hallo,
Das ist der Code der hinter deinem Formular steckt :mrgreen: Aber scheinbar liegts daran nicht. Du solltest den Hinweis von mleyen besser weiterverfolgen. |
AW: tic tac toe.... mal wieder:) versteh aufgabestellung nicht ganz
Tja, wenn man typisiert, kann einem so etwas nicht so schnell passieren.
Delphi-Quellcode:
[edit]:oops: Das hatte mleyen ja bereits geschrieben [/edit]
type
TBuffer = array[1..9] of string; var GBuffer: TBuffer; function CheckForWin(Buffer: TBuffer): Boolean; |
AW: tic tac toe.... mal wieder:) versteh aufgabestellung nicht ganz
Zitat:
|
AW: tic tac toe.... mal wieder:) versteh aufgabestellung nicht ganz
Delphi-Quellcode:
Das kann so bleiben, ja?
procedure TForm1.MakeArray;
begin GBuffer[1] := Label1.Caption; GBuffer[2] := Label2.Caption; GBuffer[3] := Label3.Caption; GBuffer[4] := Label4.Caption; GBuffer[5] := Label5.Caption; GBuffer[6] := Label6.Caption; GBuffer[7] := Label7.Caption; GBuffer[8] := Label8.Caption; GBuffer[9] := Label9.Caption; end; Ich starte mal... |
AW: tic tac toe.... mal wieder:) versteh aufgabestellung nicht ganz
:dancer2:
Es Fukntioniert!!!!!!! Jetzt noch mal was ganz kleines dass seit ihr mich los^^ wenn ich das dritte Feld Klicke um zu gewinnen, dann sagt er schon gewonnen obwohl da noch kein x oder O drin steht...!? |
AW: tic tac toe.... mal wieder:) versteh aufgabestellung nicht ganz
Hallo,
Dann schreib mal in den OnClicks:
Delphi-Quellcode:
if IsFieldEmpty(Label2.Caption) then
begin Label2.Caption := WriteToField(GPlayer); Label2.Repaint; // oder: Application.ProcessMessages MakeArray; // Weiterer Code |
AW: tic tac toe.... mal wieder:) versteh aufgabestellung nicht ganz
Wofür steht das Repaint?
|
Alle Zeitangaben in WEZ +1. Es ist jetzt 17:30 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz