CoffeeScript や TypeScript があるから、
誰かが作ってくれるだろうといつまでも待っているのに・・・
誰も作ってくれないから、ズンドコDartでキヨシってみる。
zundoko.dart
#!/usr/local/bin/dart
import "dart:math";
import "dart:io";
main() {
String zzzzdoko = "ズンズンズンズンドコ";
List<String> target = new List<String>();
Random ran = new Random(new DateTime.now().microsecondsSinceEpoch);
while(zzzzdoko != target.join()) {
sleep(new Duration(seconds:1));
target.add("${["ズン","ドコ"][ran.nextInt(2)]}");
if (target.length > 5) target.removeAt(0);
print("${target[target.length - 1]}");
}
print("キ・ヨ・シ!");
}
Dartもっと流行ってくれればいいのになぁ
楽しいのにぃ
DartPadに打ち込んでみた。
どうもDartのバージョンが古いのと、dart:ioライブラリをサポートしてくれていないらしいのとで、
少しだけ改変しておいた。
https://dartpad.dartlang.org/403357f5cd50a1ea8f09