Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function controle(kaartnr)
- A::=[];
- for i=1 to 15 step 1 A:=A|mod(floor(kaartnr/10^(16-i)),10); end
- A:=A|mod(kaartnr,10);
- som::=0;
- n::=0;
- for i=1 to 15 step 2 som:=som+2*A[i]; if A[i] > 4 then n:=n+1; endif end
- for i=2 to 16 step 2 som:=som+A[i]; end
- if mod(som+n,10) == 0
- return "correct"
- else
- return "false"
- endif
- endfunction
Add Comment
Please, Sign In to add comment