Created
November 6, 2022 17:01
-
-
Save fabienhinault/3dc80f48b6a1a0f18f9ce14b74684c9c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use List::Util qw(zip) | |
@a = reverse sort map {int(rand 6) + 1} (1..3) | |
print "tirage attaquant: @a\n" | |
@d = reverse sort map {int(rand 6) + 1} (1,2) | |
print "tirage defenseur: @d\n" | |
@r = map {$_->[0] > $_->[1]} ((zip \@a, \@d)[0..1]) | |
$dd = - grep $_ == 1, @r | |
$da = - grep($_ == "", @r) | |
print "dommage attaquant:$da\n" | |
print "dommage défenseur:$dd\n" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment