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
let zero = ".###" ^ | |
".#.#" ^ | |
".#.#" ^ | |
".#.#" ^ | |
".###" | |
let one = "..#." ^ | |
".##." ^ | |
"..#." ^ | |
"..#." ^ |
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
module CountDict = Map.Make(Int) | |
let cnt_int lst = | |
let rec add_lst dict l = | |
match l with | |
| [] -> dict | |
| first :: rest -> | |
if CountDict.mem first dict then add_lst (CountDict.add first ((CountDict.find first dict) + 1) dict) rest else | |
add_lst (CountDict.add first 1 dict) rest | |
in add_lst CountDict.empty lst | |
let n = read_int () |
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
(* 文字列をcharのlistにする *) | |
let explode s = List.init (String.length s) (String.get s) | |
let dp = Array.make_matrix 100 2 0 | |
let _ = dp.(0).(1) <- 1 | |
let s = read_line () | |
let zero = int_of_char '0' | |
let s_array = explode s |> List.map int_of_char |> Array.of_list | |
let rec zero_to_zero_loop i j k = | |
if j >= k then () else | |
(dp.(i+1).(0) <- dp.(i+1).(0) + dp.(i).(0); zero_to_zero_loop i (j+1) k) |
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
dispander: https://github.com/DiscordBotPortalJP/dispander.git |
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
from discord import Embed | |
GO_REACTION = "\N{BLACK RIGHT-POINTING TRIANGLE}" | |
BACK_REACTION = "\N{BLACK LEFT-POINTING TRIANGLE}" | |
STOP_REACTION = "\N{BLACK SQUARE FOR STOP}" | |
class ListView: | |
page = 0 | |
embed = None | |
message = None |
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
from math import ceil, floor | |
from web import WebView | |
import appex | |
import ui | |
import clipboard | |
import os | |
max_frame = (0, 0, 359, 650) | |
COLS = 3 | |
ROWS = 2 |
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
# -*- coding: utf-8 -*- | |
from googleapiclient.discovery import build | |
from googleapiclient.errors import HttpError | |
print('youtubeの動画を検索することができます!') | |
print('キーワードを入れてね!') | |
qe = input("->") | |
class SearchYoutube(object): |
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
fibs = [1,2] | |
index = 0 | |
while True: | |
nextIndex = index + 1 | |
fib = fibs[index] | |
nextFib = fibs[nextIndex] | |
newFib = fib + nextFib | |
if newFib > 4000000: | |
break | |
fibs = fibs + [newFib] |
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
y = 0 | |
def fibonacci(n, a=1, b=0): | |
return b if n < 1 else fibonacci(n - 1, a + b, a) | |
for x in xrange(1,35): | |
f = fibonacci(x, a=1, b=0) | |
if f % 2 == 0: | |
y = y + f | |
print y |
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
y = 0 | |
for x in xrange(0,1000): | |
if x % 3 == 0: | |
y = y + x | |
elif x % 5 == 0: | |
y = y + x | |
else: | |
pass | |
print y |