Updated Examples
This commit is contained in:
parent
72695036d9
commit
07342fdefb
2 changed files with 5 additions and 9 deletions
|
@ -7,10 +7,6 @@ def fac(x):
|
|||
counter = if counter == x then counter else counter + 1 fi
|
||||
endfor
|
||||
return f
|
||||
|
||||
def main(n, k):
|
||||
top = fac(n)
|
||||
bot1 = fac(k)
|
||||
sub = n - k
|
||||
bot2 = fac(sub)
|
||||
bot = bot1 * bot2
|
||||
return top / bot
|
||||
return fac(n)/(fac(k)*fac(n-k))
|
||||
|
|
|
@ -47,7 +47,7 @@ def main(a21,b11,b22,c11,c22,d21):
|
|||
|
||||
counter = 0 // globally counts duplicate entries in boxes, rows and columns
|
||||
|
||||
// check box correctnes
|
||||
// check box correctness
|
||||
|
||||
// no duplicates
|
||||
counter = counter + checkEquality(a11,a12,a21,a22)
|
||||
|
@ -55,14 +55,14 @@ counter = 0 // globally counts duplicate entries in boxes, rows and columns
|
|||
counter = counter + checkEquality(c11,c12,c21,c22)
|
||||
counter = counter + checkEquality(d11,d12,d21,d22)
|
||||
|
||||
// check row correctnes
|
||||
// check row correctness
|
||||
|
||||
counter = counter + checkEquality(a11,a12,b11,b12)
|
||||
counter = counter + checkEquality(a21,a22,b21,b22)
|
||||
counter = counter + checkEquality(c11,c21,d11,d12)
|
||||
counter = counter + checkEquality(c21,c22,d21,d22)
|
||||
|
||||
// check column correctnes
|
||||
// check column correctness
|
||||
|
||||
counter = counter + checkEquality(a11,a21,c11,c21)
|
||||
counter = counter + checkEquality(a12,a22,c12,c22)
|
||||
|
|
Loading…
Reference in a new issue