Skip to content

Instantly share code, notes, and snippets.

@1lann
Created May 17, 2015 15:47
Show Gist options
  • Save 1lann/3ce4f2d771d15bfbdafa to your computer and use it in GitHub Desktop.
Save 1lann/3ce4f2d771d15bfbdafa to your computer and use it in GitHub Desktop.
local vertexStart = {"RRLR", "RR", "", "L", "LRL", "LRLRL"}
local vertexRows = {6, 8, 11, 10, 8, 6}
local allVerticies = {}
for start = 1, #vertexStart do
local startTurn = "L"
if start == 3 then
startTurn = "S"
elseif start > 2 then
startTurn = "R"
end
local startStr = vertexStart[start]
table.insert(allVerticies, startStr)
if startTurn ~= "S" then
startStr = startStr .. startTurn
table.insert(allVerticies, startStr)
startStr = startStr .. startTurn
table.insert(allVerticies, startStr)
else
startStr = startStr .. "R"
table.insert(allVerticies, startStr)
end
for r = 1, (vertexRows[start] - 2) do
if startStr:sub(-1, -1) == "L" then
startStr = startStr .. "R"
table.insert(allVerticies, startStr)
else
startStr = startStr .. "L"
table.insert(allVerticies, startStr)
end
end
end
print(table.concat(allVerticies, "\", \""))
@AMD-NICK
Copy link

For what this is needed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment