comparison after5.rb @ 61:502103680ea2 draft

Call srand() without parameter.
author HIROSE Yuuji <yuuji@gentei.org>
date Mon, 25 Jun 2012 12:36:26 +0900
parents 592d958cab58
children 2d33f85c3d9f
comparison
equal deleted inserted replaced
60:592d958cab58 61:502103680ea2
2 # -*- coding: euc-jp -*- 2 # -*- coding: euc-jp -*-
3 # 3 #
4 # Associative Scheduling Table - after5 4 # Associative Scheduling Table - after5
5 # (C)2003, 2004, 2006, 2008, 2012 by HIROSE Yuuji [yuuji<at>gentei.org] 5 # (C)2003, 2004, 2006, 2008, 2012 by HIROSE Yuuji [yuuji<at>gentei.org]
6 # $Id: after5.rb,v 1.19 2012/04/01 11:52:25 yuuji Exp yuuji $ 6 # $Id: after5.rb,v 1.19 2012/04/01 11:52:25 yuuji Exp yuuji $
7 # Last modified Mon Jun 25 12:33:50 2012 on firestorm 7 # Last modified Mon Jun 25 12:35:46 2012 on firestorm
8 # See http://www.gentei.org/~yuuji/software/after5/ 8 # See http://www.gentei.org/~yuuji/software/after5/
9 # このスクリプトはEUCで保存してください。 9 # このスクリプトはEUCで保存してください。
10 $hgid = <<_HGID_.split[1..-2].join(" ") 10 $hgid = <<_HGID_.split[1..-2].join(" ")
11 $HGid$ 11 $HGid$
12 _HGID_ 12 _HGID_
243 end 243 end
244 def close() 244 def close()
245 @pdb.close() 245 @pdb.close()
246 end 246 end
247 def newpasswd(length) 247 def newpasswd(length)
248 srand(Time.now.to_f) 248 srand()
249 left = "qazxswedcvfrtgb12345" 249 left = "qazxswedcvfrtgb12345"
250 right = "yhnmjuik.lop;/67890-" 250 right = "yhnmjuik.lop;/67890-"
251 array = [left, right] 251 array = [left, right]
252 (1..length).collect{|i| 252 (1..length).collect{|i|
253 a = array[i%array.length] 253 a = array[i%array.length]

yatex.org