versioninfo()
Julia Version 1.2.0 Commit c6da87ff4b (2019-08-20 00:03 UTC) Platform Info: OS: Linux (x86_64-pc-linux-gnu) CPU: Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz WORD_SIZE: 64 LIBM: libopenlibm LLVM: libLLVM-6.0.1 (ORCJIT, skylake)
function zundokochannel()
Channel(ctype=String, csize=32) do channel::Channel{String}
i = 1
while i > 0
zd, i = rand([("ズン", i + 1), ("ドコ", +(i<5))])
put!(channel, zd)
end
put!(channel, "キ・ヨ・シ!")
end
end
zundokochannel (generic function with 1 method)
for cw in zundokochannel()
print(cw)
end
ドコズンドコズンズンズンドコズンズンドコズンドコズンズンズンズンドコキ・ヨ・シ!
collect(zundokochannel())
32-element Array{String,1}: "ズン" "ドコ" "ズン" "ズン" "ズン" "ドコ" "ドコ" "ズン" "ズン" "ズン" "ドコ" "ドコ" "ドコ" ⋮ "ズン" "ズン" "ドコ" "ドコ" "ズン" "ドコ" "ズン" "ズン" "ズン" "ズン" "ドコ" "キ・ヨ・シ!"
function zundokostrictchannel()
Channel(ctype=String, csize=32) do channel::Channel{String}
i = 1
while i > 0
zd, i = rand([("ズン", i + 1), ("ドコ", +(i!=5))])
put!(channel, zd)
end
put!(channel, "キ・ヨ・シ!")
end
end
zundokostrictchannel (generic function with 1 method)
for cw in zundokostrictchannel()
print(cw)
end
ドコズンズンズンドコズンドコドコズンズンドコドコズンズンドコズンズンドコズンズンズンズンズンドコドコズンドコズンズンドコドコドコドコドコドコズンドコドコズンズンドコドコズンズンドコドコドコズンドコドコズンドコドコズンズンドコズンドコドコズンズンズンドコドコドコズンズンドコズンズンズンズンドコキ・ヨ・シ!
collect(zundokostrictchannel())
15-element Array{String,1}: "ドコ" "ドコ" "ドコ" "ドコ" "ズン" "ドコ" "ドコ" "ズン" "ドコ" "ズン" "ズン" "ズン" "ズン" "ドコ" "キ・ヨ・シ!"