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
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
use feature qw(say); | |
use constant LENGTH => 10; | |
my ($n, $min, $max) = (shift @ARGV || 8, 0, 0); | |
my @positions = (); | |
push @positions, int(rand(LENGTH + 1)) for (1 .. $n); | |
for my $position (@positions) { |
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
# Concatenate elisp files in the current directory | |
for f in $(ls | grep -E 'el$'); do $(cat $f >> concat.el); $(echo -e "\n" >> concat.el); done |
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
#!/usr/bin/env perl | |
use 5.12.0; | |
use warnings; | |
use List::Util qw/shuffle/; | |
use constant { | |
P => 'Player', | |
D => 'Dealer', | |
}; |
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
#!/usr/bin/env perl | |
use 5.12.0; | |
use warnings; | |
# It sprits a character string in N characters. | |
my @alphabets = join('', 'a' .. 'y') =~ m/.{1,3}/g; | |
say join ',', @alphabets; | |
# >> abc,def,ghi,jkl,mno,pqr,stu,vwx,y |
NewerOlder