LoginSignup
2
2

More than 5 years have passed since last update.

ズンドコキヨシ with D

Last updated at Posted at 2016-03-13

元ネタを読んで一番最初に思いついたやり方です。

main.d
import std.stdio;
import std.random;

void main(){
    string[] words = ["ズン","ドコ"];
    int[] history = [];
    while(true){
        history ~= dice(1,1);
        words[history[$-1]].write();
        if (5 <= history.length) {
            if (history[$-5 .. $] == [0,0,0,0,1]){
                "キ・ヨ・シ!".writeln();
                return;
            }
        }
    }
}
2
2
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2