# Simple 3D Array

## Recommended Posts

To save myself a "search" nightmare, I'm trying to wrap my head around 3D arrays.

Example: In "No Limit Hold'em", if I only play kings "KK" and queens "QQ"

and I only play them from the positions of the "Button" or "Blinds"

and do one thing if it's raised ahead or another if not raised.

I know that this example would be simple as a 2D array but if I'm dealing with 77 possible hands in 9 possible positions and 6 possible conditions then I'm dealing with almost 700 data lines.

Lastly, if I have a variables to represent the hand like \$hand = "QQ"

and \$position = "Button" and \$ahead = "Raised", could the 3D array simplify my search, or should I just stick to the 2D array ??

Thank you in advance for any thoughts...

##### Share on other sites

There is a lot wrapped up in that question ... but you don't need all that data to create poker logic. <snip>

Edited by JLogan3o13

Build your own poker game with AutoIt: pokerlogic.au3 | Learn To Program Using FREE Tools with AutoIt

##### Share on other sites

@Randwulf had you submitted to the "search" nightmare you might have come across our forum rules, especially the part on game automation, before posting. Please read them now before posting again - and please let's know go down the "but it was just an example path"

To others <snarkiness removed>

Edited by JLogan3o13
• 1

√-1 2^3 ∑ π, and it was delicious!

##### Share on other sites
This topic is now closed to further replies.

• ### Similar Content

• By DarkFingers1337
Hey,
what is more efficient, using multiple arrays or one multidimensional array?

; Hamster data structure using multiple arrays Global \$HamsterCount = 6 Global \$HamsterX[\$HamsterCount] Global \$HamsterY[\$HamsterCount] ;giving each hamster an x and y position For \$i=0 To \$HamsterCount-1 \$HamsterX[\$i] = 0 \$HamsterY[\$i] = 0 Next ; The same hamster data structure using one multidimensional array Global \$HAMSTER_COUNT = 6 Global Enum \$HAMSTER_X, _ \$HAMSTER_Y, _ \$HAMSTER_MAX Global \$Hamsters[\$HAMSTER_COUNT][\$HAMSTER_MAX] ;giving each hamster an x and y position For \$i=0 To \$HAMSTER_COUNT-1 \$Hamsters[\$i][\$HAMSTER_X] = 0 \$Hamsters[\$i][\$HAMSTER_Y] = 0 Next
• By Skysnake
I know how JSON works. However JSON data is typically received from web based servers.

My question is:
Has anyone considered to use, or currently actively using JSON as an internal data container?
Internal here as in an ordinary AutoIt data type, generated, populated and manipulated within an AutoIt script, without any external data sources.
The JSON and BinaryCall UDFs work well and appear the de facto defaults. Are there any thoughts on using JSON for internal variable values instead of the typical array?
Also, there can be situations where such a JSON collection contains an array and it will have to be parsed using typical array functions.
Currently I am working on a small project where I have to keep and use various identifiers from different sources. There are several ideas in this regard, some involving SQL child tables and arrays stored with keys (maps), which lead me to think that JSON may be a more suitable data container. It readily shrinks and stretches, allowing for dynamic data growth.  JSONs ability to add new repeating data groups on the fly makes it particularly powerful and appealing.
Ideas and suggestions welcome
Skysnake
• By XinYoung
Hello all! I hope everyone is enjoying their holiday festivities.
I'm working on a script that involves copying a string of text from an Excel workbook and searching for it in a particular website's search tool. If a result is found, it will do something. If not, it will do something else.
So far, it can successfully execute the search -- and then it shows me the results in an array.
Screenshot of the successful search:

The search results in an array:

Here's the code (sorry for all my comments):
My main question is: How do I create an If... Then based on what is found in the search results? I need additional tasks to run if Col 1, Row 2 in the array contains the exact string I searched for. (Am I going about this the right way?)
My next question (I might make a new thread for): How do I make the whole thing loop, as in, copy the next cell in the Excel sheet and do the whole thing over again until there's no more? I understand that a For/Next loop thingy would be used. I just don't know how. Loops are really confusing to me.
Thank you all for your guidance and have a happy new year!
• By lattey
hi,
i have checkboxes and each checkbox that checked, i put in array.
now, im stuck on how to loop the checked array and store in in one variable. what i can do now, is only write the result into a text file.
below is the code:
#include <GUIConstantsEx.au3> ;~ #include <MsgBoxConstants.au3> #include <ButtonConstants.au3> #include <Array.au3> Global \$Count = 3 Global \$CheckBoxP[\$Count] Global \$step[\$Count] global \$array1[1] Global \$ExitResult \$hGUI = GUICreate("Summary Steps", 500, 400) GUISetFont(12, 400, "Tahoma") GUICtrlCreateLabel( "Please Select the Summary Steps for Script Check", 70, 20) GUISetFont(10, 400, "Tahoma") Global \$array_Pstep[3] = ["fix2","fix1","fix3"] global \$step[3] = ["2","3","4"] \$Spacing = 50 For \$i = 0 To UBound(\$array_Pstep) - 1 \$CheckBoxP[\$i] = GUICtrlCreateCheckbox(\$array_Pstep[\$i], 80, \$Spacing + (20 * \$i), 65, 17) Next \$submit = GUICtrlCreateButton("Submit",180, 280, 80, 30) \$exit = GUICtrlCreateButton("Exit",180, 320, 80, 30) GUISetState() While 1 \$Msg = GUIGetMsg() Select case \$Msg=\$submit For \$i = 0 To \$Count - 1 If GUICtrlRead(\$CheckBoxP[\$i]) = \$GUI_CHECKED Then _ArrayAdd(\$array1, \$step[\$i]) EndIf Next Global \$logfilerray = @WorkingDir & "\checkedlist.txt" FileDelete (\$logfilerray) Global \$readlogfile = FileOpen(\$logfilerray,1) for \$a = 1 to UBound(\$array1) - 1 ;~ \$var=\$array1[\$a] FileWriteLine(\$readlogfile,\$array1[\$a]) Next FileClose(\$readlogfile) Exit case \$Msg=\$exit \$ExitResult = MsgBox(1,"Summary Step", "Continue to Exit ?") if \$ExitResult = 1 Then ;ok Exit EndIf Exit EndSelect WEnd
• By omicron
How do you perform a nested loop function with a multidimensional array from 2 lists.
for i in list1
(open file) extract variable
while open for i in list 2
(open file2) extract variable

var1 + var2 = (search term)

The list sizes will more than likely consist of different lengths.

What is the best approach to accomplishing this method?

×

• Wiki

• Back

• Git