So, no linked lists in AGK. How do i?

Started by Amon, February 28, 2018, 21:11:29

Previous topic - Next topic

MikeHart

Quote from: Qube on March 01, 2018, 19:24:27
I don't :P - In my example it assigns 10 people and person 1 is array element 0. I can understand why they would start from element 1 but I always prefer to start at 0 with arrays.


Same here.

Derron

> iterate backwards if you plan on removing element and iterate forward if you are planning on inserting elements.

This wasn't what I was talking about - I was talking about the "offsets" you create if you manually assign them different keys (or "index numbers") during myarr.insert(obj, key). In that case the iterating would no longer work - at least this is how I interpreted the documentation. Did not have it installed as ... ok, it costs money? ... wanted to write I haven't had the motivation to try it out but ... it costs money so it is nothing I would choose now (while I understand that people want to earn things for a living).

bye
Ron

Naughty Alien

..its amazing how some things, relatively simple, easy turn in to quantum mechanics discussions here...you gotta love this forum.. :)

Qube

Quote..its amazing how some things, relatively simple, easy turn in to quantum mechanics discussions here...you gotta love this forum..
I'm sure we can squeeze at least 10 pages about arrays our of this :P

QuoteThis wasn't what I was talking about - I was talking about the "offsets" you create if you manually assign them different keys (or "index numbers") during myarr.insert(obj, key). In that case the iterating would no longer work - at least this is how I interpreted the documentation.
It's myarr.insert( index, value ) :P and if you need to go through them all and insert anywhere / change anything then just do it in something like a While / Wend loop starting from 0. It's not hard to interate and add at the same time.

For example if your going through all the elements and need to add new ones at the end then simply


howMany = myArray.length

For count = 0 To HowMany
   If myArray[ count ] = 1 Then myArray.insert( 2 )
Next


But if you wanted to iterate and insert at your current location then simply


howMany = myArray.length
howManyAdded = 0
atIndex = 0

While atIndex < howMany + howManyAdded
   If myArray[ atIndex ] = 1
      myArray[ atIndex ].insert ( atIndex, 2 )
      Inc howManyAdded, 1
      Inc atIndex, 2 // skips the newly inserted item and goes to the next one
   Else
      Inc atIndex, 1
   EndIf
Wend


Easy peasy, lemon squeezy ;D
Mac Studio M1 Max ( 10 core CPU - 24 core GPU ), 32GB LPDDR5, 512GB SSD,
Beelink SER7 Mini Gaming PC, Ryzen 7 7840HS 8-Core 16-Thread 5.1GHz Processor, 32G DDR5 RAM 1T PCIe 4.0 SSD
MSI MEG 342C 34" QD-OLED Monitor

Until the next time.

Steve Elliott

Quote
..its amazing how some things, relatively simple, easy turn in to quantum mechanics discussions here...you gotta love this forum.. :)

My thoughts exactly.  Some people have very strong opinions here.  Maybe instead go work on a project...Oh look a SyntaxBomb Game Competition!  ;D
Win11 64Gb 12th Gen Intel i9 12900K 3.2Ghz Nvidia RTX 3070Ti 8Gb
Win11 16Gb 12th Gen Intel i5 12450H 2Ghz Nvidia RTX 2050 8Gb
Win11  Pro 8Gb Celeron Intel UHD Graphics 600
Win10/Linux Mint 16Gb 4th Gen Intel i5 4570 3.2GHz, Nvidia GeForce GTX 1050 2Gb
macOS 32Gb Apple M2Max
pi5 8Gb
Spectrum Next 2Mb

Derron

I just wanted to avoid a potential error/flaw to get proposed as a solution to someone who asked a question.

Dunno why this is marked as "strong opinion" or "quantum [..] discussions". I think the thread evolved into something answering the whole thing in more detail then expected - imho a good thing.

bye
Ron

Amon


Rick Nasher

Quote from: Derron on March 01, 2018, 23:31:26
.. Did not have it installed as ... ok, it costs money? ... wanted to write I haven't had the motivation to try it out but ... it costs money so it is nothing I would choose now (while I understand that people want to earn things for a living).

*Free limited trial: https://www.appgamekit.com/trial
_______________________________________
B3D + physics + shaders + X-platform = AGK!
:D ..ALIENBREED *LIVES* (thanks to Qube).. :D
_______________________________________

Derron

Thanks Rick.

Is the IDE on Windows also based on Geany? (on Linux it starts a rebranded "based on Geany 1.24" variant of geany). As Geany is GPL some sources need to be provided too - at least they do for some stuff. Found the part for functions definitions (TagManager) but still looking for the Debugger-stuff. For my geany I made a BlitzMax-Module only being activated when focusing a .bmx file (it then adds compilation options + buttons to the menu) but it still misses the tooltips for functions (params), some kind of autocomplete and the debugger stuff.
At least they (AGK creators) chooses a fast and nice scintilla-editor as base.


bye
Ron 

Rick Nasher

#24
[post moved]
_______________________________________
B3D + physics + shaders + X-platform = AGK!
:D ..ALIENBREED *LIVES* (thanks to Qube).. :D
_______________________________________

Derron

#25
As the other things are System-based widgets. Maybe you could edit your Editor/share/geany.gtkrc.windows and append some stuff to manipulate widget appearance but I never tried, so dunno if this would be successful or not.

Edit: having duckduckgo'd for "geany.gtkrc.windows dark theme" I found this:

geany with a dark theme (and German localization - which the AGK dudes removed somehow as I got only partial texts translated, even the most ones translated on my Geany are English on theirs)

http://www.henrykoch.de/en/geany-editor-in-ubuntu-configure-a-dark-colored-theme



bye
Ron

Derron

You could then just create a _custom_ ressource file - so you keep the bright one for day, and the dark for the night.

Create a launch_editor_dark.bat and put something in like
set GTK2_RC_FILES=PATH\TO\YOUR\gtkrc
Geany64.exe

This will set the GTK2_RC_FILES environment variable for just this call (so only this execution).

PS: Maybe Qube could split our posts into a new thread - from your "quoting me" phost about the trial up to this - to avoid derailing that thread.

bye
Ron

Rick Nasher

#27
[Post moved]
_______________________________________
B3D + physics + shaders + X-platform = AGK!
:D ..ALIENBREED *LIVES* (thanks to Qube).. :D
_______________________________________

Derron



To do this: Follow the instructions in
C:\Program Files\The Game Creators\AGK2Trial\Tier 1\Editor\Changing IDE Theme.txt

The above screenshot is using
include "../share/themes/Nodoka-Midnight/gtk-2.0/gtkrc"

(line 41 of the geany.gtkrc file)

You can even download new ones from www.gnome-looks.org and other websites - should be for GTK 2.x then.


bye
Ron

Rick Nasher

#29
@ Derron
As Qube apparently is busy / didn't notice our request to clean up this thread, I've copied our posts below, replaced my posts here by [Post moved] and created a new thread for it here:

https://www.syntaxbomb.com/index.php/topic,4232.new.html#new

Perhaps you can also take away your posts from below to tidy up this thread a bit?
_______________________________________
B3D + physics + shaders + X-platform = AGK!
:D ..ALIENBREED *LIVES* (thanks to Qube).. :D
_______________________________________