advise.m
来自「vigenere密码解密的matlab实现」· M 代码 · 共 17 行
M
17 行
function aceind=advise(shufvals,p)% This function advises the player as to which card is the ace% It uses the fact that we chose a prime p such that the numerical % value of ace is a quadratic non-residue, while the numerical values% of the other cards are quadratic residuessln=length(shufvals);for j=1:sln, test(j)=powermod(shufvals(j),(p-1)/2,p);end;aceind=find(test~=1);disp(['Ace Index: ', num2str(aceind)]);
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?