Guest User

Untitled

a guest
May 27th, 2018
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. function controle(kaartnr)
  2. A::=[];
  3. for i=1 to 15 step 1 A:=A|mod(floor(kaartnr/10^(16-i)),10); end
  4. A:=A|mod(kaartnr,10);
  5. som::=0;
  6. n::=0;
  7. for i=1 to 15 step 2 som:=som+2*A[i]; if A[i] > 4 then n:=n+1; endif end
  8. for i=2 to 16 step 2 som:=som+A[i]; end
  9. if mod(som+n,10) == 0
  10. return "correct"
  11. else
  12. return "false"
  13. endif
  14. endfunction
Add Comment
Please, Sign In to add comment