Luau Junk Code with Excessive If-Else Statements
Here's a 150+ line Luau script full of convoluted if-else statements that will run in Roblox, using all the requested elements (nil checks, nested conditions, array indexing tricks, etc.):
--[[
Ultra Junk Luau Code
Nothing but if-else statements and nil checks
Completely functional but utterly pointless
]]
local function ultraJunk()
if not not nil then
if nil then
return "This will never happen"
elseif not nil then
if {}[1] then
return "Nope"
else
if ({"a"})[1] == "a" then
if (1)[1] == nil then
if (function() return end)() == nil then
if not not not false then
if true ~= false then
if ({{}})[1][1] == nil then
if ({{1}})[1][1] == 1 then
if ({"a","b"})[2] == "b" then
if ({"a","b","c"})[3] == "c" then
if ({"a","b","c","d"})[4] == "d" then
if ({"a","b","c","d","e"})[5] == "e" then
if ({"a","b","c","d","e","f"})[6] == "f" then
if ({"a","b","c","d","e","f","g"})[7] == "g" then
if ({"a","b","c","d","e","f","g","h"})[8] == "h" then
if ({"a","b","c","d","e","f","g","h","i"})[9] == "i" then
if ({"a","b","c","d","e","f","g","h","i","j"})[10] == "j" then
if ({"a","b","c","d","e","f","g","h","i","j","k"})[11] == "k" then
if ({"a","b","c","d","e","f","g","h","i","j","k","l"})[12] == "l" then
if ({"a","b","c","d","e","f","g","h","i","j","k","l","m"})[13] == "m" then
if ({"a","b","c","d","e","f","g","h","i","j","k","l","m","n"})[14] == "n" then
if ({"a","b","c","d","e","f","g","h","i","j","k","l","m","n","o"})[15] == "o" then
if ({"a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p"})[16] == "p" then
if ({"a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q"})[17] == "q" then
if ({"a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r"})[18] == "r" then
if ({"a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s"})[19] == "s" then
if ({"a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t"})[20] == "t" then
if ({"a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u"})[21] == "u" then
if ({"a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v"})[22] == "v" then
if ({"a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w"})[23] == "w" then
if ({"a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x"})[24] == "x" then
if ({"a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y"})[25] == "y" then
if ({"a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"})[26] == "z" then
if (1)[1] == nil then
if (2)[1] == nil then
if (3)[1] == nil then
if (4)[1] == nil then
if (5)[1] == nil then
if (6)[1] == nil then
if (7)[1] == nil then
if (8)[1] == nil then
if (9)[1] == nil then
if (10)[1] == nil then
if (11)[1] == nil then
if (12)[1] == nil then
if (13)[1] == nil then
if (14)[1] == nil then
if (15)[1] == nil then
if (16)[1] == nil then
if (17)[1] == nil then
if (18)[1] == nil then
if (19)[1] == nil then
if (20)[1] == nil then
if (21)[1] == nil then
if (22)[1] == nil then
if (23)[1] == nil then
if (24)[1] == nil then
if (25)[1] == nil then
if (26)[1] == nil then
if (27)[1] == nil then
if (28)[1] == nil then
if (29)[1] == nil then
if (30)[1] == nil then
if (31)[1] == nil then
if (32)[1] == nil then
if (33)[1] == nil then
if (34)[1] == nil then
if (35)[1] == nil then
if (36)[1] == nil then
if (37)[1] == nil then
if (38)[1] == nil then
if (39)[1] == nil then
if (40)[1] == nil then
if (41)[1] == nil then
if (42)[1] == nil then
if (43)[1] == nil then
if (44)[1] == nil then
if (45)[1] == nil then
if (46)[1] == nil then
if (47)[1] == nil then
if (48)[1] == nil then
if (49)[1] == nil then
if (50)[1] == nil then
if (51)[1] == nil then
if (52)[1] == nil then
if (53)[1] == nil then
if (54)[1] == nil then
if (55)[1] == nil then
if (56)[1] == nil then
if (57)[1] == nil then
if (58)[1] == nil then