Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Linked Lists

Author
Message
chrisu
10
Years of Service
User Offline
Joined: 31st Aug 2009
Location: Austria
Posted: 17th Jul 2013 18:35
Hy folks,

I have a "little" contribution to AppGameKit for you.


Shortly after I started to do my first steps in AppGameKit Basic I immediately had to learn that the only kind of collections provided by AppGameKit are arrays.

Now, as I'm pretty used to other languages where stuff like linked lists or hash maps exist I found it kinda frustrating and demotivating to think in arrays and more or less fixed sizes again.

So I decided to create me an include module adding support to linked lists. Actually I also found it a pretty good way to get familiar with AppGameKit Basic.

To cut a long story short: Here it is, my "LinkedList.agc" library, free to use.

Yes it's FREE! However, credits are always very much appreciated


This implementation of linked lists is based on doubly linked lists. So it's possible to jump to next and previous elements.

Features:
* Kinda seamlessly embedding in terms of AppGameKit Basic
* Very comfortable in use
* Supports primitive data-types as well as a key/value concept (KV)
* High performance
* Highly flexible
* Possibility to set/get values in a hard way (performance) as well as in a soft way (flexibility)
* Built-In sorting
* Multi-Level sorting

Note: This is the first version of this lib and so it might still have some bugs - so please keep this in mind. However, if you encounter any bugs please let me know and I will happily fix them. Same is true for any ideas in terms of making this lib better or bigger.

Here's a little example program which quickly shows the use of some of "LinkedList.agc"'s functions:



Please find the library behind the according download button.

If you have any questions don't hesitate to ask.

Have phun using my lib!

Cheers,
chrisu.

Attachments

Login to view attachments
Ancient Lady
Valued Member
16
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 17th Jul 2013 19:28
Very impressive use of Memblocks.

And I did NOT know that you could add type identifier characters ('$' and '#') to function names. Thereby doing a sort of overloading. Cool!

But if you are used to languages with lists and things, why not use Tier 2?

Or, just because you can, you wanted to show that it could be done. I totally get that one.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
XanthorXIII
AGK Gold Backer
8
Years of Service
User Offline
Joined: 13th May 2011
Location:
Posted: 17th Jul 2013 19:43
Neat! I think this is a great show off of what can be done right now with the Tier 1. I haven't worked with that for a while but I think that is great.
haliop
11
Years of Service
User Offline
Joined: 2nd Sep 2008
Location:
Posted: 17th Jul 2013 21:15
wow man! that is incredible! i havent checked the code yet probably wont understand half of it

but i can already see how i implent it to my current proj! if i'll decide to , Credits will be given!
ty for this , its great.

chrisu
10
Years of Service
User Offline
Joined: 31st Aug 2009
Location: Austria
Posted: 18th Jul 2013 09:45
@Ancient Lady
Actually I chose AppGameKit for it's tier 1 as I found it necessary to be maximum platform independent.
Furthermore I love Basic - my favorite language is Pure Basic - and its simplicity having the capability to dive deeper at the same time.
chrisu
10
Years of Service
User Offline
Joined: 31st Aug 2009
Location: Austria
Posted: 18th Jul 2013 09:51
@all: thx a lot for your positive feedback
Van B
Moderator
17
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 18th Jul 2013 14:13
Nice work! - I think it's one of those things that people won't be aware off, until they need it, then they'll be glad this example exists

I'm a big fan of PureBasic as well, I like how it's straightforward and quick to make something, but it can do a lot of clever background stuff if it needs to. I use it at work for all sorts of bespoke apps, everything from backups to database management to anti-malware. It's the most diverse and useful implementation of Basic I've ever used, makes VB look like VD .

I got a fever, and the only prescription, is more memes.
Cliff Mellangard 3DEGS
Developer
14
Years of Service
User Offline
Joined: 20th Feb 2006
Location: Sweden
Posted: 18th Jul 2013 14:28
be sure to pu this in the agk code base.
Its at the same Place as dark basic codebase at the main page simply select agk as language instead

Android 2.3 , ZTE Skate , 480x800 , 800 mhz , Samsung Galaxy Y , 240x320 , 832 mhz , Sony ericson arc 480x854 , 1 ghz
Android 4.0 , Dmtech 3g 9738B , 1024x768 , 9.7 inches , 1.2 ghz
Ancient Lady
Valued Member
16
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 18th Jul 2013 16:46
Chrisu, I initially thought I had to stick with Tier 1 for maximum cross platform compatibility. And then was set straight by others in the forum.

Now, I work in Tier 2 (C++) and use exactly the same files for all platform builds. With the use of "#ifdef", I can handle the 20 lines (including the #ifdef/#endif) in 40+ files needed to add the few bits that are AppGameKit platform dependent.

Strangely, of all the languages I've learned over the years, Basic was far from the first I learned. And it was Basic for Atari that I started with. By the time I got around to it, I was well conditioned in other ways of thinking. But Basic is a totally credible and usable language. It's flexibility depends on the actual platform (VB went a whole different way than Atari, for instance) and the creativity of the programmer. I can understand why some people prefer it.

And, with AppGameKit, it certainly is easier to get a quick prototype of something and then fill it out to a complete and complex program.

Your creation of this linked list class (which it basically is), is a great example of the creativity of a programmer.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
chrisu
10
Years of Service
User Offline
Joined: 31st Aug 2009
Location: Austria
Posted: 19th Jul 2013 11:02
@Ancient Lady: Hm, I will definitely take a look at tier 2 somewhen but for now I think I'll stick with tier 1, especially is it does have the things now I've been missing.

@Cliff Mellangard 3DEGS: Thx for the pointer, didn't know that there's something like that.

@Van B: Thx m8, exactly my opinion.
LittlePIC
8
Years of Service
User Offline
Joined: 19th Oct 2011
Location:
Posted: 19th Jul 2013 14:31
Not sure how you think this is a "little" contribution?

Really great work and glad to read your code!
Ancient Lady
Valued Member
16
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 19th Jul 2013 17:12
Quote: "Really great work and glad to read your code!"

I echo this sentiment.

The code was presented very well and I only found one copy/paste/forgot to change comment oops. And that is pretty good given the amount of the code. (Yes, somewhat picky and yes, I am very detail focused when I've had enough sleep.)

It's a shame that pass-by-reference isn't available in AppGameKit Basic. Then there would have been a lot of places that you would have been able to consolidate some stuff. (One of the things I really do like about C++.)

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master

Login to post a reply

Server time is: 2020-03-28 07:42:46
Your offset time is: 2020-03-28 07:42:46