rabbitkillrun2 Posted August 4, 2010 Share Posted August 4, 2010 (edited) I've been wanting to have a go at writing the game of life for a while now, and after some rough planning and psuedocode, I'd like to give it a go in autoit. The main problem I have is I'm not sure how to create the squares. The only experience I have with creating GUIs is just the bog-standard Windows controls. Any suggestions on this?Also, has anyone on here tried this before? I did a quick search but nothing relevant came up. Just curious. Edited August 5, 2010 by rabbitkillrun2 Link to comment Share on other sites More sharing options...
smashly Posted August 5, 2010 Share Posted August 5, 2010 Hi, You could use Labels to make a grid and set the color of the labels as needed.expandcollapse popup#include <StaticConstants.au3> HotKeySet("{ESC}", "_Exit") Global $x, $y, $iSqare[442] GUICreate("test", 420, 420) For $i = 1 To 441 $iSqare[$i] = GUICtrlCreateLabel("", $x, $y, 20, 20) If Not Mod($i, 2) Then GUICtrlSetBkColor($iSqare[$i], 0x000000) Else GUICtrlSetBkColor($iSqare[$i], 0xffffff) EndIf If Not Mod($i, 21) Then $x = 0 $y += 20 Else $x += 20 EndIf Next GUISetState() While 1 Sleep(1000) For $i = 1 To 441 GUICtrlSetStyle($iSqare[$i], $SS_GRAYFRAME) Next Sleep(1000) For $i = 1 To 441 GUICtrlSetStyle($iSqare[$i], $GUI_SS_DEFAULT_LABEL) Next WEnd Func _Exit() Exit EndFunc ;==>_Exit Sorry I haven't any clue about the game your wanting to replicate, sounds like a lot of math. My math skill is minimal so it's not something I could approach myself Cheers Link to comment Share on other sites More sharing options...
doudou Posted August 5, 2010 Share Posted August 5, 2010 Oh, boy. You have a hell of a job at your hands! While ago I was involved in Game Of Life development in C and we kept running into serious performance troubles every now and then with grids larger than 100x100 (and this is where GOL starts being interesting). A powerful CA will be difficult enough in AutoIt as it lacks native hashing routines and then comes GUI... well, GUI with a static grid isn't actually that complicated but let me give you this advice: don't use any controls for cells - you would produce a huge drain of system resources, take something like GraphGDIPlus or OpenGL to draw the grid directly. UDFS & Apps: Spoiler DDEML.au3 - DDE Client + ServerLocalization.au3 - localize your scriptsTLI.au3 - type information on COM objects (TLBINF emulation)TLBAutoEnum.au3 - auto-import of COM constants (enums)AU3Automation - export AU3 scripts via COM interfacesTypeLibInspector - OleView was yesterday Coder's last words before final release: WE APOLOGIZE FOR INCONVENIENCEÂ Link to comment Share on other sites More sharing options...
AndyG Posted August 5, 2010 Share Posted August 5, 2010 In the German AutoIt-Forum, Jautois has published his Version of Game of Life Link to comment Share on other sites More sharing options...
rabbitkillrun2 Posted August 5, 2010 Author Share Posted August 5, 2010 Thanks for the replies guys. No, I won't be using controls for cells, but that's the only experience I have, so I wasn't sure of the alternatives. I'll look into GraphGDIPlus and OpenGL. And thanks for the link to someone else's attempt. A side question, in case anyone here has experience: Does anyone know of any good online tutorials or other help to begin learning C? Link to comment Share on other sites More sharing options...
Zibit Posted August 5, 2010 Share Posted August 5, 2010 Squares ? id use GDI Plus rather than GUI Controls. Creator Of Xtreme DevelopersPixel Pattern UDFTray GUI UDFMathssend & recive register scriptMouse Control via Webcam Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now