Jump to content

Run-length encoding: Difference between revisions

→‎{{header|J}}: simplify and speed up rle
(added PowerShell)
(→‎{{header|J}}: simplify and speed up rle)
Line 543:
NB. Run-length encode and decode...
rle=.: >@:(,&.>/)@[:( ; (":@:# , {.)&.>)@:((1 , 2}. ~:&>/\ ]}:) <;.1 ])
rle 'WWWWWWWWWWWWBWWWWWWWWWWWWBBBWWWWWWWWWWWWWWWWWWWWWWWWBWWWWWWWWWWWWWW'
12W1B12W3B24W1B14W
Line 551:
WWWWWWWWWWWWBWWWWWWWWWWWWBBBWWWWWWWWWWWWWWWWWWWWWWWWBWWWWWWWWWWWWWW
</lang>
 
=={{header|Java}}==
<lang java>import java.util.regex.Matcher;
892

edits

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