Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Blog
Creating habits v2, Lua (WIP)
--[[ Creating habits v2, Lua This program will attempt to list letters in alphebetical order (Practicing commenting & consistentcy) ]]-- local letters = "abcdefghijklmnopqrstuvwxyz" -- List of letters in alphebetic order -- local function mainFunc(input) local str = "" -- We will store the input letters in order using str -- for i = 1, #input do -- Goes through the input letters -- if string.sub(input, i, i) == string.find(letters, string.sub(input, i, i)) then str = str.. string.sub(input, i, i) end end print(str) -- Prints the end result -- end mainFunc("acdbA") -- Runs the function -- Letters inside is what the function tries to order --
run
|
edit
|
history
|
help
0
Please
log in
to post a comment.
CC: LDInterface
For your YouTube comment section. (updated)
Properties in Lua
Convert MySQL 'framed' table into CSV
quick sort
ok
Monty Hall Problem Simulated
ok
Lua Angle Cheatsheet
dd
Please log in to post a comment.