Created
March 17, 2016 08:03
-
-
Save teruteru128/ad3cadd65d68ad845e2e to your computer and use it in GitHub Desktop.
ズンドコキヨシ with Java ref: http://qiita.com/teruteru128/items/9149a404d7a36a09cd8e
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.Random; | |
public class Zundoko { | |
public static void main(String[] args) { | |
String[] zundoko={"ズン","ドコ"}; | |
int z=31; | |
Random r=new Random(); | |
while(true){ | |
z|=r.nextInt(2); | |
System.out.println(zundoko[z&1]); | |
if((z&=31)==1){ | |
System.out.println("キ・ヨ・シ!"); | |
break; | |
} | |
z<<=1; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment