Sign in to follow this  
Followers 0
Darknight1366

Game Tic Tac Toe

Game/Script   1 member has voted

  1. 1. Good Game Or Bad Game?

    • Good
      0
    • Bad
    • Not So bad for you
      0
    • Not so good for you
      0

Please sign in or register to vote in this poll.

19 posts in this topic

#1 ·  Posted (edited)

#include <GUIConstants.au3>
#include <ARRAY.AU3>

Global $turn = True;true means player false means ai
Global $grid[4][4]
Global $button[4][4]
Global $string_eval[9]
Global $content[9]
Global $moves = 0
Global $computer_win = 0
Global $total = 0
Global $playerwin = 0

$content[1] = "31,32,33"
$content[2] = "21,22,23"
$content[3] = "11,12,13"
$content[4] = "11,22,33"
$content[5] = "11,21,31"
$content[6] = "12,22,32"
$content[7] = "13,23,33"
$content[8] = "13,22,31"
$Form1 = GUICreate("Beat-me Tic-Tac-Toe – Created By Darknight", 420, 347, 420, 125)
GUICtrlCreateLabel("Computer Win", 10, 10, 71, 17)
$cwin = GUICtrlCreateLabel("00", 90, 10, 25, 17)
GUICtrlCreateLabel("Player Win", 140, 10, 55, 17)
$pwin = GUICtrlCreateLabel("00", 205, 10, 25, 17)
GUICtrlCreateLabel("Games", 250, 10, 37, 17)
$games = GUICtrlCreateLabel("00", 295, 10, 16, 17)
$Button[1][1] = GUICtrlCreateButton("", 44, 72, 57, 57, 0)
GUICtrlSetFont(-1, 20, 800, 0, "MS Sans Serif")
$Button[1][2] = GUICtrlCreateButton("", 134, 72, 57, 57, 0)
GUICtrlSetFont(-1, 20, 800, 0, "MS Sans Serif")
$Button[1][3] = GUICtrlCreateButton("", 224, 72, 57, 57, 0)
GUICtrlSetFont(-1, 20, 800, 0, "MS Sans Serif")
$Button[2][3] = GUICtrlCreateButton("", 224, 152, 57, 57, 0)
GUICtrlSetFont(-1, 20, 800, 0, "MS Sans Serif")
$Button[2][1] = GUICtrlCreateButton("", 44, 152, 57, 57, 0)
GUICtrlSetFont(-1, 20, 800, 0, "MS Sans Serif")
$Button[2][2] = GUICtrlCreateButton("", 134, 152, 57, 57, 0)
GUICtrlSetFont(-1, 20, 800, 0, "MS Sans Serif")
$Button[3][3] = GUICtrlCreateButton("", 224, 232, 57, 57, 0)
GUICtrlSetFont(-1, 20, 800, 0, "MS Sans Serif")
$Button[3][2] = GUICtrlCreateButton("", 134, 232, 57, 57, 0)
GUICtrlSetFont(-1, 20, 800, 0, "MS Sans Serif")
$Button[3][1] = GUICtrlCreateButton("", 44, 232, 57, 57, 0)
GUICtrlSetFont(-1, 20, 800, 0, "MS Sans Serif")
$Label1 = GUICtrlCreateLabel("Press any Button", 100, 40, 200, 17)
GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif")
$reset = GUICtrlCreateButton("Reset", 112, 312, 97, 25, 0)
GUISetState(@SW_SHOW)
For $i = 1 to 3;column
    For $j = 1 to 3;row
        $grid[$i][$j] = 0
    Next
Next

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $button [1][1]
            If $grid[1][1] = 0 And BitAND(GUICtrlGetState($button [1][1]),$GUI_ENABLE) Then
                _clicked (1,1)
            EndIf
         Case $button [1][2]
            If $grid[1][2] = 0 And BitAND(GUICtrlGetState($button [1][2]),$GUI_ENABLE) Then
                _clicked (1,2)
            EndIf

        Case $button [1][3]
            If $grid[1][3] = 0 And BitAND(GUICtrlGetState($button [1][3]),$GUI_ENABLE) Then
                _clicked (1,3)
            EndIf

        Case $button [2][1]
            If $grid[2][1] = 0 And BitAND(GUICtrlGetState($button [2][1]),$GUI_ENABLE) Then
                _clicked (2,1)
            EndIf

        Case $button [2][2]
            If $grid[2][2] = 0 And BitAND(GUICtrlGetState($button [2][2]),$GUI_ENABLE) Then
                _clicked (2,2)
            EndIf

        Case $button [2][3]
            If $grid[2][3] = 0 And BitAND(GUICtrlGetState($button [2][3]),$GUI_ENABLE) Then
                _clicked (2,3)
            EndIf

        Case $button [3][1]
            If $grid[3][1] = 0 And BitAND(GUICtrlGetState($button [3][1]),$GUI_ENABLE) Then
                _clicked (3,1)
            EndIf

        Case $button[3][2]
             If $grid[3][2] = 0 And BitAND(GUICtrlGetState($button [3][2]),$GUI_ENABLE) Then
                _clicked (3,2)
            EndIf

        Case $button [3][3]
            If $grid[3][3] = 0 And BitAND(GUICtrlGetState($button [3][3]),$GUI_ENABLE) Then
                _clicked (3,3)
            EndIf
        Case $reset
            If $computer_win = 1 Then GUICtrlSetData($cwin, GUICtrlRead($cwin)+1)
            If $playerwin = 1 Then GUICtrlSetData($pwin, GUICtrlRead($pwin)+1)
            GUICtrlSetData ($Label1, "Your Turn")
            For $i = 1 to 3;column
                For $j = 1 to 3;row
                    $grid[$i][$j] = 0
                    GUICtrlSetState($button[$i][$j], $GUI_ENABLE)
                    GUICtrlSetData($button[$i][$j], "")
                Next
            Next
            $moves = 0
            $turn = True
            $total +=1
            $computer_win = 0
            $playerwin = 0
            GUICtrlSetData($games, $total)
    EndSwitch
    If $moves = 9 And $computer_win = 0 Then
        GUICtrlSetData ($Label1, "Nobody won")

        $moves = 0
    EndIf
WEnd

Func string_eval()
    For $j=1 To 8
        $string_eval[$j] = 0
    Next
    For $j=1 To 3
        $string_eval[1] +=  $grid[3][$j]
        $string_eval[2] +=  $grid[2][$j]
        $string_eval[3] +=  $grid[1][$j]
        $string_eval[5] +=  $grid[$j][1]
        $string_eval[6] +=  $grid[$j][2]
        $string_eval[7] +=  $grid[$j][3]
    Next
    $string_eval[4] =  $grid[1][1]+$grid[2][2]+$grid[3][3]
    $string_eval[8] =  $grid[1][3]+$grid[2][2]+$grid[3][1]
EndFunc

