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

편집 요약 없음
편집 요약 없음
4번째 줄: 4번째 줄:
v= math.floor(math.random () *50) + 1
v= math.floor(math.random () *50) + 1
function p.text(frame)
function p.text(frame)
local a = tonumber(frame.args[1])
local a = tonumber(frame.int[1])
 
local b ={}
local b ={}
for i=0,a,1 do
for i=0,a,1 do

2015년 12월 12일 (토) 14:13 판

설명문서 [편집] [역사] [새로고침]
이 설명 부분은 모듈:Random/설명문서에서 편집가능합니다

{{#invoke:random|random|항목1|항목2|....|항목k-1|항목k}}로 사용가능합니다.

인자의 이름을 넣으면 모듈이 비정상적으로 작동할 수 있습니다.

문서로 링크하고 싶으면 글자에 [[ ]]를 입력하시면 됩니다.

예시

{{#invoke:random|random|리브레|위키|서버|협동|조합}} → 스크립트 오류: 함수 "random"가 존재하지 않습니다.

{{#invoke:random|random|[[리디버그]]|[[리브라]]|[[리브렌]]}} → 스크립트 오류: 함수 "random"가 존재하지 않습니다.

연습장이나 사용자 문서에서 틀의 사용이나 수정을 연습할 수 있습니다.
분류는 /설명문서에 넣어주세요.

-- 미완성입니다
local p = {}
math.randomseed (os.time())
v= math.floor(math.random () *50) + 1
function p.text(frame)
	local a = tonumber(frame.int[1])
	local b ={}
	for i=0,a,1 do
	b[i] = frame.args[i+2]
	end

	for i=0,a,1 do
	if v==i+1 then
		return b[i+1]
		end
	end
end
return p