http://www.perlmonks.org?node_id=777151


in reply to Re: Dial up some obscure stats for the Chutes and Ladders game
in thread Dial up some obscure stats for the Chutes and Ladders game

The wikipedia article indeed does mention those facts. But, it also mentions that there are other variants of the game. The version of the game I have at home has no such restrictions. This Perl code is based on the game manufactured by Hasbro (formerly Milton Bradley) in the United States in 1999. Your post has prompted me to do a little more web searching to find a site more specific to this version, including the rules. I apologize for the confusion.

That being said, the variant you pointed out is slightly more complex, and hence, would make for more interesting analysis.

  • Comment on Re^2: Dial up some obscure stats for the Chutes and Ladders game

Replies are listed 'Best First'.
Re^3: Dial up some obscure stats for the Chutes and Ladders game
by choroba (Cardinal) on Feb 22, 2015 at 11:53 UTC
    In case of the simple rules, you can't get to the square 100 before the 7th turn:
    #!/usr/bin/perl use warnings; use strict; use feature qw{ say }; my %special = ( ... ); # copy from the OP my %reachable = ( 0 => undef ); my $turn = 0; while (not exists $reachable{100}) { my %next; for my $square (keys %reachable) { for my $spin (1 .. 6) { my $target = $square + $spin; next if $target > 100; undef $next{$target}; undef $next{ $special{$target}{end} } if $special{$target} +; } } undef @reachable{ keys %next }; say ++$turn, ': ', join ' ', sort { $a <=> $b } keys %reachable; } say "$turn";
    لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