Created
May 17, 2015 15:47
-
-
Save 1lann/3ce4f2d771d15bfbdafa to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, "\", \"")) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
For what this is needed?