View sref.pl
This file contains 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 'say'; | |
my $a = 1; | |
my $b = $a; | |
$b *= 10; |
View gist:363a26e903db7697b6e40ccb4154ae86
This file contains 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 ruby | |
(y, x) = gets.chomp.split(/ /).map(&:to_i) | |
now = [1, 1] | |
addy = 1 | |
addx = 1 | |
puts "#{now[0]}, #{now[1]}" | |
while | |
now[0] += addy | |
now[1] += addx |
View gist:5b6fbee7cb92a851081930c85e46cf17
This file contains 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 ruby | |
(y, x) = gets.chomp.split(/ /).map(&:to_i) | |
now = [1, 1] | |
addy = 1 | |
addx = 1 | |
puts "#{now[0]}, #{now[1]}" | |
while | |
now[0] += addy | |
now[1] += addx |
View lifegame.go
This file contains 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
package main | |
import ( | |
"fmt" | |
"math/rand" | |
"time" | |
) | |
const ( | |
clear = "\033[2J" |
View fatcomma.pl
This file contains 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; | |
my ($a, $b, $c) = (1, 2, 3); | |
my ($aa, $bb, $cc) = (1 => 2 => 3); | |
print "$b\n"; | |
print "$cc\n"; |
View ref_allow.pl
This file contains 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 'say'; | |
use DDP { deparse => 1 }; | |
my $allow = {1 => ['a', 'b', 'c'], 2 => ['d', 'e', 'f']}; |
View fizzbuzz.go
This file contains 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
package main | |
import ( | |
"fmt" | |
"sync" | |
) | |
func main() { | |
var wg sync.WaitGroup | |
wg.Add(1) |
View guess-ad-year.pl
This file contains 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 | |
# guess-ad-year.pl - 和暦を引数に与えると西暦年を応えてくれる | |
# ad は A.D. (Anno Domini = 西暦年) の略 | |
# | |
# 例: | |
# guess-ad-year.pl 平成30年 | |
# 2018年 | |
# guess-ad-year.pl 昭和54年 | |
# 1979年 |
View dijkstra.pl
This file contains 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 'say'; | |
use DDP { deparse => 1 }; | |
my $graph = []; | |
for my $line (<DATA>){ |
View Trapezoidal.pl
This file contains 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 'say'; | |
use DDP { deparse => 1 }; | |
print "a b(区間)を入力してください(スペース区切り) >"; | |
chomp(my $input = <STDIN>); |
NewerOlder