view bin/rng @ 8626:0969182692d6

<shachaf> mkx bin/doag//hg log --removed --template "{date|shortdate} {desc}\\n" -- "$@"
author HackBot
date Mon, 27 Jun 2016 23:59:51 +0000
parents c096bb536bb2
children
line wrap: on
line source

#!/usr/bin/env lua

math.randomseed(os.time())
W={}
for i,a in ipairs(arg) do
   for w in a:gmatch("[^%s]+") do
      table.insert(W, w)
   end
end
if #W>0 then
   print(W[math.random(#W)])
end