Skip to content

Kadai3 1 sminamot - #42

Open
sminamot wants to merge 2 commits into
gopherdojo:masterfrom
sminamot:kadai3-1-sminamot
Open

Kadai3 1 sminamot#42
sminamot wants to merge 2 commits into
gopherdojo:masterfrom
sminamot:kadai3-1-sminamot

Conversation

@sminamot

Copy link
Copy Markdown

タイピングゲームを作ろう

  • 標準出力に英単語を出す(出すものは自由)
  • 標準入力から1行受け取る
  • 制限時間内に何問解けたか表示する

@mizkei mizkei left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

コメントしましたので、参考にしていただければと思います

Comment thread kadai3-1/sminamot/main.go
return ch
}

func limit(d time.Duration) <-chan struct{} {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

time.After を直接利用するだけでも十分かと思いました

Comment thread kadai3-1/sminamot/main.go
tCh := limit(10 * time.Second)
iCh := input(os.Stdin)
rand.Seed(time.Now().UnixNano())
aNum := 0

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

zero valueがそのまま利用できるようであれば、 var aNum, qNum int などで宣言しても良いと思います

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants