Skip to content

Commit

Permalink
- Minor API change: prefix - is now converted into the neg method…
Browse files Browse the repository at this point in the history
… call (instead of `negate`)

modified:   scripts/Games/pig_the_dice_game_player.sf
modified:   scripts/Tests/man_or_boy_2.sf
  • Loading branch information
trizen committed Dec 17, 2015
1 parent 1e2133f commit 0621e50
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/Sidef/Deparse/Perl.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1348,7 +1348,7 @@ HEADER
}

if ($method eq '-') {
$code = $self->deparse_args(@{$call->{arg}}) . '->negate';
$code = $self->deparse_args(@{$call->{arg}}) . '->neg';
next;
}

Expand Down
6 changes: 3 additions & 3 deletions scripts/Games/pig_the_dice_game_player.sf
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#!/usr/bin/ruby

var (games=10) = @ARGV.map{.to_i};
var (games=100) = @ARGV.map{.to_i};

define DIE = 1..6;
define GOAL = 100;

class Player(score=0, ante=nil, rolls, strategy={false}) {
class Player(score=0, ante=0, rolls=0, strategy={false}) {
method turn {
rolls = 0;
ante = 0;
Expand All @@ -16,7 +16,7 @@ class Player(score=0, ante=nil, rolls, strategy={false}) {
ante = 0;
break;
}
when (roll > 1) {
case (roll > 1) {
ante += roll;
}
}
Expand Down
2 changes: 1 addition & 1 deletion scripts/Tests/man_or_boy_2.sf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/ruby

func a(k, x1, x2, x3, x4, x5) {
k <= 0 ? (x4.run + x5.run)
k <= 0 ? (x4() + x5())
: func b { a(--k, b, x1, x2, x3, x4) }();
};

Expand Down

0 comments on commit 0621e50

Please sign in to comment.