Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
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 ( [id://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.

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

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (6)
As of 2024-03-19 07:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found