📄 shuffle.m
字号:
function shval = shuffle(cvals,k,p)% This function hides and shuffles the cards whose values are passed% in the vector cvals. The hiding operation takes place by taking % cvals and raising its elements to the kth power mod p% Shuffling is a random permutationcln=length(cvals);hvals=zeros(cln,1);for j=1:cln, hvals(j)=powermod(cvals(j),k,p);end;% now to shuffle the cardsind=randperm(cln);shval=hvals(ind);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -