local A=script.Parent local Z=A.Parent local T=require(Z.t)local j=T.optional(T.integer)local o=T.tuple(T.table,j,j)local function W(A,Z,T)assert(o(A,Z,T))local j=#A Z=Z or 1 T=T or j if Z<1 then Z=j+Z end if T<1 then T=j+T end assert(Z>0 and Z<=j+1,string.format("\105\110\100\101\120 \037\100 \111\117\116 \111\102 \098\111\117\110\100\115 \111\102 \108\105\115\116 \111\102 \108\101\110\103\116\104 \037\100",Z,j))assert(T>0 and T<=j+1,string.format("\105\110\100\101\120 \037\100 \111\117\116 \111\102 \098\111\117\110\100\115 \111\102 \108\105\115\116 \111\102 \108\101\110\103\116\104 \037\100",T,j))assert(Z<=T,string.format("\115\116\097\114\116 \105\110\100\101\120 \037\100 \099\097\110\110\111\116 \098\101 \103\114\101\097\116\101\114 \116\104\097\110 \101\110\100 \105\110\100\101\120 \037\100",Z,T))local W={}local g=1 for Z=Z,T,1 do W[g]=A[Z]g=g+1 end return W end return W
local List = script.Parent

local Llama = List.Parent
local t = require(Llama.t)

local indexType = t.optional(t.integer)
local validate = t.tuple(t.table, indexType, indexType)

local function slice(list, from, to)
	assert(validate(list, from, to))
	
	local len = #list

	from = from or 1
	to = to or len

	if from < 1 then
		from = len + from
	end

	if to < 1 then
		to = len + to
	end

	assert(from > 0 and from <= len + 1, string.format("index %d out of bounds of list of length %d", from, len))
	assert(to > 0 and to <= len + 1, string.format("index %d out of bounds of list of length %d", to, len))
	assert(from <= to, string.format("start index %d cannot be greater than end index %d", from, to))

	local new = {}
	local index = 1

	for i = from, to do
		new[index] = list[i]
		index = index + 1
	end

	return new
end

return slice