LoginSignup
3
2

More than 5 years have passed since last update.

ズンドコキヨシ with Anko

Last updated at Posted at 2016-03-14

golang で書かれたお手製のスクリプト言語 anko でズンドコキヨシやってみました。

zundoko.ank
#!anko
var rand, time = import("math/rand"), import("time")

rand.Seed(time.Now().UnixNano())

zundoko = ["ズン", "ドコ"]
arr = []
for {
  s = zundoko[rand.Int()%2]
  println(s)
  arr = arr + [s]
  if len(arr) > 5 {
    arr = arr[1:len(arr)]
  }
  if arr == ["ズン", "ズン", "ズン", "ズン", "ドコ"] {
    println("キヨシ!")
    break
  }
}

https://github.com/mattn/anko
http://mattn.kaoriya.net/software/anko/20140328210749.htm

3
2
0

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
3
2