Jump to content

Wordle comparison: Difference between revisions

J
(→‎{{header|Raku}}: Changed smart match to string equality; Split `and` where left-side always true.)
(J)
Line 145:
ROBIN v ROBIN => [2 2 2 2 2] => [green green green green green]
</pre>
 
=={{header|J}}==
 
Implementation (brute force):
 
<lang J>wrdcmp=: {{
yw=.gr=. I.x=y
key=. '#' gr} x
for_ch.y do.
if.ch e. key do.
key=. '#' (key i.ch)} key
yw=. yw, ch_index
end.
end.
2 gr} 1 yw} (#y)#0
}}</lang>
 
Task example:
 
<lang J> 'allow' wrdcmp 'lolly'
1 1 2 0 0</lang>
 
=={{header|Julia}}==
6,962

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.