Jelly, (削除) 12 11 (削除ここまで) 8 bytes
-3 thanks to @KevinCruijssen (take the wordsearch as a mulitline list of characters).
=Ḣ\ƝŻḋẇ€
A dyadic Link that accepts the list of words on the left and the wordsearch (a multiline list of characters) on the right and yields a non-negative integer.
How?
=Ḣ\ƝŻḋẇ€ - Link: words W;W wordsearch(list linesof lists of characters); wordsearch P (list of characters)
Ɲ - for neighbouring words in W:
\ - last two links as a dyad - f(left, right):
= - left equals right (vectorises)
Ḣ - head
Ż - prepend a zero
-> E = a list of 1s and 0s identifying whether the previous
word stated with the same letter.
€ - for each Word in W:
ẇ - is Word a sublist of the space-joined wordsearchP?
-> F = a list of 1s and 0s identifying whether the current
word is in the wordsearch
ḋ - E dot-product F
Jelly, (削除) 12 11 (削除ここまで) 8 bytes
-3 thanks to @KevinCruijssen (take the wordsearch as a mulitline list of characters).
=Ḣ\ƝŻḋẇ€
A dyadic Link that accepts the list of words on the left and the wordsearch (a multiline list of characters) on the right and yields a non-negative integer.
How?
=Ḣ\ƝŻḋẇ€ - Link: words W; wordsearch lines P
Ɲ - for neighbouring words in W:
\ - last two links as a dyad - f(left, right):
= - left equals right (vectorises)
Ḣ - head
Ż - prepend a zero
-> E = a list of 1s and 0s identifying whether the previous
word stated with the same letter.
€ - for each Word in W:
ẇ - is Word a sublist of the space-joined wordsearch?
-> F = a list of 1s and 0s identifying whether the current
word is in the wordsearch
ḋ - E dot-product F
Jelly, (削除) 12 11 (削除ここまで) 8 bytes
-3 thanks to @KevinCruijssen (take the wordsearch as a mulitline list of characters).
=Ḣ\ƝŻḋẇ€
A dyadic Link that accepts the list of words on the left and the wordsearch (a multiline list of characters) on the right and yields a non-negative integer.
How?
=Ḣ\ƝŻḋẇ€ - Link: words W (list of lists of characters); wordsearch P (list of characters)
Ɲ - for neighbouring words in W:
\ - last two links as a dyad - f(left, right):
= - left equals right (vectorises)
Ḣ - head
Ż - prepend a zero
-> E = a list of 1s and 0s identifying whether the previous
word stated with the same letter.
€ - for each Word in W:
ẇ - is Word a sublist of P?
-> F = a list of 1s and 0s identifying whether the current
word is in the wordsearch
ḋ - E dot-product F
Jelly, (削除) 12 11 (削除ここまで) 118 bytes
-3 thanks to @KevinCruijssen (take the wordsearch as a mulitline list of characters).
=Ḣ\ƝŻḋẇ€K}\=Ḣ\ƝŻḋẇ€
A dyadic Link that accepts the list of words on the left and the wordsearch (a multiline list of linescharacters) on the right and yields a non-negative integer.
How?
=Ḣ\ƝŻḋẇ€K}\=Ḣ\ƝŻḋẇ€ - Link: words W; wordsearch lines P
Ɲ - for neighbouring words in W:
\ - last two links as a dyad - f(left, right):
= - left equals right (vectorises)
Ḣ - head
Ż - prepend a zero
-> E = a list of 1s and 0s identifying whether the previous
word stated with the same letter.
\ - last two links as a dyad - f(W, P):
} - treat a monad as a dyad using the right argument, P:
K - join P with space characters
€ - for each Word in W:
ẇ - is Word a sublist of the space-joined wordsearch?
-> F = a list of 1s and 0s identifying whether the current
word is in the wordsearch
ḋ - E dot-product F
Jelly, (削除) 12 (削除ここまで) 11 bytes
=Ḣ\ƝŻḋẇ€K}\
A dyadic Link that accepts the list of words on the left and the wordsearch (a list of lines) on the right and yields a non-negative integer.
How?
=Ḣ\ƝŻḋẇ€K}\ - Link: words W; wordsearch lines P
Ɲ - for neighbouring words in W:
\ - last two links as a dyad - f(left, right):
= - left equals right (vectorises)
Ḣ - head
Ż - prepend a zero
-> E = a list of 1s and 0s identifying whether the previous
word stated with the same letter.
\ - last two links as a dyad - f(W, P):
} - treat a monad as a dyad using the right argument, P:
K - join P with space characters
€ - for each Word in W:
ẇ - is Word a sublist of the space-joined wordsearch?
-> F = a list of 1s and 0s identifying whether the current
word is in the wordsearch
ḋ - E dot-product F
Jelly, (削除) 12 11 (削除ここまで) 8 bytes
-3 thanks to @KevinCruijssen (take the wordsearch as a mulitline list of characters).
=Ḣ\ƝŻḋẇ€
A dyadic Link that accepts the list of words on the left and the wordsearch (a multiline list of characters) on the right and yields a non-negative integer.
How?
=Ḣ\ƝŻḋẇ€ - Link: words W; wordsearch lines P
Ɲ - for neighbouring words in W:
\ - last two links as a dyad - f(left, right):
= - left equals right (vectorises)
Ḣ - head
Ż - prepend a zero
-> E = a list of 1s and 0s identifying whether the previous
word stated with the same letter.
€ - for each Word in W:
ẇ - is Word a sublist of the space-joined wordsearch?
-> F = a list of 1s and 0s identifying whether the current
word is in the wordsearch
ḋ - E dot-product F
Jelly, 12 (削除) 12 (削除ここまで) 11 bytes
=Ḣ\ƝŻaẇ€K=Ḣ\ƝŻḋẇ€K}\S\
A dyadic Link that accepts the list of words on the left and the wordsearch (a list of lines) on the right and yields a non-negative integer.
How?
=Ḣ\ƝŻaẇ€K=Ḣ\ƝŻḋẇ€K}\S\ - Link: words W; wordsearch lines P
Ɲ - for neighbouring words in W:
\ - last two links as a dyad - f(left, right):
= - left equals right (vectorises)
Ḣ - head
Ż - prepend a zero
-> E = a list of 1s and 0s identifying whether the previous
word stated with the same letter.
\ - last two links as a dyad - f(W, P):
} - treat a monad as a dyad using the right argument, P:
K - join P with space characters
€ - for each Word in W:
ẇ - is Word a sublist of the space-joined wordsearch?
-> F = a list of 1s and 0s identifying whether the current
word is in the wordsearch
a ḋ - E logical AND F (vectorises)
S dot-product sumF
Jelly, 12 bytes
=Ḣ\ƝŻaẇ€K}\S
A dyadic Link that accepts the list of words on the left and the wordsearch (a list of lines) on the right and yields a non-negative integer.
How?
=Ḣ\ƝŻaẇ€K}\S - Link: words W; wordsearch lines P
Ɲ - for neighbouring words in W:
\ - last two links as a dyad - f(left, right):
= - left equals right (vectorises)
Ḣ - head
Ż - prepend a zero
-> E = a list of 1s and 0s identifying whether the previous
word stated with the same letter.
\ - last two links as a dyad - f(W, P):
} - treat a monad as a dyad using the right argument, P:
K - join P with space characters
€ - for each Word in W:
ẇ - is Word a sublist of the space-joined wordsearch?
-> F = a list of 1s and 0s identifying whether the current
word is in the wordsearch
a - E logical AND F (vectorises)
S - sum
Jelly, (削除) 12 (削除ここまで) 11 bytes
=Ḣ\ƝŻḋẇ€K}\
A dyadic Link that accepts the list of words on the left and the wordsearch (a list of lines) on the right and yields a non-negative integer.
How?
=Ḣ\ƝŻḋẇ€K}\ - Link: words W; wordsearch lines P
Ɲ - for neighbouring words in W:
\ - last two links as a dyad - f(left, right):
= - left equals right (vectorises)
Ḣ - head
Ż - prepend a zero
-> E = a list of 1s and 0s identifying whether the previous
word stated with the same letter.
\ - last two links as a dyad - f(W, P):
} - treat a monad as a dyad using the right argument, P:
K - join P with space characters
€ - for each Word in W:
ẇ - is Word a sublist of the space-joined wordsearch?
-> F = a list of 1s and 0s identifying whether the current
word is in the wordsearch
ḋ - E dot-product F