Post Reply 
Dice roll results
05-25-2020, 06:28 PM
Post: #5
RE: Dice roll results
Thanks very very much to all.
Beautiful, simple, just much better than what I have finally done with a big mess:

EXPORT RollDi(toss,dice)
BEGIN

LOCAL v,v1,j,k,d,f;
LOCAL t,p,p1,r,r1,l;
d:=dice;
v:=MAKEMAT(J+K,1,d);
v1:=MAKEMAT(0,1,d);
t:=toss;
f:=d^t;
r:=MAKEMAT(0,t,f);
r1:=MAKEMAT(0,1,f);
p:=1;

FOR k FROM 1 TO t DO //loop de t columnas

WHILE p<f DO //rellena cada columna

FOR j FROM 1 TO d DO

MAKEMAT(v[1,j],1,d^(k-1))▶v1;
l:=length(transpose(v1));
CAS.REPLACE(r1,p,v1);
p:=p+l

END;

END;

p:=1;
CAS.REPLACE(r,{t+1-k,1},r1);
r1:=MAKEMAT(0,1,f);

END;

RETURN transpose(r);

END;

It works, at least for low numbers.

Just for future nights with no sleeping, could you tell me how to jump from one point to another while debugging a program? Just to do a complete "loop" for example.


Bye
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Dice roll results - Tonig00 - 05-24-2020, 04:05 PM
RE: Dice roll results - victorvbc - 05-24-2020, 06:02 PM
RE: Dice roll results - ijabbott - 05-24-2020, 09:15 PM
RE: Dice roll results - Carlos295pz - 05-24-2020, 11:28 PM
RE: Dice roll results - Tonig00 - 05-25-2020 06:28 PM
RE: Dice roll results - pinkman - 05-25-2020, 10:04 PM
RE: Dice roll results - pinkman - 05-25-2020, 10:08 PM
RE: Dice roll results - Tonig00 - 05-26-2020, 11:05 PM
RE: Dice roll results - lmmt61 - 05-28-2020, 07:03 AM
RE: Dice roll results - Tonig00 - 05-30-2020, 03:31 PM



User(s) browsing this thread: 1 Guest(s)