AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Sprachen und Entwicklungsumgebungen Object-Pascal / Delphi-Language tic tac toe.... mal wieder:) versteh aufgabestellung nicht ganz

tic tac toe.... mal wieder:) versteh aufgabestellung nicht ganz

Ein Thema von biby90 · begonnen am 22. Aug 2011 · letzter Beitrag vom 31. Aug 2011
Thema geschlossen
Seite 12 von 18   « Erste     2101112 1314     Letzte » 
Benutzerbild von DeddyH
DeddyH

Registriert seit: 17. Sep 2006
Ort: Barchfeld
27.534 Beiträge
 
Delphi 11 Alexandria
 
#111

AW: tic tac toe.... mal wieder:) versteh aufgabestellung nicht ganz

  Alt 25. Aug 2011, 10:47
Oder rechte Maustaste aufs Fomular -> Ansicht als Text/Ansicht als Formular
Detlef
"Ich habe Angst vor dem Tag, an dem die Technologie unsere menschlichen Interaktionen übertrumpft. Die Welt wird eine Generation von Idioten bekommen." (Albert Einstein)
Dieser Tag ist längst gekommen
 
Benutzerbild von mleyen
mleyen

Registriert seit: 10. Aug 2007
609 Beiträge
 
FreePascal / Lazarus
 
#112

AW: tic tac toe.... mal wieder:) versteh aufgabestellung nicht ganz

  Alt 25. Aug 2011, 10:50
function TForm1.CheckForWin(AIndex: array of string): Boolean;
Hier liegt das Problem. Bei normalen Arrays fängt der Index bei 0 an.
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;
 
biby90
(Gast)

n/a Beiträge
 
#113

AW: tic tac toe.... mal wieder:) versteh aufgabestellung nicht ganz

  Alt 25. Aug 2011, 10:58
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?!
 
Benutzerbild von Neutral General
Neutral General

Registriert seit: 16. Jan 2004
Ort: Bendorf
5.219 Beiträge
 
Delphi 10.2 Tokyo Professional
 
#114

AW: tic tac toe.... mal wieder:) versteh aufgabestellung nicht ganz

  Alt 25. Aug 2011, 11:00
Hallo,

Das ist der Code der hinter deinem Formular steckt
Aber scheinbar liegts daran nicht. Du solltest den Hinweis von mleyen besser weiterverfolgen.
Michael
"Programmers talk about software development on weekends, vacations, and over meals not because they lack imagination,
but because their imagination reveals worlds that others cannot see."
 
Benutzerbild von DeddyH
DeddyH

Registriert seit: 17. Sep 2006
Ort: Barchfeld
27.534 Beiträge
 
Delphi 11 Alexandria
 
#115

AW: tic tac toe.... mal wieder:) versteh aufgabestellung nicht ganz

  Alt 25. Aug 2011, 11:04
Tja, wenn man typisiert, kann einem so etwas nicht so schnell passieren.
Delphi-Quellcode:
type
  TBuffer = array[1..9] of string;

var
  GBuffer: TBuffer;

function CheckForWin(Buffer: TBuffer): Boolean;
[edit] Das hatte mleyen ja bereits geschrieben [/edit]
Detlef
"Ich habe Angst vor dem Tag, an dem die Technologie unsere menschlichen Interaktionen übertrumpft. Die Welt wird eine Generation von Idioten bekommen." (Albert Einstein)
Dieser Tag ist längst gekommen
 
biby90
(Gast)

n/a Beiträge
 
#116

AW: tic tac toe.... mal wieder:) versteh aufgabestellung nicht ganz

  Alt 25. Aug 2011, 11:04
Zitat:
Das ist der Code der hinter deinem Formular steckt
joa, hab ich mir gedacht.... wusste garnicht, dass es das gibt
 
biby90
(Gast)

n/a Beiträge
 
#117

AW: tic tac toe.... mal wieder:) versteh aufgabestellung nicht ganz

  Alt 25. Aug 2011, 11:08
Delphi-Quellcode:
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;
Das kann so bleiben, ja?
Ich starte mal...
 
biby90
(Gast)

n/a Beiträge
 
#118

AW: tic tac toe.... mal wieder:) versteh aufgabestellung nicht ganz

  Alt 25. Aug 2011, 11:10

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...!?
 
Benutzerbild von Neutral General
Neutral General

Registriert seit: 16. Jan 2004
Ort: Bendorf
5.219 Beiträge
 
Delphi 10.2 Tokyo Professional
 
#119

AW: tic tac toe.... mal wieder:) versteh aufgabestellung nicht ganz

  Alt 25. Aug 2011, 11:12
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
Michael
"Programmers talk about software development on weekends, vacations, and over meals not because they lack imagination,
but because their imagination reveals worlds that others cannot see."
 
biby90
(Gast)

n/a Beiträge
 
#120

AW: tic tac toe.... mal wieder:) versteh aufgabestellung nicht ganz

  Alt 25. Aug 2011, 11:13
Wofür steht das Repaint?
 
Thema geschlossen
Seite 12 von 18   « Erste     2101112 1314     Letzte » 

Themen-Optionen Thema durchsuchen
Thema durchsuchen:

Erweiterte Suche
Ansicht

Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 13:25 Uhr.
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz