Created
October 23, 2013 15:40
-
-
Save nokok/7121091 to your computer and use it in GitHub Desktop.
話題のぬるぽ
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
import java.util.*; | |
public class NullPo{ | |
static String out = ""; | |
public static void main(String[] args){ | |
char[] base = {'n','u','l','l','p','o'}; | |
while(isEnd()){ | |
char c = base[new Random().nextInt(5)]; | |
System.out.print(c); | |
out += c; | |
} | |
System.out.println("\n\n"); | |
System.out.println(out.length() == 5000 ? | |
"成功です!ぬるぽを吐きませんでした!" | |
: | |
out.length() + "回でぬるぽを吐きました..."); | |
} | |
public static Boolean isEnd(){ | |
return !out.endsWith("nullpo") && out.length() < 5000; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment