Last active
August 29, 2015 14:16
-
-
Save Yuiki/e9b1246f46a0e0894462 to your computer and use it in GitHub Desktop.
縦書き俳句プログラミング in Semicolonless 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
/* | |
* Title:縦書き俳句プログラミング in Semicolonless Java. | |
* Description:初めてのSemicolonless Java。 | |
* Author:ゆいき @_yuiki | |
*/ | |
public class Main { | |
public static void main(String[] args) { | |
for (String haiku : new String[]{"古池や 蛙飛び込む 水の音"}) { | |
for (String[] splitHaiku : new String[][]{haiku.split(" ")}) { | |
for (int colSize : new int[]{splitHaiku.length}) { | |
for (int rowSize : new int[]{-1}) { | |
for (int i : new int[]{0}) { | |
while (i < colSize) { | |
if (splitHaiku[i].length() > rowSize) { | |
if (System.out.printf("", rowSize = splitHaiku[i].length()) == null) { | |
} | |
} | |
if (System.out.printf("", i++) == null) { | |
} | |
} | |
} | |
for (StringBuilder newHaiku : new StringBuilder[]{new StringBuilder()}) { | |
for (int i : new int[]{0}) { | |
while (i < rowSize) { | |
for (int j : new int[]{0}) { | |
while (j < colSize) { | |
for (int index : new int[]{(colSize - 1) - j}) | |
if (i < splitHaiku[index].length()) { | |
if (newHaiku.append(splitHaiku[index].charAt(i)) == null) { | |
} | |
} else { | |
if (newHaiku.append(" ") == null) { | |
} | |
} | |
if (System.out.printf("", j++) == null) { | |
} | |
} | |
} | |
if (newHaiku.append("\n") == null) { | |
} | |
if (System.out.printf("", i++) == null) { | |
} | |
} | |
} | |
if (System.out.printf(newHaiku.toString()) == null) { | |
} | |
} | |
} | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment