Arcades

Module utils

Utilities functions.

A set of functions that are not tidly linked to the arcades logic and that can be freely used.

Info:

Public Methods

keyboard_arrow_up
  • cast ( v )

    Cast a value (if possible).

    If this value is a string it will try to cast it to a number, a boolean, or a table (casting its own values).

    Parameters:
    • v
      The value to cast
    Returns:
    • The casted value
    • string The type of the returned value
  • load_all ()

    Load all arcades packages and modules.

    Note:
    • Is it equivalent to require('arcades').load_all()?
  • load_table ( t )

    Load a string representation of a table.

    Parameters:
    • t
      Object to load
    Returns:
    • table A table from the given string
    Or
    • table t if it is a table
    Or
    • nil
  • pretty_repr ( ... )

    Build a prettyfied representation of anything

    Parameters:
    • ...
      Whatever you want
    Returns:
  • sample_in ( t )

    Randomly sample a value in a table.

    Parameters:
    • table t
      List to sample from.
    Returns:
    • An element of the table
    • number The index of the returned element