모듈:Iloop: 두 판 사이의 차이

리버티게임, 모두가 만들어가는 자유로운 게임
백괴게임>Gustmd7410
잔글편집 요약 없음
편집 요약 없음
 
(사용자 2명의 중간 판 37개는 보이지 않습니다)
1번째 줄: 1번째 줄:
return {
return {
loop = function(frame)
loop = function(frame)
local text = frame.args[1]
local text = ''
local finish = tonumber(frame.args[2])
local finish = tonumber(frame.args[2])
local times = tonumber(frame.args[3]) or 1
local times = tonumber(frame.args[3]) or 1
local from = tonumber(frame.args[4]) or 1
local from = tonumber(frame.args[4]) or 1
local var = frame.args.index or 'index'
local func = require('모듈:TemplateFunction').create(frame.args[1])
local value = ''
for index = from, finish, times do
for index = from, finish, times do
value = value + text.gsub('{{\|index\|}}', index)
text = text .. func:parse{[var] = index}
end
end
return value
return text
end
end
}
}

2023년 11월 25일 (토) 19:49 기준 최신판


모듈 설명문서[보기] [편집] [역사] [새로 고침]
이 부분의 본문은 틀:loop입니다.


return {
	loop = function(frame)
		local text = ''
		local finish = tonumber(frame.args[2])
		local times = tonumber(frame.args[3]) or 1
		local from = tonumber(frame.args[4]) or 1
		local var = frame.args.index or 'index'
		local func = require('모듈:TemplateFunction').create(frame.args[1])
		
		for index = from, finish, times do
			text = text .. func:parse{[var] = index}
		end
		
		return text
	end
}