LoginSignup
15
15

More than 5 years have passed since last update.

golang の進捗どうですか

Last updated at Posted at 2015-07-16

「進捗・どう・です・か」をランダムに表示し「進捗どうですか」が完成したら煽ってくるClojure
「進捗・どう・です・か」をランダムに表示し「進捗どうですか」が完成したら煽ってくるプログラム
「進捗・どう・です・か」をHaskellで書いてみた

乗るしかない!このビッグウェーブに!!1

shinchoku-doudesuka

package main

import (
    "fmt"
    "math/rand"
    "time"
)

type word int

const (
    進捗 word = iota
    どう
    です
    
)

func main() {
    rand.Seed(time.Now().UnixNano())
    n := 0
    var w word
    for {
        n++
        s := word(rand.Intn(4))
        fmt.Print(s)
        if w != s {
            if s == 0 {
                w = 1
            } else {
                w = 0
            }
        } else {
            w++
            if w == 4 {
                break
            }
        }
    }
    fmt.Println(`
 _人人人人人人人_
 >進捗どうですか<
  ̄Y^Y^Y^Y^Y^Y^Y ̄`)
    fmt.Printf("%d回で煽られました\n", n)
}
$ go get github.com/mattn/shinchoku-doudesuka
$ shinchoku-doudesuka
ですか進捗どうか進捗どう進捗進捗ですどうですですかかどうですどうどうかですかですどう進捗進捗進捗どうかどうどうどうですですですどうどうかですですかですかです進捗どうですですか進捗かかですどうどうですですどうか進捗ですですか進捗かかどう進捗ですどうどうです進捗進捗進捗ですですどう進捗かかかですですです進捗ですですどう進捗ですですどうですどうですです進捗ですかですかかどうですかかですですですですかですかかかかどうですですどうかです進捗どうですですか進捗進捗かどう進捗ですです進捗進捗どう進捗です進捗かです進捗かですですか進捗どうかかかですか進捗進捗ですかかかですかどうどうです進捗どうどう進捗か進捗かですですですどう進捗どうかです進捗進捗ですですかです進捗かどうか進捗です進捗進捗ですどう進捗か進捗どうどうですどうかかか進捗ですかどう進捗かかどう進捗か進捗かですかかかどうです進捗どうか進捗どう進捗ですですどうどうかかどう進捗進捗ですです進捗どうかどうどうです進捗進捗進捗どう進捗進捗かどう進捗ですかですどうどうどうどうどう進捗ですどうどう進捗かどうかですどうかです進捗どう進捗どうですか
 _人人人人人人人_
 >進捗どうですか<
  ̄Y^Y^Y^Y^Y^Y^Y ̄
283回で煽られました
15
15
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
15
15