Giter Club home page Giter Club logo

deeper's Introduction

██████╗ ███████╗███████╗██████╗ ███████╗██████╗
██╔══██╗██╔════╝██╔════╝██╔══██╗██╔════╝██╔══██╗
██║  ██║█████╗  █████╗  ██████╔╝█████╗  ██████╔╝
██║  ██║██╔══╝  ██╔══╝  ██╔═══╝ ██╔══╝  ██║██╚╗
██████╔╝███████╗███████╗██║     ███████╗██║╗██║
╚═════╝ ╚══════╝╚══════╝╚═╝     ╚══════╝╚═╝ ╚═╝

deeper is a modification of deep that allows for multiple queues.

Usage

Place deeper.lua inside your project and require it:

deeper = require "deeper"

Making a new queue

newqueue = deeper.init()

Queue actions

newqueue.queue(3, print, "wound!")
newqueue.queue(1, print, "It's just")
newqueue.queue(2, print, "a flesh")

Execute

newqueue.execute()

Prints:

It's just
a flesh
wound!

Documentation

deeper.init()

Returns a queue.

newqueue = deeper.init()

[queue].queue(i, fun, ...)

Queues a function for execution at index i

[queue].queue(100, print, "Hello")
-- or
[queue].queue(100, function() print("Hello") end)

Arguments:

  • i (number) - The index of the action. Can be negative or positive.
  • fun (function) - An anonymous or named function
  • ... (*) - The arguments of the passed named function

Usage:

  • With anonymous functions:

     [queue].queue(30, function() hit(iron, 100) end)
  • With named functions:

     [queue].queue(30, hit, iron, 100)
  • With multiple functions:

     [queue].queue(30, function()
       hit(iron, 100)
       strike(steel, 200)
     end)

[queue].execute()

Executes all of the queued actions

-- Will execute the actions in random order
[queue].queue(math.random(10), print, "'Tis")
[queue].queue(math.random(10), print, "but")
[queue].queue(math.random(10), print, "a")
[queue].queue(math.random(10), print, "scratch!")

[queue].execute()

Examples

Deeper can do anything that deep can do, so please view the page for deep for examples.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.