Skip to content

Instantly share code, notes, and snippets.

View nikuuchi's full-sized avatar

uchida nikuuchi

  • Tokyo, Japan
View GitHub Profile
@nikuuchi
nikuuchi / join.hs
Created May 15, 2014 15:55
文字列の配列をカンマでつなげる
join :: [String] -> String
join [] = ""
join (x:[]) = x
join (x:xs) = x ++ ", " ++ join xs
main = do
print $ join ["hoge", "fuga", "piyo"]
@nikuuchi
nikuuchi / output.py
Last active August 29, 2015 14:03
型付け
def f(n):
"""(<int>|<str>) -> (<int>|<str>)"""
return n #(<int>|<str>)
def g(c, d):
"""<str> -> <int> -> <str>"""
return (c * d) #<str>
print f(1) #(<int>|<str>) -> (<int>|<str>)
print f('a') #(<int>|<str>) -> (<int>|<str>)
int main() {
int i = 0
+ 1
+ 2
for int a = 1 a < 3 a++ {
int j = i
}
}
@nikuuchi
nikuuchi / emcc_wget.c
Created October 22, 2014 09:34
emscripten.hを使ってみた時のメモ
#include <stdio.h>
#include <stdlib.h>
#include <emscripten.h>
void onLoadCallback(const char *filename) {
FILE *fp;
char s[256];
if((fp = fopen(filename, "r")) == NULL) {
printf("file open error!!\n");