Skip to content

Instantly share code, notes, and snippets.

View ryu1-1uyr's full-sized avatar
🐉
ryu

Ryu ryu1-1uyr

🐉
ryu
View GitHub Profile
@ryu1-1uyr
ryu1-1uyr / saitan.py
Last active August 10, 2017 07:36
paiza.jp/poh/phantom_thief の問題。座標上の点間を最短距離で詰める。行き詰まった 悪くないです ループ部分が課題
# coding: utf-8
import math
nums = int(input())
distance = 0
distance2 = 0
this_x = 0
this_y = 0
x_y =''
data = {}
sortdata = []
@ryu1-1uyr
ryu1-1uyr / FizzBuzz.py
Created September 4, 2017 18:06
paiza 練習問題 rankC
inputnums = int(input())
for i in range(inputnums + 1):
if i == 0:
continue
if i % 15 == 0:
print("Fizz Buzz")
elif i % 3 == 0:
print("Fizz")
elif i % 5 == 0:
@ryu1-1uyr
ryu1-1uyr / LessCard.py
Created September 7, 2017 03:18
rankD paiza
nums = 0
ans = 0
for i in range (4):
nums += int(input())
ans = 15 - nums
print(ans)
@ryu1-1uyr
ryu1-1uyr / paizaB047.py
Created December 4, 2017 07:28
https://paiza.jp/challenges/212/show 動くけど未完成、バイトコード使えば良いのでは? このまま続けると階層エグくなりそう
# coding: utf-8
typeKey = input()
keyLeng = len(typeKey)
flag = 0
ans = 0
for i in range(keyLeng):
if i == keyLeng - 1 :
break
@ryu1-1uyr
ryu1-1uyr / FizzBuzz.pl
Created December 8, 2017 02:47
selection =>perl FizzBuzz
#!/use/bin/perl
use warnings;
use strict;
use 5.010;
my $i = 0;
while($i <= 100) {
@ryu1-1uyr
ryu1-1uyr / bmi.pl
Created December 8, 2017 02:52
selection => perl bmiChecker
#!/use/bin/perl
use warnings;
use strict;
use 5.010;
say "体重どうぞ";
my $omosa = <STDIN>;
@ryu1-1uyr
ryu1-1uyr / index.pl
Last active January 25, 2018 05:12
perlでHTMLのタグを抜きます
#!/use/bin/perl
use warnings;
use strict;
use 5.010;
my $line;
while($line = <>){
if($line =~ /<.*?>/){
$line =~ s/<.*?>//g;
@ryu1-1uyr
ryu1-1uyr / index.js
Created January 24, 2018 08:02
関数型で書きたい 自分の解釈でコメントアウト(間違ってるかもしれない)
const curry = fn => (...args) => fn.bind(null, ...args);
const curryOne = fn => x =>fn(x); //引数の数を無視して、1つ目の引数を持ってくる
const _compose = (f, g) => (x) => f(g(x)); //2つの関数を実行g => fの順番
const compose = (...fs) => fs.reduce(_compose); //n個の関数を実行する 後ろから実行する(_composeを多様化させた)
const pipe = (...fs) => fs.reduceRight(_compose);
const p = console.log;
const double = (x) => x * 2;
@ryu1-1uyr
ryu1-1uyr / index.php
Created February 12, 2018 07:11
なんか回りくどい
<?php
$prices = array(1000, 650, 750, 800);
echo '$pricesの値: ';
foreach ($prices as $price) {
echo $price.' ';
}
echo '<br>';
echo '-----';
echo '<br>';
@ryu1-1uyr
ryu1-1uyr / App.js
Last active February 13, 2018 06:12
pokemonのデータ取ってくるの返す奴。 reactっぽく書きなおしてみた!
import React, { Component } from 'react';
import './App.css';
class App extends Component {
constructor(props){ //わかった!!!
super(props);
this.state = {"name": "ポケモンの名前", //初期値
"classification": null,
"type": "ポケモンのタイプ",
"image": "https://pics.prcm.jp/f7e8ba48d36a5/59605483/png/59605483.png",