Quick actions

cmd+k|ctrl+k

Navigation

Languages

chance v2

Snippet info

Language

Lua

Visibility

public

Author

eleatra

Created

2021-11-29T11:23:53.579564Z

Updated

2021-11-30T09:22:52.717662Z

local chance=50
local times=500

math.randomseed(os.time())local f=0;local k=0;for j=0,times-1 do;f=f+1;local t=math.random(1,chance)local b=1/chance*100;if t==1 then;k=k+1;print("("..f..") "..t.."<---------- (1/"..chance..","..b.."%)")else;print("("..f..") "..t);end;end;print("("..k..")")
INFO