Skip to main content
added 65 characters in body
Source Link
Renzeee
  • 744
  • 4
  • 14

Haskell, 116 112112 102 bytes

f x=let z=lengthx=div(length x in z>7&&z<10&&g)2==4&&g x>0&&h x
h=((==0).(`mod`11)).g
g=sum.zipWith(*)(-1:[2..]).map(read.(:[])).reverse

g counts the sum used in the eleven-proef of h, while f also checks for the correct length and that the eleven-proef is not 0. Especially the checks of f take a lot of bytes.

EDIT: saved 10 bytes thanks to Lynn and div rounding down.

Haskell, 116 112 bytes

f x=let z=length x in z>7&&z<10&&g x>0&&h x
h=((==0).(`mod`11)).g
g=sum.zipWith(*)(-1:[2..]).map(read.(:[])).reverse

g counts the sum used in the eleven-proef of h, while f also checks for the correct length and that the eleven-proef is not 0. Especially the checks of f take a lot of bytes.

Haskell, 116 112 102 bytes

f x=div(length x)2==4&&g x>0&&h x
h=((==0).(`mod`11)).g
g=sum.zipWith(*)(-1:[2..]).map(read.(:[])).reverse

g counts the sum used in the eleven-proef of h, while f also checks for the correct length and that the eleven-proef is not 0. Especially the checks of f take a lot of bytes.

EDIT: saved 10 bytes thanks to Lynn and div rounding down.

Source Link
Renzeee
  • 744
  • 4
  • 14

Haskell, 116 112 bytes

f x=let z=length x in z>7&&z<10&&g x>0&&h x
h=((==0).(`mod`11)).g
g=sum.zipWith(*)(-1:[2..]).map(read.(:[])).reverse

g counts the sum used in the eleven-proef of h, while f also checks for the correct length and that the eleven-proef is not 0. Especially the checks of f take a lot of bytes.