Einfaches TickTackToe

    • VB.NET
    • .NET (FX) 3.0–3.5

    Es gibt 3 Antworten in diesem Thema. Der letzte Beitrag () ist von Runshak.

      Einfaches TickTackToe

      Moin Leute!

      Hab hier ein simples TickTackToe im Anhang, einmal die Exe und einmal das Projekt, falls es wer weiter ausbauen möchte :D
      Soll jetz kein SuperMegaRiesen Projekt sein, is halt einfach mal so zum zwischendurch spielen gedacht. Wie gesagt wenn jemand Lust hat und auch noch ne KI/via Netzwerk(Mehrspieler) zu basteln: Feel free 2 do it!

      Mit Strg+N kann ein neues Spiel gestartet werden!

      Lg Radinator :D
      Bilder
      • ttt_game.jpg

        24,15 kB, 360×390, 168 mal angesehen
      Dateien
      • TickTackToe.7z

        (10,4 kB, 156 mal heruntergeladen, zuletzt: )
      • TickTackToe.zip

        (18,89 kB, 176 mal heruntergeladen, zuletzt: )
      In general (across programming languages), a pointer is a number that represents a physical location in memory. A nullpointer is (almost always) one that points to 0, and is widely recognized as "not pointing to anything". Since systems have different amounts of supported memory, it doesn't always take the same number of bytes to hold that number, so we call a "native size integer" one that can hold a pointer on any particular system. - Sam Harwell
      Vereinfachung:

      VB.NET-Quellcode

      1. Private flag As Boolean
      2. Private Sub Button_Clicked(sender As Object, e As EventArgs) Handles Button1.Click, Button2.Click, Button3.Click, Button4.Click, Button5.Click, Button6.Click, Button7.Click, Button8.Click, Button9.Click
      3. DirectCast(sender, Button).Text = If(flag, "X", "O")
      4. flag = Not flag
      5. End Sub
      ^^ stimm :D Spart man sich 8 Zeilen!
      Kannte die Technik mit dem [tt]DirectCast() = If(condition, truePart[, falsePart]) gar ned ;D

      Danke!
      In general (across programming languages), a pointer is a number that represents a physical location in memory. A nullpointer is (almost always) one that points to 0, and is widely recognized as "not pointing to anything". Since systems have different amounts of supported memory, it doesn't always take the same number of bytes to hold that number, so we call a "native size integer" one that can hold a pointer on any particular system. - Sam Harwell
      optisch ok, aber von den Funktionen dürfte da mehr drin sein ;) zb. wenn man drei in einer Reihe hat...sollte man das Spiel beenden und nicht weiterspielen können...aber wie du schon sagtest, kann man das ja selbst einbauen :D