Permalink
Browse files

cmd/tictactoe: Rearrange declarations.

Put higher level identifiers on top. This way, context for lower level
primitives is established before they're defined with full
implementation details.
  • Loading branch information...
dmitshur committed Oct 10, 2017
1 parent 7e44bdf commit ea37f12c648c82e86fa3dcf8c848b5dd4658d6cc
Showing with 13 additions and 13 deletions.
  1. +13 −13 cmd/tictactoe/main.go
View
@@ -18,9 +18,16 @@ import (
playero "github.com/shurcooL/tictactoe/player/random"
)
type player struct {
ttt.Player
Mark ttt.State // Mark is either X or O.
func main() {
switch runtime.GOARCH {
default:
run()
case "js":
var document = dom.GetWindow().Document().(dom.HTMLDocument)
document.AddEventListener("DOMContentLoaded", false, func(dom.Event) {
go run()
})
}
}
func run() {
@@ -64,14 +71,7 @@ func run() {
}
}
func main() {
switch runtime.GOARCH {
default:
run()
case "js":
var document = dom.GetWindow().Document().(dom.HTMLDocument)
document.AddEventListener("DOMContentLoaded", false, func(dom.Event) {
go run()
})
}
type player struct {
ttt.Player
Mark ttt.State // Mark is either X or O.
}

0 comments on commit ea37f12

Please sign in to comment.