Skip to content

Instantly share code, notes, and snippets.

@syobochim
Last active May 29, 2019 21:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save syobochim/c7f324a227341fdaaee0 to your computer and use it in GitHub Desktop.
Save syobochim/c7f324a227341fdaaee0 to your computer and use it in GitHub Desktop.
ジョンボンジョヴィ
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