Jump to content

Tennis - Mix doubles team gen


Recommended Posts

Super simple super quick script I made to randomize teams for mixed doubles. Haven't coded for a while so it felt good to write anything. 


#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <SliderConstants.au3>
#include <WindowsConstants.au3>
#include <MsgBoxConstants.au3>
#include <Array.au3>
#include <Excel.au3>

Local $arraySize = 2
local $array1[50] = ["Doug","Julio"]
local $array2[50] = ["Hannah","Sheila"]
Local $oBook

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Doubles Team Mixer", 615, 438, 192, 124)
$Bachround = GUICtrlCreatePic("C:\Users\a607150\Pictures\2.jpg",0,0,615,438)
$Input1 = GUICtrlCreateInput("", 64, 128, 121, 175)
$Input2 = GUICtrlCreateInput("", 364, 128, 121, 175)
$Button1 = GUICtrlCreateButton("Serve",216,140,121,42)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
         Case $Button1
            $array1 = GUICtrlRead($input1)
            $array1 = StringSplit($array1,",")
            $array2 = GUICtrlRead($input2)
            $array2 = StringSplit($array2,",")
            $oBook = _Excel_Open(Default, Default, Default, Default, True)
            $oWorkBook = _Excel_BookNew($oBook, 1)
            If @error Then Exit MsgBox($MB_SYSTEMMODAL, "Excel UDF: _Excel_RangeWrite Example 2", "Error writing $array1 to worksheet." & @CRLF & "@error = " & @error & ", @extended = " & @extended)


Thanks for your time


Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...