local function P(P,G,w)local U={}local z=#P assert(G<=z,"\105\110\100\101\120 \109\117\115\116 \098\101 \108\101\115\115 \111\114 \101\113\117\097\108 \116\104\097\110 \116\104\101 \108\105\115\116 \108\101\110\103\116\104")for z=1,z,1 do if z==G then U[z]=w else U[z]=P[z]end end return U end return P


local function replaceIndex(list, index, value)
	local new = {}
	local len = #list

	assert(index <= len, "index must be less or equal than the list length")

	for i = 1, len do
		if i == index then
			new[i] = value
		else
			new[i] = list[i]
		end
	end

	return new
end

return replaceIndex
