Skip to main content
And the glob unlocks combining into one action statement
Source Link
Ton Hospel
  • 14.9k
  • 1
  • 22
  • 45

Perl 5, 83 82 7979 77 bytes

Includes +3 for -F

Give instructions as one line on STDIN

#!/usr/bin/perl -F
1~~@$m&&say$m until++$m>map{${*r=\$$m[($n+=/>/-/</)%$m]}^=%$m];$r=/!\d/;$r=$&if?$&:$r^/\d!/}@F

Try it online!Try it online!

Perl 5, 83 82 79 bytes

Includes +3 for -F

Give instructions as one line on STDIN

#!/usr/bin/perl -F
1~~@$m&&say$m until++$m>map{${*r=\$$m[($n+=/>/-/</)%$m]}^=/!/;$r=$&if/\d/}@F

Try it online!

Perl 5, 83 82 79 77 bytes

Includes +3 for -F

Give instructions as one line on STDIN

#!/usr/bin/perl -F
1~~@$m&&say$m until++$m>map{*r=\$$m[($n+=/>/-/</)%$m];$r=/\d/?$&:$r^/!/}@F

Try it online!

First time I ever used a glob like this
Source Link
Ton Hospel
  • 14.9k
  • 1
  • 22
  • 45

Perl 5, 83 8282 79 bytes

Includes +3 for -F

Give instructions as one line on STDIN

#!/usr/bin/perl -F
1~~@a&&say$%until*a=++$%,$%>map1~~@$m&&say$m until++$m>map{$a[${*r=\$$m[($n+=/>/-/</)%$%]^=%$m]}^=/!/;$a[$n%$%]=$&if;$r=$&if/\d/}@F

Try it online!Try it online!

Perl 5, 83 82 bytes

Includes +3 for -F

Give instructions as one line on STDIN

#!/usr/bin/perl -F
1~~@a&&say$%until*a=++$%,$%>map{$a[($n+=/>/-/</)%$%]^=/!/;$a[$n%$%]=$&if/\d/}@F

Try it online!

Perl 5, 83 82 79 bytes

Includes +3 for -F

Give instructions as one line on STDIN

#!/usr/bin/perl -F
1~~@$m&&say$m until++$m>map{${*r=\$$m[($n+=/>/-/</)%$m]}^=/!/;$r=$&if/\d/}@F

Try it online!

added 12 characters in body
Source Link
Ton Hospel
  • 14.9k
  • 1
  • 22
  • 45

Perl 5, 8383 82 bytes

Includes +3 for -F

Give instructions as one line on STDIN

#!/usr/bin/perl -F
map{*a=++$m;map1~~@a&&say$%until*a=++$%,$%>map{$a[($n+=/>/-/</)%$m]^=%$%]^=/!/;$a[$n%$m]=$&if;$a[$n%$%]=$&if/\d/}@F;1~~@a&&say}1..@F

Try it online!Try it online!

Perl 5, 83 bytes

Includes +3 for -F

Give instructions as one line on STDIN

#!/usr/bin/perl -F
map{*a=++$m;map{$a[($n+=/>/-/</)%$m]^=/!/;$a[$n%$m]=$&if/\d/}@F;1~~@a&&say}1..@F

Try it online!

Perl 5, 83 82 bytes

Includes +3 for -F

Give instructions as one line on STDIN

#!/usr/bin/perl -F
1~~@a&&say$%until*a=++$%,$%>map{$a[($n+=/>/-/</)%$%]^=/!/;$a[$n%$%]=$&if/\d/}@F

Try it online!

Source Link
Ton Hospel
  • 14.9k
  • 1
  • 22
  • 45
Loading