Bad Perl: Josephus problem


This blog post has moved to https://matthewvaneerde.wordpress.com/2009/07/29/bad-perl-josephus-problem/

Comments (1)
  1. Pat Erley says:

    76 I believe (wc -m says so

    perl -e ‘@A=1..$ARGV[0];while($A[1]){$j=shift@A;push(@A,$j)if(++$i)%$ARGV[1]}print@A’ 12 3

    Pat

Comments are closed.

Skip to main content