Skip to content

Instantly share code, notes, and snippets.

@necoco
necoco / divisor.kt
Created December 8, 2012 06:39
宿題
fun main(args: Array<String>){
val a = args[0].toInt()
val b = args[1].toInt()
println(divisor(a, b))
}
fun divisor(val a: Int,val b: Int): Int{
val n = a % b
if(n != 0){
@necoco
necoco / test.js
Last active December 19, 2015 13:49
actor-role system
/**
どのようなコードイメージになるかを考える
テーマ:
アクションゲーム用
最初はCreateJSシリーズを使う
*/
var ars = function(){
function createMethodsFromRoles(proto, roles){
var methodNames = listUpMethodNames(roles);
rune();
var update = rune.update();
var player = {x: 0, y: 0, width: 20, height: 20, dir: 1};
function move(p){
p.x += 100 * this.deltaTime * p.dir;
return p;
}
@necoco
necoco / sample.coffee
Last active August 29, 2015 14:12
fp sample
W = 800
H = 600
R = 50
class Sprite
constructor: ()->
init: ()->
@x = Math.random() * W
@y = Math.random() * H
@necoco
necoco / flor.coffee
Last active July 30, 2017 05:39
painless FRP library Flor prototype
class FlorContinue
constructor: (key)->
@key = key
class FlorEnd
class Flor
@_id = 1
@generateId = ()->