local sentences = { "Welcome to Growtopia!", "Ready for some epic adventures?", "Collect gems to grow your world!", "Trading is the key to success!", "Explore new realms and meet fellow players!", "Remember, kindness goes a long way in Growtopia.", "Plant trees to create a lush environment.", "Be creative and build amazing worlds!", "Don't forget to recycle to help the environment.", "Watch out for scammers - stay safe!", "Join the Growtopia community for fun events!", "Level up and unlock new items.", "Build a majestic castle in the sky!", "Discover hidden secrets in ancient ruins.", "Trade wisely, don't get scammed!", "Check out the latest updates in the news!", "Team up with friends to tackle challenges.", "Master the art of parkour!", "Share your world with #GrowtopiaWorlds.", "Howl at the moon in a werewolf mask!", "Seek out the legendary Phoenix wings!", "Play fair and respect others' creations.", "Be a Growtopian hero!", "Watch out for falling anvils!", "Dance your heart out in the dance party world!", "Keep your wits about you in PvP worlds.", "Find rare items in hidden mystery chests.", "Want to make new friends? Join a guild!", "Dare to enter the Dragon's lair!", "Respect the moderators and follow the rules.", "Glorious wings await those who reach high levels.", "Decorate your world for seasonal events.", "Don't let greed get the better of you.", "Teamwork makes the dream work!", "Help newcomers and share your wisdom.", "Unleash your creativity with pixel art.", "Look out for carnival games in the park.", "Be patient and grow your world slowly.", "Celebrate Growtopia's anniversary with us!", "Craft legendary items with rare materials.", "Don't forget to /ignore spammers and bullies.", "Find the hidden portal to the mysterious world.", "Build a tribute to your favorite movie!", "Play fair, and everyone will have fun.", "Invest in farms to grow valuable crops.", "Dance like nobody's watching!", "Discover the wonders of the ancient temple.", "Buy low, sell high - the merchant's motto!", "Join a guild and conquer challenges together.", "Use locks to protect your prized possessions.", "Take a ride on the mystical flying carpet!", "Share your achievements with #GrowtopiaGoals.", "Be a legendary grower and inspire others.", "Seek out rare artifacts in the archaeology world.", "Respect each other's cultures and backgrounds.", "Race your friends in the race world!", "Take a break and enjoy the parkour worlds.", "Help others complete quests and earn rewards.", "Dress up in unique and stylish outfits.", "Avoid world locks scams - be cautious!", "Build a floating island in the sky.", "Pay attention to the weather and plant accordingly.", "Don't forget to water your trees!", "Explore the depths of the underwater world.", "Spread positivity and make friends.", "Create a tribute to your favorite musician!", "Jump into the portal and explore new worlds.", "Harvest your trees and reap the rewards!", "Discover the magic of the crystal caverns.", "Be kind to one another - we're all Growtopians!", "Work together to defeat world invaders.", "Grow your way to fame and fortune.", "Attend player-hosted events for fun times.", "Explore the Growtopia wiki for useful tips.", "Hang out with friends in your own world.", "Respect the trading values and market trends.", "Try your luck at the casino and grow rich!", "Fly high with the jetpack!", "Host a maze world for thrilling adventures.", "Visit the Growganoth during Halloween.", "Cheer on players in the Growlympics!", "Show off your prized possessions in showcases.", "Bring the stars to your world with star wallpaper.", "Discover the ancient secrets of the Forgotten world.", "Help new players find their way in Growtopia.", "Unleash your inner artist with graffiti!", "Play mini-games to win prizes.", "Give back to the community - host a giveaway!", "Adopt a pet and make it part of your world.", "Master the art of juggling in the circus world.", "Organize a fashion show and strut your stuff!", "Plant trees together to create a beautiful forest.", "Experiment with different world themes.", "Seek out the elusive legendary fish.", "Learn from experienced players - ask questions!", "Keep your world safe with security cameras.", "Trade fairly and build a reputable name.", "Decorate your world with magical rainbow blocks.", "Host a puzzle challenge for brain-teasing fun.", "And finally, always remember to have fun in Growtopia!", "Hello, world!", "Lua is awesome!", "Programming is fun!", "Have a great day!", "Stay curious!", "Keep learning!", "Lua is lightweight and efficient.", "Coding is an art form.", "The future is written in code.", "Programming opens new possibilities.", "Automation simplifies tasks.", "Explore the world of algorithms.", "Practice makes perfect.", "Computers are powerful tools.", "Creativity drives innovation.", "Debugging can be challenging.", "Solve problems with code.", "Imagination knows no bounds.", "Technology shapes our lives.", "Virtual reality is fascinating.", "The internet connects everyone.", "Learn from your mistakes.", "Software powers modern life.", "Data is the new gold.", "Artificial intelligence is rising.", "Build, break, repeat.", "Code is poetry.", "Embrace the digital age.", "Collaboration enhances productivity.", "The quest for better algorithms.", "Keep your code DRY (Don't Repeat Yourself).", "Problem-solving is a mindset.", "Optimize for efficiency.", "Continuous learning is essential.", "Algorithms make the world go 'round.", "Simplicity is elegance.", "Coding empowers dreams.", "Curiosity fuels discovery.", "Inspiration drives innovation.", "Computers follow instructions blindly.", "Embrace the open-source community.", "Experiment and iterate.", "Patience is key to debugging.", "Software development is an adventure.", "Believe in the power of code.", "Dream big, code bigger.", "The joy of creating something new.", "Code with passion.", "Leave no bug behind.", "Debugging is an art.", "Technology never stands still.", "Every bug is an opportunity to learn." } for i = 1,10 do print(sentences[math.random(1,#sentences)]) end
Write, Run & Share Lua code online using OneCompiler's Lua online compiler for free. It's one of the robust, feature-rich online compilers for Lua language, running the latest Lua version 5.4. Getting started with the OneCompiler's Lua editor is easy and fast. The editor shows sample boilerplate code when you choose language as Lua and start coding.
OneCompiler's Lua online editor supports stdin and users can give inputs to programs using the STDIN textbox under the I/O tab. Following is a sample Lua program which takes name as input and prints hello message with your name.
name = io.read("*a")
print ("Hello ", name)
Lua is a light weight embeddable scripting language which is built on top of C. It is used in almost all kind of applications like games, web applications, mobile applications, image processing etc. It's a very powerful, fast, easy to learn, open-source scripting language.
-- global variables
a = 10
-- local variables
local x = 30
Value Type | Description |
---|---|
number | Represents numbers |
string | Represents text |
nil | Differentiates values whether it has data or not |
boolean | Value can be either true or false |
function | Represents a sub-routine |
userdata | Represents arbitary C data |
thread | Represents independent threads of execution. |
table | Can hold any value except nil |
While is also used to iterate a set of statements based on a condition. Usually while is preferred when number of iterations are not known in advance.
while(condition)
do
--code
end
Repeat-Until is also used to iterate a set of statements based on a condition. It is very similar to Do-While, it is mostly used when you need to execute the statements atleast once.
repeat
--code
until( condition )
For loop is used to iterate a set of statements based on a condition.
for init,max/min value, increment
do
--code
end
Function is a sub-routine which contains set of statements. Usually functions are written when multiple calls are required to same set of statements which increase re-usuability and modularity.
optional_function_scope function function_name( argument1, argument2, argument3........, argumentn)
--code
return params with comma seperated
end