Exactly three adjacent 3 in lists: Difference between revisions

m (→‎{{header|Raku}}: white space)
Line 120:
 
=={{header|Ring}}==
 
{{incorrect|Ring|Will incorrectly pass if there are ''more'' than 3 3s in the list and any three happen to be consecutive. Test with [3,3,3,1,2,4,5,1,3]}}
<lang ring>
see "working..." + nl
Line 129:
list[3] = [1,4,3,6,7,3,8,3,2]
list[4] = [1,2,3,4,5,6,7,8,9]
list[5] = [43,63,83,71,2,34,3,35,1,3]
 
for n = 1 to 5
strn = list2str(list[n])
cnt = count(strn,"3")
if cnt => 32
for m = 1 to len(list[n])-32
if list[n][m] = 3 and list[n][m+1] = 3 and list[n][m+2] = 3 and list[n][m+3] != 3
flag = 1
exit
2,468

edits