Func _clicked ($row, $column)
    If $moves = 9 Then Return
    Local $found_win = 0
        If $turn = true Then
            If BitAND(GUICtrlGetState($button [$row][$column]),$GUI_ENABLE) Then
                GUICtrlSetData ($button[$row][$column], "X")
                GUICtrlSetState ($button[$row][$column], $gui_disable)
                GUICtrlSetData ($Label1, "Thinking...")
                $grid[$row][$column] = 5
                $turn = False
                $moves +=1
                string_eval()
                For $i=1 To 8
                    If $string_eval[$i] = 15 Then   ;player won
                        $playerwin = 1
                        GUICtrlSetData ($Label1, "You Won")
                        Return
                    EndIf
                Next
                If $moves = 9 Then Return
            Else
                Return
            EndIf
        EndIf
        If $turn = False Then
            Select
                Case $moves = 1
                    If $grid[2][2] = 5 Then
                        GUICtrlSetData ($button[1][1], "O")
                        GUICtrlSetState ($button[1][1], $gui_disable)
                        GUICtrlSetData ($Label1, "Your Turn...")
                        $grid[1][1] = 1
                        $moves +=1
                        If $moves = 9 Then Return
                        $turn = True
                        Return
                    EndIf
                    If $grid[2][2] = 0 Then
                        GUICtrlSetData ($button[2][2], "O")
                        GUICtrlSetState ($button[2][2], $gui_disable)
                        GUICtrlSetData ($Label1, "Your Turn...")
                        $grid[2][2] = 1
                        $moves +=1
                        If $moves = 9 Then Return
                        $turn = True
                        Return
                    EndIf
                Case $moves >2
                    string_eval()
                    For $i=1 To 8
                        If $string_eval[$i] = 2 Then    ;go for win
                            $found_win = 1
                            $row_played = StringSplit($content[$i], ",")
                            For $k=1 To 3
                                $ids = StringSplit($row_played[$k], "")
                                If $grid[$ids[1]][$ids[2]] = 0 Then     ;3rd empty - play there
                                    GUICtrlSetData ($button[$ids[1]][$ids[2]], "O")
                                    GUICtrlSetState ($button[$ids[1]][$ids[2]], $gui_disable)
                                    GUICtrlSetData ($Label1, "I Won")
                                    $computer_win=1
                                    $grid[$ids[1]][$ids[2]] = 1
                                    Return
                                EndIf
                            Next
                        EndIf
                    Next
                    For $i=1 To 8
                        If $string_eval[$i] = 10 Then   ;2 in a row from player
                            $row_played = StringSplit($content[$i], ",")
                            For $k=1 To 3
                                $ids = StringSplit($row_played[$k], "")
                                If $grid[$ids[1]][$ids[2]] = 0 Then     ;3rd empty - play there
                                    GUICtrlSetData ($button[$ids[1]][$ids[2]], "O")
                                    GUICtrlSetState ($button[$ids[1]][$ids[2]], $gui_disable)
                                    GUICtrlSetData ($Label1, "Your Turn...")
                                    $grid[$ids[1]][$ids[2]] = 1
                                    $moves +=1
                                    If $moves = 9 Then Return
                                    $turn = True
                                    Return
                                EndIf
                            Next
                        EndIf
                    Next
                    If $string_eval[4] = 11 Then
                        If $grid [1][1] = 5 And $grid [3][3] = 5 And $moves < 4 Then
                            GUICtrlSetData ($button[1][2], "O")
                            GUICtrlSetState ($button[1][2], $gui_disable)
                            GUICtrlSetData ($Label1, "Your Turn...")
                            $grid[1][2] = 1
                            $moves +=1
                            If $moves = 9 Then Return
                            $turn = True
                            Return
                        EndIf
                        If $grid [2][2] = 5 And $grid [3][3] = 5 And $moves < 4 Then
                            GUICtrlSetData ($button[1][3], "O")
                            GUICtrlSetState ($button[1][3], $gui_disable)
                            GUICtrlSetData ($Label1, "Your Turn...")
                            $grid[1][3] = 1
                            $moves +=1
                            If $moves = 9 Then Return
                            $turn = True
                            Return
                        EndIf
                    EndIf
                    If $grid [1][2] = 5 And $grid [3][3] = 5 And $moves < 4 Then
                        GUICtrlSetData ($button[1][3], "O")
                        GUICtrlSetState ($button[1][3], $gui_disable)
                        GUICtrlSetData ($Label1, "Your Turn...")
                        $grid[1][3] = 1
                        $moves +=1
                        If $moves = 9 Then Return
                        $turn = True
                        Return
                    EndIf
                    If $grid [2][3] = 5 And $grid [3][2] = 5 And $moves < 4 Then
                        GUICtrlSetData ($button[3][3], "O")
                        GUICtrlSetState ($button[3][3], $gui_disable)
                        GUICtrlSetData ($Label1, "Your Turn...")
                        $grid[3][3] = 1
                        $moves +=1
                        If $moves = 9 Then Return
                        $turn = True
                        Return
                    EndIf
                    If $grid [1][2] = 5 And $grid [3][1] = 5 And $moves < 4 Then
                        GUICtrlSetData ($button[1][1], "O")
                        GUICtrlSetState ($button[1][1], $gui_disable)
                        GUICtrlSetData ($Label1, "Your Turn...")
                        $grid[1][1] = 1
                        $moves +=1
                        If $moves = 9 Then Return
                        $turn = True
                        Return
                    EndIf
                    For $x=1 To 8
                        If $string_eval[$x] <> 10 And $string_eval[$x] <> 2 Then    ;2 in a row from player
                            If $string_eval[$x] = 1 Then
                                $row_played = StringSplit($content[$x], ",")
                                For $k=1 To 3
                                    $ids = StringSplit($row_played[$k], "")
                                    If $grid[$ids[1]][$ids[2]] = 0 Then     ;3rd empty - play there
                                        GUICtrlSetData ($button[$ids[1]][$ids[2]], "O")
                                        GUICtrlSetState ($button[$ids[1]][$ids[2]], $gui_disable)
                                        GUICtrlSetData ($Label1, "Your Turn...")
                                        $grid[$ids[1]][$ids[2]] = 1
                                        $moves +=1
                                        If $moves = 9 Then Return
                                        $turn = True
                                        Return
                                    EndIf
                                Next
                            ElseIf $string_eval[$x] = 5 Then
                                $row_played = StringSplit($content[$x], ",")
                                For $k=1 To 3
                                    $ids = StringSplit($row_played[$k], "")
                                    If $grid[$ids[1]][$ids[2]] = 0 Then     ;3rd empty - play there
                                        GUICtrlSetData ($button[$ids[1]][$ids[2]], "O")
                                        GUICtrlSetState ($button[$ids[1]][$ids[2]], $gui_disable)
                                        GUICtrlSetData ($Label1, "Your Turn...")
                                        $grid[$ids[1]][$ids[2]] = 1
                                        $moves +=1
                                        If $moves = 9 Then Return
                                        $turn = True
                                        Return
                                    EndIf
                                Next
                            EndIf
                        EndIf
                    Next
            EndSelect
        EndIf
EndFunc

Edited by Darknight1366

Visit HugeSoft(TM) To Get Any Coding Help or Anything

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

How's WHAT ?

For questions there is the general help section!

And could you at least drop in some useful or clarifying text as to what You and your Code are all about.

And the same goos of course for the topic title.

Looking at your track record I see your not very good at meaningful titles ... I suggest you start thinking about learning that part.

Edited by MvGulik

"Straight_and_Crooked_Thinking" : A "classic guide to ferreting out untruths, half-truths, and other distortions of facts in political and social discussions."
"The Secrets of Quantum Physics" : New and excellent 2 part documentary on Quantum Physics by Jim Al-Khalili. (Dec 2014)

"Believing what you know ain't so" ...

Knock Knock ...
 

Share this post


Link to post
Share on other sites

lolal, I meant How's this script? Is it good or bad?


Visit HugeSoft(TM) To Get Any Coding Help or Anything

Share this post


Link to post
Share on other sites

lolal, I meant How's this script? Is it good or bad?

Still doesn't change the fact that the title should read something like "Tic-Tac-Toe Game"

_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 04/09/2015

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

... Yep. And in that case ... Awaiting topic change to something like "[Game] Tic-Tac-Toe. Please comment my code. Is it good or bad?"

(HowTo: Edit first message in full-editor mode ... Or ask a moderator.)

Edited by MvGulik

"Straight_and_Crooked_Thinking" : A "classic guide to ferreting out untruths, half-truths, and other distortions of facts in political and social discussions."
"The Secrets of Quantum Physics" : New and excellent 2 part documentary on Quantum Physics by Jim Al-Khalili. (Dec 2014)

"Believing what you know ain't so" ...

Knock Knock ...
 

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

:P

Are you asking if my script is good or bad? I didn't check the code differences - My guess that the only different part is:

"Beat-me Tic-Tac-Toe – Created By Darknight"

Dude - you know very well you took a script made by somebody else, rewrote the title and tried to post it as your own.

:x haven't seen a bigger dumbass in ages.

The link to my script is in my sig.

:shifty: It still has the bug which was corrected in my last update.

Edited by enaiman

SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script

wannabe "Unbeatable" Tic-Tac-Toe

Paper-Scissor-Rock ... try to beat it anyway :)

Share this post


Link to post
Share on other sites

What a low life the OP is, to not even attempt to change the script from the original is pretty pathetic.


If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites

@enaiman can you proof that it's your script?


Visit HugeSoft(TM) To Get Any Coding Help or Anything

Share this post


Link to post
Share on other sites

liar!!


Visit HugeSoft(TM) To Get Any Coding Help or Anything

Share this post


Link to post
Share on other sites

@Darknight1366

You would be a perfect candidate for a Darwin award.

@JohnOne, @taietel

Thanks for giving appropriate replies to OP, he must be high or someting.


SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script

wannabe "Unbeatable" Tic-Tac-Toe

Paper-Scissor-Rock ... try to beat it anyway :)

Share this post


Link to post
Share on other sites

I just did a comparison and there are a few changes but then I think enaiman updated his version since the OP has added theirs. Plus, from looking at the previous questions the OP has asked on the Forum, a program of this stature did seem a little out of their AutoIt knowledge. I would even find it a little difficult to write the algorithm :x


_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 04/09/2015

Share this post


Link to post
Share on other sites

I just tested this against my own version and the result was 15 draws. Not a bad sign for both programs. However I could not alternate the first move between program 1 and program 2. That would have been better. :x

Share this post


Link to post
Share on other sites

@czardas

It will take a bit of work to make the first move go from the one to the other but it is possible.

I really doubt it'll worth the effort because it will be an endless string of draws. I still think mine is un-beatable. It is not an example of "real" AI because there are several certain positions hard-coded in the script. I have started working on a "real" AI one but didn't have the time to finish it ... maybe sometime in the future I will. That one will not have any hard-coded positions to check but it will do everything by reading the current position and calculating scores.

Well, I hope to get back to that one :x

Took you a long while to think about matching the twos :P


SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script

wannabe "Unbeatable" Tic-Tac-Toe

Paper-Scissor-Rock ... try to beat it anyway :)

Share this post


Link to post
Share on other sites

enaiman

Well I had tested them against each other previously. I agree that it would be nothing more than a coding exercise, as was my project which was inspired by CodyBarret's question in another thread. I was more concerned about what creating an AI engine for a simple game like this would teach me. :x

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.
Sign in to follow this  
Followers 0