[PLUGIN] LIFO Stack

Post your completed addons to share with the community

Post » Tue Dec 20, 2011 9:14 pm

EDIT May 8 2012: this plugin is obsolete, the functionality has been added to the official ARRAY plugin.
---------------------------------------------

This is a simple plugin implementing a Last In First Out (LIFO) stack. Works with numbers.

It has all basic stack operations: Push, Pop, Peek, IsEmpty.

I needed it for a logical puzzle (Towers of Hanoi) and couldn't find one, so I implemented one. Took the array and modified it here and there.

http://www.mediafire.com/?zf9bqcfnrg9bimg

Feel free to further improve it!

Cheers!

GeoGeo2012-05-08 08:24:56
B
14
S
5
G
7
Posts: 235
Reputation: 5,175

Post » Tue Dec 20, 2011 10:06 pm

Could you make an example on how to use it?
B
29
S
12
G
7
Posts: 740
Reputation: 7,849

Post » Mon Dec 26, 2011 1:14 pm

Sorry I took so long. Here's a small demo. HTH. Geo.

http://www.mediafire.com/?7mt9l6jzuyj063m
B
14
S
5
G
7
Posts: 235
Reputation: 5,175

Post » Mon Dec 26, 2011 1:23 pm

Where i can use this plugin?

B
94
S
19
G
34
Posts: 1,840
Reputation: 27,988

Post » Sat Dec 31, 2011 8:14 am

You can use this plugin wherever you have game logic that requires the use of a LAST IN FIRST OUT data structure (aka Stack). For example, the Towers of Hanoi.

You add data (numbers) to it, and the data goes to the "top" of the stack. You can only access the top of the stack, not the numbers below. More info: LIFO (Wikipedia)
B
14
S
5
G
7
Posts: 235
Reputation: 5,175

Post » Sun Jan 01, 2012 10:28 am

Perfect! I was about to implement a LIFO stack myself when I saw this in Kyatric's What You May Have Missed Thread . Now all I need do is add RandomArray's scramble feature to it and I have just what I need
B
27
S
5
G
5
Posts: 24
Reputation: 4,553

Post » Mon Jan 02, 2012 10:28 am

Thanks Glad you find it useful.
B
14
S
5
G
7
Posts: 235
Reputation: 5,175

Post » Mon May 07, 2012 7:01 pm

Hey Geo

The link for the example is down. Could you reopload it?
Also, when you already have made a stack, what about expanding to also include a queue?

Regards Traeve
B
5
Posts: 15
Reputation: 957

Post » Tue May 08, 2012 8:22 am

Hi @Traeve,

Actually the LIFO functionality is now part of the official ARRAY plugin.

See this manual entry, look at push/pop front/back, is empty etc.

This plugin is now obsolete. @Kyatric please remove it from the sticky plugin list, @septeven sorry for not getting back about this for so long, please don't track it with your repository app.

Cheers!
B
14
S
5
G
7
Posts: 235
Reputation: 5,175

Post » Tue May 08, 2012 9:01 am

Hi Geo

Had not seen that, thanks.

Cheers!
B
5
Posts: 15
Reputation: 957

Next

Return to Completed Addons

Who is online

Users browsing this forum: No registered users and 3 guests