Exactly three adjacent 3 in lists: Difference between revisions

→‎{{header|Raku}}: Add a Raku example
mNo edit summary
(→‎{{header|Raku}}: Add a Raku example)
Line 60:
</lang>
 
 
=={{header|Raku}}==
<lang perl6>say $_, ' ', ( .Bag{3} == 3 ) && ( so .rotor(3=>-2).grep: *.all == 3 ) for
 
[9,3,3,3,2,1,7,8,5],
[5,2,9,3,3,7,8,4,1],
[1,4,3,6,7,3,8,3,2],
[1,2,3,4,5,6,7,8,9],
[4,6,8,7,2,3,3,3,1],
[3,3,3,1,2,4,5,6,3],
[0,3,3,3,3,7,5,2,6],
[3,3,3,3,3,3,3,3,3]</lang>
{{out}}
<pre>[9 3 3 3 2 1 7 8 5] True
[5 2 9 3 3 7 8 4 1] False
[1 4 3 6 7 3 8 3 2] False
[1 2 3 4 5 6 7 8 9] False
[4 6 8 7 2 3 3 3 1] True
[3 3 3 1 2 4 5 6 3] False
[0 3 3 3 3 7 5 2 6] False
[3 3 3 3 3 3 3 3 3] False</pre>
 
=={{header|Ring}}==
10,333

edits