Created
December 15, 2011 22:56
-
-
Save libraplanet/1483363 to your computer and use it in GitHub Desktop.
monkeytype
This file contains hidden or 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
<?xml version="1.0" encoding="UTF-8" ?> | |
<project name="monkeytype" default="build" basedir="."> | |
<!-- Antタスク定義 --> | |
<target name="build" depends="init,compile" /> | |
<target name="rebuild" depends="clean,init,compile" /> | |
<!-- init --> | |
<target name="init"> | |
<mkdir dir="bin" /> | |
</target> | |
<!-- compile --> | |
<target name="compile"> | |
<javac srcdir="src" destdir="bin" fork="true" debug="true"/> | |
</target> | |
<!-- clean --> | |
<target name="clean"> | |
<delete quiet="true" includeEmptyDirs="true"> | |
<fileset dir="bin" includes="**" /> | |
</delete> | |
</target> | |
<target name="run"> | |
<java classname="Main" classpath="bin" fork="true"> | |
<arg value="windows" /> | |
</java> | |
</target> | |
</project> |
This file contains hidden or 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
import java.util.HashMap; | |
class Main | |
{ | |
static HashMap MAP = new HashMap(); | |
static | |
{ | |
MAP.put(".", "あ"); | |
MAP.put("/", "い"); | |
MAP.put("@", "う"); | |
MAP.put("a", "か"); | |
MAP.put("b", "き"); | |
MAP.put("c", "く"); | |
MAP.put("d", "さ"); | |
MAP.put("e", "し"); | |
MAP.put("f", "す"); | |
MAP.put("g", "た"); | |
MAP.put("h", "ち"); | |
MAP.put("i", "つ"); | |
MAP.put("j", "な"); | |
MAP.put("k", "に"); | |
MAP.put("l", "ぬ"); | |
MAP.put("m", "は"); | |
MAP.put("n", "ひ"); | |
MAP.put("o", "ふ"); | |
MAP.put("p", "ま"); | |
MAP.put("q", "み"); | |
MAP.put("r", "む"); | |
MAP.put("s", "め"); | |
MAP.put("t", "や"); | |
MAP.put("u", "ゆ"); | |
MAP.put("v", "よ"); | |
MAP.put("w", "ら"); | |
MAP.put("x", "り"); | |
MAP.put("y", "る"); | |
MAP.put("z", "れ"); | |
MAP.put("1", "あ"); | |
MAP.put("2", "か"); | |
MAP.put("3", "さ"); | |
MAP.put("4", "た"); | |
MAP.put("5", "な"); | |
MAP.put("6", "は"); | |
MAP.put("7", "ま"); | |
MAP.put("8", "や"); | |
MAP.put("9", "ら"); | |
} | |
/** | |
* | |
*/ | |
public static void main(String args[]) | |
{ | |
String str = args[0].toLowerCase(); | |
String output = ""; | |
for(int i = 0; i < str.length(); i++) | |
{ | |
output += MAP.get(str.substring(i, i + 1)); | |
} | |
System.out.println(output); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment