Skip to content

Instantly share code, notes, and snippets.

View daiksy's full-sized avatar

KASUYA, Daisuke daiksy

View GitHub Profile
@daiksy
daiksy / hoge.vb
Created May 8, 2014 12:47
https://twitter.com/chomado/status/464381263978041345 の指摘に従って実装してみた。
Dim い As Integer
For い = 0 To 5
'ループ内の処理
Next い
Dim ろ As Integer
For ろ = 0 To 5
'ループ内の処理
@daiksy
daiksy / CodingGameTraining.scala
Created October 4, 2014 03:39
CodingGame Training
import math._
import scala.util._
/**
* The code below will read all the game information for you.
* On each game turn, information will be available on the standard input, you will be sent:
* -> the total number of visible enemies
* -> for each enemy, its name and distance from you
* The system will wait for you to write an enemy name on the standard output.
* Once you have designated a target:
@daiksy
daiksy / CodingGameEasy3.scala
Last active August 29, 2015 14:07
CodingGame Puzzle - Kirk's Quest - The Descent
import math._
import scala.util._
/**
* Auto-generated code below aims at helping you parse
* the standard input according to the problem statement.
**/
object Player {
def main(args: Array[String]) {
@daiksy
daiksy / kadokawa.scala
Last active August 29, 2015 14:22
カドカワ
import scala.util.Random
val r = new Random()
r.shuffle(List("カ", "ド" ,"カ" ,"ワ", "ン", "ゴ")).take(4).mkString
package controllers;
import play.*;
import play.mvc.*;
import views.html.*;
public class Application extends Controller {
/**
@daiksy
daiksy / fizzbuzz.scala
Created March 31, 2012 02:48
素振り:scalaでfizzbuzz
/** map **/
1 to 100 map {
case i if i % 15 == 0 => "fizzbuzz"
case i if i % 3 == 0 => "fizz"
case i if i % 5 == 0 => "buzz"
case i => i
} foreach println
/** for **/
for(i <- 1 to 100) println(
@daiksy
daiksy / Play2-ATND-EventSearch.scala
Created May 3, 2012 08:13
Play2.0でATNDのイベントサーチAPIを使うクラス
package com.github.daiksy.play2.ATND
import play.api.libs.ws.WS
import collection.mutable.ListBuffer
import play.api.libs.json.JsValue
/**
* ATNDのイベントを検索し、取得する。
*
* ・使い方
@daiksy
daiksy / gist:2585850
Created May 3, 2012 14:01
Play2.0でATNDのイベントサーチAPIを使うクラス (mutableな変数を極力使わないver)
package com.github.daiksy.play2.ATND
import play.api.libs.ws.WS
import collection.mutable.ListBuffer
import play.api.libs.json.JsValue
/**
* ATNDのイベントを検索し、取得する。
* https://gist.github.com/2584254を
* http://blog.rafaelferreira.net/2008/07/type-safe-builder-pattern-in-scala.html を参考に
@daiksy
daiksy / gist:2586213
Created May 3, 2012 14:51
Play2.0でATNDのイベントサーチAPIを使うクラス (mutableな変数を極力使わないver. case classのcopyを使ってちょっとスッキリ)
package com.github.daiksy.play2.ATND
import play.api.libs.ws.WS
import collection.mutable.ListBuffer
import play.api.libs.json.JsValue
/**
* ATNDのイベントを検索し、取得する。
*
* https://gist.github.com/2585850 を
@daiksy
daiksy / helloworld.cbl
Created May 5, 2012 15:46
COBOL書いてみた
000100 IDENTIFICATION DIVISION.
000200 PROGRAM-ID. HELLOWORLD.
000300 DATE-WRITTEN. 05/06/12 00:45.
000400* AUTHOR DAIKSY
100000 PROCEDURE DIVISION.
100100
100200 MAIN-LOGIC SECTION.
100300 BEGIN.
100500 DISPLAY "HELLO, WORLD."
100600 STOP RUN.