Skip to content

Instantly share code, notes, and snippets.

tomcha tomcha

Block or report user

Report or block tomcha

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@tomcha
tomcha / fatcomma.pl
Last active Oct 20, 2019
fatcomma.pl
View fatcomma.pl
#!/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
#!/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']};
@tomcha
tomcha / fizzbuzz.go
Created Apr 24, 2019
fizz buzz + goroutine
View fizzbuzz.go
package main
import (
"fmt"
"sync"
)
func main() {
var wg sync.WaitGroup
wg.Add(1)
@tomcha
tomcha / guess-ad-year.pl
Created Apr 14, 2019
Perl入学式 第1回 ピザ会 課題 2019/04/13 回答
View guess-ad-year.pl
#!/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年
@tomcha
tomcha / dijkstra.pl
Created Apr 13, 2019
ダイクストラ法
View dijkstra.pl
#!/usr/bin/env perl
use strict;
use warnings;
use feature 'say';
use DDP { deparse => 1 };
my $graph = [];
for my $line (<DATA>){
View Trapezoidal.pl
#!/usr/bin/env perl
use strict;
use warnings;
use feature 'say';
use DDP { deparse => 1 };
print "a b(区間)を入力してください(スペース区切り) >";
chomp(my $input = <STDIN>);
@tomcha
tomcha / newton.pl
Created Apr 13, 2019
ニュートン法
View newton.pl
#!/usr/bin/env perl
use strict;
use warnings;
use feature 'say';
use DDP { deparse => 1 };
print "求めたい平方根を入力>>";
chomp(my $root_num = <STDIN>);
@tomcha
tomcha / quicqsort2.pl
Created Apr 13, 2019
クイックソートその2
View quicqsort2.pl
#!/usr/bin/env perl
use strict;
use warnings;
use feature 'say';
use DDP { deparse => 1 };
my @seeds;
for (1..10){
@tomcha
tomcha / quicksort.pl
Created Apr 13, 2019
クイックソート1
View quicksort.pl
#!/usr/bin/env perl
use strict;
use warnings;
use feature 'say';
use DDP { deparse => 1 };
my @seeds;
for (1..100){
@tomcha
tomcha / fact_recursive.pl
Created Apr 13, 2019
階乗を求める
View fact_recursive.pl
#!/usr/bin/env perl
use strict;
use warnings;
use feature 'say';
use DDP { deparse => 1 };
chomp(my $i = <STDIN>);
say get_fact($i);
You can’t perform that action at this time.