Mode:
Duration:
1
2
3
4
5
6
7
8
rollDice = ->
result = math.random 1, 6
print "Rolled: #{result}"
# Simulate actions
rollDice!
rollDice!
rollDice!Coding works best on desktop or with an external keyboard.
rollDice = ->
result = math.random 1, 6
print "Rolled: #{result}"
# Simulate actions
rollDice!
rollDice!
rollDice!Coding works best on desktop or with an external keyboard.
Rolls a dice and prints the result.
rollDice = ->
result = math.random 1, 6
print "Rolled: #{result}"
# Simulate actions
rollDice!
rollDice!
rollDice!MoonScript is a high-level, dynamic programming language that compiles to Lua. It provides syntactic sugar, cleaner syntax, and modern language features like classes, comprehensions, and pattern matching, while maintaining full compatibility with Lua runtime.
Origin & Creator
Created by Leaf Corcoran in 2012 as a way to make Lua programming more ergonomic and expressive.
Industrial Note
MoonScript is used in gaming, embedded scripting, and applications where Lua is standard but developers want a more modern syntax and workflow.