Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

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

by toolic (Bishop)
on Jul 04, 2009 at 01:42 UTC ( #777151=note: print w/replies, xml ) Need Help??


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 (Bishop) 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";
    لսႽ ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://777151]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (7)
As of 2019-10-23 09:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?