Skip to content

Instantly share code, notes, and snippets.

View boxp's full-sized avatar
👩‍💻
in reality

Keitaro Takeuchi boxp

👩‍💻
in reality
View GitHub Profile
@boxp
boxp / dolls.c
Last active December 18, 2015 15:18
Cで作ったなんちゃってclojure関数たち
// 文字列版take
void take_char(int n, char* string, char* substring) {
int i;
for (i = 0; i < n; i++) {
substring[i] = string[i];
}
substring[i+1] = '\0';
}
@boxp
boxp / t071-func.c
Last active December 18, 2015 11:59
プログラム基礎Ⅱの小テストを変数無しで解いてみる試みその1
#include <stdio.h>
int sum(const int num[],const int count,const int result){
if (count == 0) {
return result + num[count];
} else {
sum(num,(count-1),(result + num[count]));
}
}
@boxp
boxp / fizzbuzz.clj
Created June 3, 2013 20:54
clojureでFizz Buzz
(defn fizzbuzz
"fizzbuzz"
[x]
(cond (and (= (mod x 3) 0)
(= (mod x 5) 0)) "Fizz Buzz"
(= (mod x 3) 0) "Fizz"
(= (mod x 5) 0) "Buzz"
:else x))
@boxp
boxp / jcurses-test.clj
Created May 6, 2013 15:45
jcursesのexampleをclojureで写経したもの。結局jcursesをスタンドアロン出来ず、使わないので放置。
(ns grimoire.jcurses
(:import (jcurses.system CharColor)
(jcurses.widgets DefaulLayoutManager)
(jcurses.widgets WidgetsConstants)
(jcurses.widgets Window)))
(def lbl
(doto
(Label.
"All gone to hell!"
@boxp
boxp / fibonacci.scala
Last active December 10, 2015 05:18
This code is test for scala.
object fibonacci {
def main(args: Array[String]) {
var fibonacci = List(1,1)
while(fibonacci.length < args(0).toInt) {
fibonacci = fibonacci :+ fibonacci.takeRight(2).sum
}
println(fibonacci.apply(args(0).toInt - 1))