mirror of
https://github.com/coding-horror/basic-computer-games.git
synced 2025-12-22 07:10:42 -08:00
Merge pull request #471 from trwyant/80_Slots_Rev_1_trw
Revise the documentation for 80_Slots/perl
This commit is contained in:
@@ -1,3 +1,23 @@
|
|||||||
Original source downloaded [from Vintage Basic](http://www.vintage-basic.net/games.html)
|
Original source downloaded [from Vintage Basic](http://www.vintage-basic.net/games.html)
|
||||||
|
|
||||||
Conversion to [Perl](https://www.perl.org/)
|
Conversion to [Perl](https://www.perl.org/)
|
||||||
|
|
||||||
|
This Perl script is a port of slots, which is the 80th entry in Basic
|
||||||
|
Computer Games.
|
||||||
|
|
||||||
|
I know nothing about slot machines, and my research into them says to me
|
||||||
|
that the payout tables can be fairly arbitrary. But I have taken the
|
||||||
|
liberty of deeming the BASIC program's refusal to pay on LEMON CHERRY
|
||||||
|
LEMON a bug, and made that case a double.
|
||||||
|
|
||||||
|
My justification for this is that at the point where the BASIC has
|
||||||
|
detected the double in the first and third reels it has already detected
|
||||||
|
that there is no double in the first and second reels. After the check
|
||||||
|
for a bar (and therefore a double bar) fails it goes back and checks for
|
||||||
|
a double on the second and third reels. But we know this check will
|
||||||
|
fail, since the check for a double on the first and second reels failed.
|
||||||
|
So if a loss was intended at this point, why not just call it a loss?
|
||||||
|
|
||||||
|
To restore the original behavior, comment out the entire line commented
|
||||||
|
'# Bug fix?' (about line 75) and uncomment the line with the trailing
|
||||||
|
comment '# Bug?' (about line 83).
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ while ( 1 ) { # Iterate indefinitely
|
|||||||
}
|
}
|
||||||
} elsif ( $reel_x == $reel_z ) {
|
} elsif ( $reel_x == $reel_z ) {
|
||||||
if ( $reel_z ) {
|
if ( $reel_z ) {
|
||||||
$winnings += double( $bet );
|
$winnings += double( $bet ); # Bug fix?
|
||||||
# NOTE that the below code is what is actually implemented
|
# NOTE that the below code is what is actually implemented
|
||||||
# in the basic, but it is implemented strangely enough (a
|
# in the basic, but it is implemented strangely enough (a
|
||||||
# GOTO a line that contains a test that, if I understand the
|
# GOTO a line that contains a test that, if I understand the
|
||||||
@@ -80,7 +80,7 @@ while ( 1 ) { # Iterate indefinitely
|
|||||||
# I know nothing about slot machines, but research suggests
|
# I know nothing about slot machines, but research suggests
|
||||||
# the payoff table is fairly arbitrary. The code above makes
|
# the payoff table is fairly arbitrary. The code above makes
|
||||||
# code above makes the game orthogonal.
|
# code above makes the game orthogonal.
|
||||||
# $winnings += you_lost( $bet );
|
# $winnings += you_lost( $bet ); # Bug?
|
||||||
} else {
|
} else {
|
||||||
$winnings += double_bar( $bet );
|
$winnings += double_bar( $bet );
|
||||||
}
|
}
|
||||||
@@ -215,6 +215,10 @@ a double on the second and third reels. But we know this check will
|
|||||||
fail, since the check for a double on the first and second reels failed.
|
fail, since the check for a double on the first and second reels failed.
|
||||||
So if a loss was intended at this point, why not just call it a loss?
|
So if a loss was intended at this point, why not just call it a loss?
|
||||||
|
|
||||||
|
To restore the original behavior, comment out the entire line commented
|
||||||
|
C<'# Bug fix?'> (about line 75) and uncomment the line with the trailing
|
||||||
|
comment C<'# Bug?'> (about line 83).
|
||||||
|
|
||||||
=head1 PORTED BY
|
=head1 PORTED BY
|
||||||
|
|
||||||
Thomas R. Wyant, III F<wyant at cpan dot org>
|
Thomas R. Wyant, III F<wyant at cpan dot org>
|
||||||
|
|||||||
Reference in New Issue
Block a user