[Top Page][All Pages][Recent Changes]

Edit History:Diff

Changes of ランダムな文字列を出力するモジュール since Epoch

  • + added lines
  • - deleted lines

Return to the edit history

+ * ランダムな文字列を出力するモジュール
+ {{{
+ #module
+ #defcfunc rndstr int p0,int p1,int p2,int p3,int p4//p1文字数 p2大文字あり p3小文字あり p4数字あり p5アンダーバーあり
+ 	sdim irand,p0
+ 	sdim keta,p0
+ 	randomize
+ 	keta=p0
+ 	ch(0)=p1
+ 	ch(1)=p2
+ 	ch(2)=p3
+ 	ch(3)=p4
+ 
+ 	sdim irand,256
+ 	bb=0
+ 	repeat 4
+ 		if ch(cnt)=1{
+ 			ifm(bb)=cnt
+ 			bb+
+ 		}
+ 	loop
+ 	if bb=0:stop
+ 
+ 
+ 	repeat int(keta)
+ 
+ 		switch ifm(rnd(bb))
+ 			case 0
+ 				moji=""
+ 				poke moji,0,int($+rnd(26)+$41)
+ 			swbreak
+ 			case 1
+ 				moji=""
+ 				poke moji,0,int($+rnd(26)+$61)
+ 			swbreak
+ 			case 2
+ 				moji=str(rnd(10))
+ 			swbreak
+ 			case 3
+ 				moji="_"
+ 			swbreak
+ 
+ 		swend
+ 		irand+=moji
+ 	loop
+ 	return irand
+ #global
+ }}}