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 / test.js
Created May 8, 2018 01:13
javascriptでSKIとかTFの実装とか
const I = x => x;
const K = x => y => x;
const S = x => y => z => x(z)(y(z));
const p = console.log;
const T = x => y => x;
const F = x => y => y;
//p(T(1)(0));
@ryu1-1uyr
ryu1-1uyr / arrayFizzBuzz.js
Created May 10, 2018 05:48
配列をつくってそのkeyをつかったfizzbuzz!
[...Array(31).keys()].filter(f=>(f>0)).forEach((i)=>{console.log(i%3==0?i%5==0?"fizz buzz":"fizz":i%5==0?"buzz":i)})
@ryu1-1uyr
ryu1-1uyr / fizzbuzzz.js
Created May 25, 2018 00:44
引き渡し型で書いたつもり!!!!こういう感じで合ってるのだろうか
const p = console.log
const TF = x => x%3==0 ? x%5 == 0?p("Fizz Buzz"):p("fizz"):x%5==0?p("Buzz"):p(x)
const loop = x => y => f =>{
f(x)
x < y ? loop(x+1)(y)(f):" "
}
loop(1)(31)(TF)
@ryu1-1uyr
ryu1-1uyr / ふぃずばず.js
Created May 28, 2018 08:19
そのうちけす。
const ごじゅうまでのはいれつ = [...Array(51).keys()];
const たんまつにひょうじ = console.log;
const ぜろぬかす = f=>(f>0);
const ふぃずばずする = x => x % 3 ===0 ? x%5 ===0?"ふぃずばず":"ふぃず":x%5 ===0?"ばず":x;
ごじゅうまでのはいれつ.filter(ぜろぬかす).forEach((i)=>たんまつにひょうじ(ふぃずばずする(i)))
@ryu1-1uyr
ryu1-1uyr / ᚪᛉᛝᛞᚥᛔᛪᛤᛤ.js
Created May 29, 2018 03:06
あほなことしてるなーじぶん
let ᛝ = ((-~[]+!"ᚸᚸ")+((("ᚣᛄᛘ"==="ᛤ")-[])+[])+((!"ᛒᛕᛗ")-[]))-0
const ᚱᚲᚳᚵᚷᚸ = console.log;
const ᛑᛏᛥᛥ = x => x%(-~[-~[-~[]]])===0?x%(-~-~-~[-~[-~[]]])===0?"ᚪᛉᛝᛞᚥᛔᛪᛤᛤ":"ᚪᛉᛝᛞ":x%(-~-~-~[-~[-~[]]]) ===0?"ᛔᛪᛤᛤ":x;
for (let ᛯᛰ=(false-[]);ᛯᛰ<ᛝ;ᛯᛰ++){
ᚱᚲᚳᚵᚷᚸ(ᛑᛏᛥᛥ(ᛯᛰ))
}
@ryu1-1uyr
ryu1-1uyr / yabai.js
Created May 29, 2018 04:25
ルーン文字でコーディングしたかっただけ。やってることはfizzbuzz
const [ᛝ,ᚱᚲᚳᚵᚷᚸ,ᛑᛏᛥᛥ,ᛞᛟᛠ] = [((-~[]+!"ᚸᚸ")+((("ᚣᛄᛘ"==="ᛤ")-[])+[])+((!"ᛒᛕᛗ")-[]))-0,console.log,(x => x%(-~[-~[-~[]]])===0?x%(-~-~-~[-~[-~[]]])===0?"ᚪᛉᛝᛞᚥᛔᛪᛤᛤ":"ᚪᛉᛝᛞ":x%(-~-~-~[-~[-~[]]]) ===0?"ᛔᛪᛤᛤ":x),(-~[])]
const ᛄᛅᛇᛈᛉᛊ = x => y => f => p => {p(f(x));x<=y?ᛄᛅᛇᛈᛉᛊ(x+1)(y)(f)(p):"ᛛᛜᛝᛞᛟᛠ"}
ᛄᛅᛇᛈᛉᛊ(ᛞᛟᛠ)(ᛝ)(ᛑᛏᛥᛥ)(ᚱᚲᚳᚵᚷᚸ)
firstCards = input().split(" ")
field = []
unfair = {'J':11,'Q':12,'K':13,'A':14,'2':15,'unk':1,'3':3,'4':4,'5':5,'6':6,'7':7,'8':8,'9':9,'10':10} #ださいw
# unfair[i] => 13
print(firstCards)
#hikisuu 2 dotti tuyoi?
def duel(x,field):
if unfair[x] > unfair[field[-1]]:
return True
@ryu1-1uyr
ryu1-1uyr / reducefizzbuzz.js
Created June 4, 2018 08:26
0604の授業の成果です filter mapとか
[...Array(31).keys()].filter(x => x > 0).map(y => y%3==0 ? y%5 ==0?"FizzBuzz":"Fizz":y%5==0?"Buzz":y)
@ryu1-1uyr
ryu1-1uyr / fizz.js
Created June 25, 2018 08:44
クロージャーと抽象関数つかったfizzbuzz、fizzbuzz関数をクロージャーで作ってるのは甘え<=
const fizzbuzz = (v) => {
const origin = num => word => inputnum => {
return inputnum % num == 0 ? word : inputnum;
}
const fizz = origin(3)('Fizz')
const buzz = origin(5)('Buzz')
const fizzbuzz = origin(15)('FizzBuzz')
@ryu1-1uyr
ryu1-1uyr / fizzbuzz.py
Created June 29, 2018 04:12
リスト内包
N = int(input())
for o in [(i%3==0)*'Fizz' + (i%5==0)*'Buzz' or i for i in range(1, N+1)]:
print (o)