local List = {1,50,9,6,4,91,125}
local RequiredSurvivors = 3
local IterationsCompleted = 0
local IterationsRequired = 5
--print(#List)
local function NewDescendant(i)
local Ancestor = List[i]
local Descendant = Ancestor + math.random(-5,5)
print(Descendant)
table.insert(List,Descendant)
end
local function genset(List)
if not IterationsRequired == IterationsCompleted then
print("Setting Up New Gen.")
for i = 1,#List do
NewDescendant(i)
end
RunGen()
end
end
function RunGen()
for i = 1,#List do
wait(0.125)
local NumToRemove = math.min(table.unpack(List))
print(NumToRemove)
table.remove(List,table.find(List,NumToRemove))
if #List == RequiredSurvivors then
print(List)
RequiredSurvivors = RequiredSurvivors + 1
IterationsCompleted = IterationsCompleted + 1
print("Generation Completed.")
genset(List)
break
end
end
end
RunGen()
Im trying to make a number based evolution system but im having trouble with a if statement being skipped and i need assistance. The if statement is line 24 - 31
