do
	local a = string.reverse(os.time())
	print(a)
	math.randomseed(a)
	-- math.randomseed(os.time())
	for i=1,30 do
		local b = math.random(1,100)
	  	print(b)
	end
end


lua取随机数,如果randomseed()函数设置的种子一样的,随机出来的也是一样的。网上答案说种子比较大,但是实际测试了一下,也是一样的,难道是我写错了吗?

相关文章:

  • 2021-10-05
  • 2022-02-28
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-12-05
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2019-03-18
相关资源
相似解决方案