Created
April 23, 2011 09:44
-
-
Save xuwei-k/938506 to your computer and use it in GitHub Desktop.
Javaでイカ娘を書いたゲソ
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
interface Func<A, B> { | |
B apply(A param); | |
} | |
class イカ言語<侵略> { | |
public イカ言語(侵略 ピコピコ) { | |
this.ピコピコ = ピコピコ; | |
} | |
侵略 ピコピコ; | |
public <イカスミ> イカスミ の(final Func<侵略, イカスミ> 触手) { | |
return 触手.apply(ピコピコ); | |
} | |
public <イカスミ> イカスミ に(final Func<侵略, イカスミ> 触手) { | |
return 触手.apply(ピコピコ); | |
} | |
public <イカスミ> イカスミ を(final Func<侵略, イカスミ> 触手) { | |
return 触手.apply(ピコピコ); | |
} | |
} | |
class イカ娘 { | |
static String 料理(final String 祝) { | |
return "イカスミ" + 祝; | |
} | |
static int 計算(final int 侵略) { | |
return 侵略; | |
} | |
static int 倍(final int イカ) { | |
return イカ * 2; | |
} | |
static <でゲソ> String しなイカ(final でゲソ 娘) { | |
return 娘.toString() + "でゲソ"; | |
} | |
static <でゲソ> String 作らなイカ(final でゲソ 二期) { | |
return 二期 + "でゲソ"; | |
} | |
public static void main(String[] args) { | |
final String イ = (new イカ言語<Integer>((new イカ言語<Integer>(1 + 1)) | |
.の(new Func<Integer, Integer>() { | |
public Integer apply(Integer i) { | |
return 計算(i); | |
} | |
}))).を(new Func<Integer, String>() { | |
public String apply(Integer i) { | |
return しなイカ(i); | |
} | |
}); | |
final String カ = (new イカ言語<Integer>((new イカ言語<Integer>(3)) | |
.を(new Func<Integer, Integer>() { | |
public Integer apply(Integer i) { | |
return 倍(i); | |
} | |
}))).に(new Func<Integer, String>() { | |
public String apply(Integer i) { | |
return しなイカ(i); | |
} | |
}); | |
final String 娘 = (new イカ言語<String>((new イカ言語<String>("スイカ")) | |
.の(new Func<String, String>() { | |
public String apply(String s) { | |
return 料理(s); | |
} | |
}))).を(new Func<String, String>() { | |
public String apply(String i) { | |
return 作らなイカ(i); | |
} | |
}); | |
System.out.println(イ);//2でゲソ | |
System.out.println(カ);//6でゲソ | |
System.out.println(娘);//イカスミスイカでゲソ | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment