update imports for golang.org/x/
This commit is contained in:
parent
459a69991d
commit
5b6938b927
3
main.go
3
main.go
@ -1,11 +1,12 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"code.google.com/p/go.net/websocket"
|
|
||||||
"flag"
|
"flag"
|
||||||
"fmt"
|
"fmt"
|
||||||
"log"
|
"log"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
|
"golang.org/x/net/websocket"
|
||||||
)
|
)
|
||||||
|
|
||||||
var addr = flag.String("addr", ":8666", "http service address")
|
var addr = flag.String("addr", ":8666", "http service address")
|
||||||
|
@ -1,11 +1,12 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"code.google.com/p/go.net/websocket"
|
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
"log"
|
"log"
|
||||||
"math"
|
"math"
|
||||||
|
|
||||||
|
"golang.org/x/net/websocket"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Position struct {
|
type Position struct {
|
||||||
@ -21,10 +22,10 @@ type player struct {
|
|||||||
|
|
||||||
func (p *player) validMove(next Position) (r bool) {
|
func (p *player) validMove(next Position) (r bool) {
|
||||||
r = true
|
r = true
|
||||||
if math.Abs(float64(p.Position.X - next.X)) > 1 {
|
if math.Abs(float64(p.Position.X-next.X)) > 1 {
|
||||||
r = false
|
r = false
|
||||||
}
|
}
|
||||||
if math.Abs(float64(p.Position.Y - next.Y)) > 1 {
|
if math.Abs(float64(p.Position.Y-next.Y)) > 1 {
|
||||||
r = false
|
r = false
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
|
Loading…
Reference in New Issue
Block a user