Skip to content

Commit bfc9cce

Browse files
author
Brandon Sprague
committed
Random updates for pretty much no reason
Just trying to get things compiling again
1 parent d00db8a commit bfc9cce

File tree

28 files changed

+4417
-3132
lines changed

28 files changed

+4417
-3132
lines changed

boardgen/boardgen.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package boardgen
33
import (
44
"math/rand"
55

6-
codenames "github.com/bcspragu/Codenames"
6+
"github.com/bcspragu/Codenames/codenames"
77
)
88

99
var baseAgents = []codenames.Agent{

cmd/boardgen-cli/boardgen-cli

26.1 KB
Binary file not shown.

cmd/boardgen-cli/main.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ import (
66
"math/rand"
77
"time"
88

9-
codenames "github.com/bcspragu/Codenames"
109
"github.com/bcspragu/Codenames/boardgen"
10+
"github.com/bcspragu/Codenames/codenames"
1111
)
1212

1313
var (

cmd/codenames-local/main.go

+19-10
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88
"os"
99
"strings"
1010

11-
codenames "github.com/bcspragu/Codenames"
11+
"github.com/bcspragu/Codenames/codenames"
1212
"github.com/bcspragu/Codenames/game"
1313
"github.com/bcspragu/Codenames/io"
1414
"github.com/bcspragu/Codenames/w2v"
@@ -33,6 +33,7 @@ func main() {
3333
wordList = flag.String("words", "", "Comma-separated list of words and the agent they're assigned to. Ex dog:red,wallet:blue,bowl:assassin,glass:blue,hood:bystander")
3434
starter = flag.String("starter", "red", "Which color team starts the game")
3535
team = flag.String("team", "red", "Team to be")
36+
useAI = flag.Bool("use_ai", false, "Whether or not the starting team should be an AI.")
3637
)
3738
flag.Parse()
3839

@@ -49,10 +50,16 @@ func main() {
4950
log.Fatalf("Expected %d words, got %d words", codenames.Size, len(words))
5051
}
5152

52-
// Initialize our word2vec model.
53-
ai, err := w2v.New(*modelFile)
54-
if err != nil {
55-
log.Fatalf("Failed to initialize word2vec model: %v", err)
53+
var (
54+
ai *w2v.AI
55+
err error
56+
)
57+
if *useAI {
58+
// Initialize our word2vec model.
59+
ai, err = w2v.New(*modelFile)
60+
if err != nil {
61+
log.Fatalf("Failed to initialize word2vec model: %v", err)
62+
}
5663
}
5764

5865
var (
@@ -62,11 +69,13 @@ func main() {
6269
bop codenames.Operative = &io.Operative{In: os.Stdin, Out: os.Stdout, Team: codenames.BlueTeam}
6370
)
6471

65-
switch teamMap[*starter] {
66-
case codenames.RedTeam:
67-
rsm = ai
68-
case codenames.BlueTeam:
69-
bsm = ai
72+
if *useAI {
73+
switch teamMap[*starter] {
74+
case codenames.RedTeam:
75+
rsm = ai
76+
case codenames.BlueTeam:
77+
bsm = ai
78+
}
7079
}
7180

7281
cards := make([]codenames.Card, len(words))

cmd/codenames-local/run.sh

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#!/bin/bash
22
cd ../boardgen-cli
3-
CC=gcc vgo build
3+
go build -o boardgen-cli
44
cd ../codenames-local
5-
CC=gcc vgo build
6-
./codenames-local --model_file=../../data/everything.bin --words="$(../boardgen-cli/boardgen-cli)"
7-
5+
go build -o codenames-local
6+
./codenames-local --model_file=../../data/everything.bin --words="$(../boardgen-cli/boardgen-cli)" --use_ai=true

cmd/w2v-topn/main.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99
"strings"
1010

1111
"code.sajari.com/word2vec"
12-
w2v "github.com/bcspragu/Codenames/w2v"
12+
"github.com/bcspragu/Codenames/w2v"
1313
)
1414

1515
func main() {
File renamed without changes.

db.go codenames/db.go

File renamed without changes.

words.go codenames/words.go

File renamed without changes.

game/game.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import (
55
"log"
66
"strings"
77

8-
codenames "github.com/bcspragu/Codenames"
8+
"github.com/bcspragu/Codenames/codenames"
99
)
1010

1111
// Game represents a game of codenames.

go.mod

+6-18
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,12 @@
11
module github.com/bcspragu/Codenames
22

3+
go 1.13
4+
35
require (
4-
cloud.google.com/go v0.26.0
56
code.sajari.com/word2vec v1.0.0
6-
contrib.go.opencensus.io/exporter/stackdriver v0.6.0 // indirect
7-
github.com/golang/protobuf v1.2.0 // indirect
8-
github.com/google/go-cmp v0.2.0
9-
github.com/googleapis/gax-go v2.0.0+incompatible // indirect
10-
github.com/gorilla/mux v1.6.2
7+
github.com/google/go-cmp v0.4.0
8+
github.com/gorilla/mux v1.7.3
119
github.com/gorilla/securecookie v1.1.1
12-
github.com/gorilla/websocket v1.3.0
13-
github.com/mattn/go-sqlite3 v1.9.0
14-
github.com/namsral/flag v1.7.4-pre
15-
github.com/ziutek/blas v0.0.0-20131112123631-58548894c23b // indirect
16-
go.opencensus.io v0.15.0 // indirect
17-
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d
18-
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be // indirect
19-
golang.org/x/sys v0.0.0-20180828065106-d99a578cf41b // indirect
20-
golang.org/x/text v0.3.0 // indirect
21-
google.golang.org/api v0.0.0-20180829000535-087779f1d2c9
22-
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8
23-
google.golang.org/grpc v1.14.0 // indirect
10+
github.com/gorilla/websocket v1.4.1
11+
github.com/ziutek/blas v0.0.0-20190227122918-da4ca23e90bb // indirect
2412
)

go.sum

+10-36
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,14 @@
1-
cloud.google.com/go v0.26.0 h1:e0WKqKTd5BnrG8aKH3J3h+QvEIQtSUcf2n5UZ5ZgLtQ=
2-
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
31
code.sajari.com/word2vec v1.0.0 h1:gg1Bk3ea3mGPZMS2/qh1iPJM5iotSSHyIxq4gUdlH+0=
42
code.sajari.com/word2vec v1.0.0/go.mod h1:Ut8mx+2Q79Js3uGW1+HtbuuUIWoGMAMCOZK06xDly00=
5-
contrib.go.opencensus.io/exporter/stackdriver v0.6.0 h1:U0FQWsZU3aO8W+BrZc88T8fdd24qe3Phawa9V9oaVUE=
6-
contrib.go.opencensus.io/exporter/stackdriver v0.6.0/go.mod h1:QeFzMJDAw8TXt5+aRaSuE8l5BwaMIOIlaVkBOPRuMuw=
7-
github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM=
8-
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
9-
github.com/google/go-cmp v0.2.0 h1:+dTQ8DZQJz0Mb/HjFlkptS1FeQ4cWSnN941F8aEG4SQ=
10-
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
11-
github.com/googleapis/gax-go v2.0.0+incompatible h1:j0GKcs05QVmm7yesiZq2+9cxHkNK9YM6zKx4D2qucQU=
12-
github.com/googleapis/gax-go v2.0.0+incompatible/go.mod h1:SFVmujtThgffbyetf+mdk2eWhX2bMyUtNHzFKcPA9HY=
13-
github.com/gorilla/mux v1.6.2 h1:Pgr17XVTNXAk3q/r4CpKzC5xBM/qW1uVLV+IhRZpIIk=
14-
github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs=
3+
github.com/google/go-cmp v0.4.0 h1:xsAVV57WRhGj6kEIi8ReJzQlHHqcBYCElAvkovg3B/4=
4+
github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
5+
github.com/gorilla/mux v1.7.3 h1:gnP5JzjVOuiZD07fKKToCAOjS0yOpj/qPETTXCCS6hw=
6+
github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs=
157
github.com/gorilla/securecookie v1.1.1 h1:miw7JPhV+b/lAHSXz4qd/nN9jRiAFV5FwjeKyCS8BvQ=
168
github.com/gorilla/securecookie v1.1.1/go.mod h1:ra0sb63/xPlUeL+yeDciTfxMRAA+MP+HVt/4epWDjd4=
17-
github.com/gorilla/websocket v1.3.0 h1:r/LXc0VJIMd0rCMsc6DxgczaQtoCwCLatnfXmSYcXx8=
18-
github.com/gorilla/websocket v1.3.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ=
19-
github.com/mattn/go-sqlite3 v1.9.0 h1:pDRiWfl+++eC2FEFRy6jXmQlvp4Yh3z1MJKg4UeYM/4=
20-
github.com/mattn/go-sqlite3 v1.9.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc=
21-
github.com/namsral/flag v1.7.4-pre h1:b2ScHhoCUkbsq0d2C15Mv+VU8bl8hAXV8arnWiOHNZs=
22-
github.com/namsral/flag v1.7.4-pre/go.mod h1:OXldTctbM6SWH1K899kPZcf65KxJiD7MsceFUpB5yDo=
23-
github.com/ziutek/blas v0.0.0-20131112123631-58548894c23b h1:/UUwUD/l+89cShEHvtL3k5ZkVj/Ugabk+NFCp+R+8y0=
24-
github.com/ziutek/blas v0.0.0-20131112123631-58548894c23b/go.mod h1:J3xKssoVdrwZ2E29fIox/EKxOZWimS7AZ4fOTCFkOLo=
25-
go.opencensus.io v0.15.0 h1:r1SzcjSm4ybA0qZs3B4QYX072f8gK61Kh0qtwyFpfdk=
26-
go.opencensus.io v0.15.0/go.mod h1:UffZAU+4sDEINUGP/B7UfBBkq4fqLu9zXAX7ke6CHW0=
27-
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d h1:g9qWBGx4puODJTMVyoPrpoxPFgVGd+z1DZwjfRu4d0I=
28-
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
29-
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be h1:vEDujvNQGv4jgYKudGeI/+DAX4Jffq6hpD55MmoEvKs=
30-
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
31-
golang.org/x/sys v0.0.0-20180828065106-d99a578cf41b h1:cmOZLU2i7CLArKNViO+ZCQ47wqYFyKEIpbGWp+b6Uoc=
32-
golang.org/x/sys v0.0.0-20180828065106-d99a578cf41b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
33-
golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg=
34-
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
35-
google.golang.org/api v0.0.0-20180829000535-087779f1d2c9 h1:z1TeLUmxf9ws9KLICfmX+KGXTs+rjm+aGWzfsv7MZ9w=
36-
google.golang.org/api v0.0.0-20180829000535-087779f1d2c9/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0=
37-
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8 h1:Nw54tB0rB7hY/N0NQvRW8DG4Yk3Q6T9cu9RcFQDu1tc=
38-
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
39-
google.golang.org/grpc v1.14.0 h1:ArxJuB1NWfPY6r9Gp9gqwplT0Ge7nqv9msgu03lHLmo=
40-
google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw=
9+
github.com/gorilla/websocket v1.4.1 h1:q7AeDBpnBk8AogcD4DSag/Ukw/KV+YhzLj2bP5HvKCM=
10+
github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
11+
github.com/ziutek/blas v0.0.0-20190227122918-da4ca23e90bb h1:uWiILQloLUVdtPYr1ZZo2zqtlpzo4G8vUpglo/Fs2H8=
12+
github.com/ziutek/blas v0.0.0-20190227122918-da4ca23e90bb/go.mod h1:J3xKssoVdrwZ2E29fIox/EKxOZWimS7AZ4fOTCFkOLo=
13+
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=
14+
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=

hub/conn.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package hub
33
import (
44
"time"
55

6-
codenames "github.com/bcspragu/Codenames"
6+
"github.com/bcspragu/Codenames/codenames"
77

88
"github.com/gorilla/websocket"
99
)

hub/hub.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"fmt"
55
"math/rand"
66

7-
codenames "github.com/bcspragu/Codenames"
7+
"github.com/bcspragu/Codenames/codenames"
88
"github.com/gorilla/websocket"
99
)
1010

io/io.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import (
55
"fmt"
66
"io"
77

8-
codenames "github.com/bcspragu/Codenames"
8+
"github.com/bcspragu/Codenames/codenames"
99
)
1010

1111
// Spymaster asks the user on the terminal to enter a clue. It assumes they

sqldb/sqldb.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88
"math/rand"
99
"os"
1010

11-
codenames "github.com/bcspragu/Codenames"
11+
"github.com/bcspragu/Codenames/codenames"
1212

1313
_ "github.com/mattn/go-sqlite3"
1414
)

vision/vision.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88
"io"
99
"sort"
1010

11-
codenames "github.com/bcspragu/Codenames"
11+
"github.com/bcspragu/Codenames/codenames"
1212
"github.com/bcspragu/Codenames/dict"
1313
"golang.org/x/net/context"
1414
"google.golang.org/api/option"

w2v/w2v.go

+4-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77
"sort"
88
"strings"
99

10-
codenames "github.com/bcspragu/Codenames"
10+
"github.com/bcspragu/Codenames/codenames"
1111

1212
"code.sajari.com/word2vec"
1313
)
@@ -54,6 +54,9 @@ func (ai *AI) GiveClue(b *codenames.Board) (*codenames.Clue, error) {
5454
}
5555
}
5656

57+
// TODO: Confirm that the clue chosen isn't a superset of any of the words on
58+
// the board (ex. 'band' and 'bands').
59+
5760
return &codenames.Clue{Word: clue, Count: 1}, nil
5861
}
5962

web/frontend/build-node-env.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
#!/bin/bash
2-
docker build -t node-env .
2+
docker build -t node-env-codenames .

web/frontend/package.json

-3
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
},
1010
"dependencies": {
1111
"axios": "^0.18.0",
12-
"buefy": "^0.6.6",
1312
"register-service-worker": "^1.0.0",
1413
"vue": "^2.5.17",
1514
"vue-axios": "^2.1.3",
@@ -22,8 +21,6 @@
2221
"@vue/cli-plugin-pwa": "^3.0.1",
2322
"@vue/cli-plugin-typescript": "^3.0.1",
2423
"@vue/cli-service": "^3.0.1",
25-
"node-sass": "^4.9.0",
26-
"sass-loader": "^7.0.1",
2724
"typescript": "^3.0.0",
2825
"vue-template-compiler": "^2.5.17"
2926
},

web/frontend/src/App.vue

-6
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@ export default class App extends Vue {
2828
</script>
2929

3030
<style lang="scss">
31-
// Import Bulma's core
32-
@import "~bulma/sass/utilities/_all";
3331
3432
// Custom styles go here
3533
html, body, #app {
@@ -38,8 +36,4 @@ html, body, #app {
3836
width: 100%;
3937
height: 100%;
4038
}
41-
42-
// Import Bulma and Buefy styles
43-
@import "~bulma";
44-
@import "~buefy/src/scss/buefy";
4539
</style>

web/frontend/src/components/Board.vue

+22-25
Original file line numberDiff line numberDiff line change
@@ -44,40 +44,37 @@ export default class Board extends Vue {
4444
}
4545
</script>
4646

47-
<style scoped lang="scss">
47+
<style scoped lang="css">
4848
4949
.row.columns {
5050
margin-bottom: 0.6rem;
5151
}
5252
53-
.cell {
54-
>.body {
55-
margin-left: 0.3rem;
56-
margin-right: 0.3rem;
57-
min-height: 3rem;
53+
.cell > .body {
54+
margin-left: 0.3rem;
55+
margin-right: 0.3rem;
56+
min-height: 3rem;
5857
59-
text-overflow: ellipsis;
60-
whitespace: nowrap;
61-
overflow: hidden;
58+
text-overflow: ellipsis;
59+
whitespace: nowrap;
60+
overflow: hidden;
6261
63-
font-weight: bold;
64-
display: flex;
65-
justify-content: center;
66-
align-items: center;
67-
border-radius: 0.25rem;
68-
69-
&.red {
70-
background-color: rgba(255, 0, 0, 0.3);
71-
}
62+
font-weight: bold;
63+
display: flex;
64+
justify-content: center;
65+
align-items: center;
66+
border-radius: 0.25rem;
67+
}
7268
73-
&.blue {
74-
background-color: rgba(0, 0, 255, 0.3);
75-
}
69+
.cell > .body.red {
70+
background-color: rgba(255, 0, 0, 0.3);
71+
}
7672
77-
&.grey {
78-
background-color: rgba(0, 0, 0, 0.3);
79-
}
80-
}
73+
.cell > .body.blue {
74+
background-color: rgba(0, 0, 255, 0.3);
8175
}
8276
77+
.cell > .body.grey {
78+
background-color: rgba(0, 0, 0, 0.3);
79+
}
8380
</style>

web/frontend/src/views/Game.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ import { Component, Vue } from 'vue-property-decorator';
88
export default class Game extends Vue {}
99
</script>
1010

11-
<style scoped lang="scss">
11+
<style scoped lang="css">
1212
</style>

web/frontend/src/views/Home.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export default class Home extends Vue {
4242
}
4343
</script>
4444

45-
<style scoped lang="scss">
45+
<style scoped lang="css">
4646
.container {
4747
height: 100%;
4848
display: flex;

web/frontend/src/views/Login.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export default class Login extends Vue {
4242
}
4343
</script>
4444

45-
<style scoped lang="scss">
45+
<style scoped lang="css">
4646
.container {
4747
height: 100%;
4848
display: flex;

0 commit comments

Comments
 (0)