Skip to content

Commit 6c7a061

Browse files
committed
Add basic implementation
1 parent 1099ae5 commit 6c7a061

File tree

8 files changed

+218
-0
lines changed

8 files changed

+218
-0
lines changed

kadai3-1/lfcd85/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
bin/*

kadai3-1/lfcd85/Makefile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
build: cmd/*.go typinggame/*.go
2+
GO111MODULE=on go build -o bin/typinggame cmd/main.go
3+
4+
fmt:
5+
go fmt ./...
6+
go vet ./...
7+
8+
check:
9+
GO111MODULE=on go test ./... -v
10+
11+
coverage:
12+
GO111MODULE=on go test ./... -cover

kadai3-1/lfcd85/bin/.gitkeep

Whitespace-only changes.

kadai3-1/lfcd85/cmd/main.go

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
package main
2+
3+
import (
4+
"fmt"
5+
6+
"github.com/gopherdojo/dojo5/kadai3-1/lfcd85/typinggame"
7+
)
8+
9+
func main() {
10+
// create words from input file (abstracted by io.Reader if possible)
11+
12+
// start time counting by time.After or context.WithTimeout
13+
14+
// output word to stdout
15+
// get one line from stdin
16+
// judge whether two words are the same
17+
// if so, add count of correct answers
18+
19+
// when time limit has come, show the count of correct answers
20+
21+
if err := typinggame.Execute(); err != nil {
22+
fmt.Println("error:", err)
23+
return
24+
}
25+
}

kadai3-1/lfcd85/go.mod

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module github.com/gopherdojo/dojo5/kadai3-1/lfcd85
2+
3+
go 1.12
Lines changed: 154 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,154 @@
1+
archive
2+
archive/tar
3+
archive/zip
4+
bufio
5+
builtin
6+
bytes
7+
compress
8+
compress/bzip2
9+
compress/flate
10+
compress/gzip
11+
compress/lzw
12+
compress/zlib
13+
container
14+
container/heap
15+
container/list
16+
container/ring
17+
context
18+
crypto
19+
crypto/aes
20+
crypto/cipher
21+
crypto/des
22+
crypto/dsa
23+
crypto/ecdsa
24+
crypto/elliptic
25+
crypto/hmac
26+
crypto/md5
27+
crypto/rand
28+
crypto/rc4
29+
crypto/rsa
30+
crypto/sha1
31+
crypto/sha256
32+
crypto/sha512
33+
crypto/subtle
34+
crypto/tls
35+
crypto/x509
36+
crypto/x509/pkix
37+
database
38+
database/sql
39+
database/sql/driver
40+
debug
41+
debug/dwarf
42+
debug/elf
43+
debug/gosym
44+
debug/macho
45+
debug/pe
46+
debug/plan9obj
47+
encoding
48+
encoding/ascii85
49+
encoding/asn1
50+
encoding/base32
51+
encoding/base64
52+
encoding/binary
53+
encoding/csv
54+
encoding/gob
55+
encoding/hex
56+
encoding/json
57+
encoding/pem
58+
encoding/xml
59+
errors
60+
expvar
61+
flag
62+
fmt
63+
go
64+
go/ast
65+
go/build
66+
go/constant
67+
go/doc
68+
go/format
69+
go/importer
70+
go/parser
71+
go/printer
72+
go/scanner
73+
go/token
74+
go/types
75+
hash
76+
hash/adler32
77+
hash/crc32
78+
hash/crc64
79+
hash/fnv
80+
html
81+
html/template
82+
image
83+
image/color
84+
image/color/palette
85+
image/draw
86+
image/gif
87+
image/jpeg
88+
image/png
89+
index
90+
index/suffixarray
91+
io
92+
io/ioutil
93+
log
94+
log/syslog
95+
math
96+
math/big
97+
math/bits
98+
math/cmplx
99+
math/rand
100+
mime
101+
mime/multipart
102+
mime/quotedprintable
103+
net
104+
net/http
105+
net/http/cgi
106+
net/http/cookiejar
107+
net/http/fcgi
108+
net/http/httptest
109+
net/http/httptrace
110+
net/http/httputil
111+
net/http/pprof
112+
net/mail
113+
net/rpc
114+
net/rpc/jsonrpc
115+
net/smtp
116+
net/textproto
117+
net/url
118+
os
119+
os/exec
120+
os/signal
121+
os/user
122+
path
123+
path/filepath
124+
plugin
125+
reflect
126+
regexp
127+
regexp/syntax
128+
runtime
129+
runtime/cgo
130+
runtime/debug
131+
runtime/msan
132+
runtime/pprof
133+
runtime/race
134+
runtime/trace
135+
sort
136+
strconv
137+
strings
138+
sync
139+
sync/atomic
140+
syscall
141+
syscall/js
142+
testing
143+
testing/iotest
144+
testing/quick
145+
text
146+
text/scanner
147+
text/tabwriter
148+
text/template
149+
text/template/parse
150+
time
151+
unicode
152+
unicode/utf16
153+
unicode/utf8
154+
unsafe
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
package typinggame
2+
3+
import (
4+
"fmt"
5+
)
6+
7+
func Execute() error {
8+
fmt.Println("hello, typing game")
9+
return nil
10+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package typinggame_test
2+
3+
import (
4+
"testing"
5+
6+
"github.com/gopherdojo/dojo5/kadai3-1/lfcd85/typinggame"
7+
)
8+
9+
func TestExecute(t *testing.T) {
10+
if err := typinggame.Execute(); err != nil {
11+
t.Errorf("error: %v", err)
12+
}
13+
}

0 commit comments

Comments
 (0)