Last active
May 29, 2019 21:14
-
-
Save syobochim/c7f324a227341fdaaee0 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
package gist; | |
import java.util.Arrays; | |
import java.util.List; | |
import java.util.Random; | |
import java.util.stream.Collectors; | |
public class BonJobi { | |
public static void main(String[] args) { | |
genBonjovi(); | |
} | |
private static void genBonjovi() { | |
List<String> bonJovi = Arrays.asList("ジョ", "ン", "ボ", "ヴィ"); | |
Random random = new Random(); | |
String johnBonJovi = ""; | |
int count = 0; | |
while (!johnBonJovi.endsWith("ジョン・ボン・ジョヴィ")) { | |
johnBonJovi = johnBonJovi + "・"; | |
String twoWords = random | |
.ints(0, bonJovi.size()) | |
.limit(2) | |
.mapToObj(bonJovi::get) | |
.collect(Collectors.joining()); | |
johnBonJovi = johnBonJovi + twoWords; | |
count++; | |
} | |
System.out.println(johnBonJovi); | |
System.out.println(count + " Bon Jovis"); | |
System.out.println("\n" + | |
" _人人人人人人人人人人人人人人_\n" + | |
" > You Give Love a Bad Name <\n" + | |
"  ̄Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y^Y ̄"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment