Advertisement
RokettoJanpu

Dice

May 22nd, 2019
173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. if(z==`help`){
  2. r;
  3. }else{
  4.     q=z.split(` `).filter(a=>/[0-9]+d[0-9]+/.test(a));
  5.     if(q[0]){
  6.         y=q.map(a=>a.split(`d`).map(b=>parseInt(b)));
  7.         n=[];
  8.         for(i=0;i<q.length;i++){
  9.             n[i]=[];
  10.             for(j=0;j<y[i][0];j++){
  11.                 n[i].push(Math.ceil(Math.random()*y[i][1]));
  12.             }
  13.         }
  14.         q.map((a,i)=>`🎲 ${a}: ${n[i].join(` `)} Total: ${n[i].reduce((b,c)=>b+c)}/${y[i][0]*y[i][1]}`).join(` `).slice(0,400);
  15.     }else{
  16.         `🎲 ${Math.ceil(Math.random()*100)}`;
  17.     }}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement