Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
16
Task/Queue-Usage/Lua/queue-usage-2.lua
Normal file
16
Task/Queue-Usage/Lua/queue-usage-2.lua
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
> -- create queue:
|
||||
> q = {}
|
||||
> -- push:
|
||||
> q[#q+1] = "first"
|
||||
> q[#q+1] = "second"
|
||||
> q[#q+1] = "third"
|
||||
> -- pop:
|
||||
> =table.remove(q, 1)
|
||||
first
|
||||
> =table.remove(q, 1)
|
||||
second
|
||||
> =table.remove(q, 1)
|
||||
third
|
||||
> -- empty?
|
||||
> =#q == 0
|
||||
true
|
||||
Loading…
Add table
Add a link
Reference in a new issue