Privatizing and such to clean up docs
This commit is contained in:
parent
efeccf62a2
commit
a40ee71b5f
@ -13,8 +13,8 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
DEAD_CELL = "■"
|
||||
LIVE_CELL = " "
|
||||
deadCell = "■"
|
||||
liveCell = " "
|
||||
)
|
||||
|
||||
type GameStateCell struct {
|
||||
@ -164,11 +164,11 @@ func (state *GameState) String() string {
|
||||
for y := 0; y < height; y++ {
|
||||
var cells []string
|
||||
for x := 0; x < width; x++ {
|
||||
stringVal := DEAD_CELL
|
||||
stringVal := deadCell
|
||||
|
||||
cell := state.Get(x, y)
|
||||
if cell.Value == 1 {
|
||||
stringVal = LIVE_CELL
|
||||
stringVal = liveCell
|
||||
}
|
||||
cells = append(cells, stringVal)
|
||||
}
|
||||
|
@ -8,11 +8,11 @@ cat > _tmp.go <<EOWEBASSETSGO
|
||||
package conway
|
||||
|
||||
const (
|
||||
GAME_OF_LIFE_INDEX_HTML = \`
|
||||
gameOfLifeIndexHtml = \`
|
||||
$(cat web_assets/index.html | gzip -9 | base64)\`
|
||||
NORMALIZE_CSS = \`
|
||||
normalizeCss = \`
|
||||
$(curl -s http://necolas.github.com/normalize.css/2.0.1/normalize.css | gzip -9 | base64)\`
|
||||
JQUERY_MIN_JS = \`
|
||||
jqueryMinJs = \`
|
||||
$(curl -s http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js | gzip -9 | base64)\`
|
||||
)
|
||||
EOWEBASSETSGO
|
||||
|
@ -39,20 +39,20 @@ var WebAssets webAssetStrings
|
||||
|
||||
func init() {
|
||||
rand.Seed(time.Now().UTC().UnixNano())
|
||||
idxHt, err := fromGzB64(GAME_OF_LIFE_INDEX_HTML)
|
||||
idxHt, err := fromGzB64(gameOfLifeIndexHtml)
|
||||
if err != nil {
|
||||
log.Fatal("Failed to decode internal index.html: ", err)
|
||||
}
|
||||
|
||||
WebAssets.IndexHTML = idxHt
|
||||
|
||||
normCss, err := fromGzB64(NORMALIZE_CSS)
|
||||
normCss, err := fromGzB64(normalizeCss)
|
||||
if err != nil {
|
||||
log.Fatal("Failed to decode internal normalize.css: ", err)
|
||||
}
|
||||
WebAssets.NormalizeCSS = normCss
|
||||
|
||||
jqmin, err := fromGzB64(JQUERY_MIN_JS)
|
||||
jqmin, err := fromGzB64(jqueryMinJs)
|
||||
if err != nil {
|
||||
log.Fatal("Failed to decode internal jquery.min.js: ", err)
|
||||
}
|
||||
|
@ -1,8 +1,9 @@
|
||||
// WARNING: GENERATED FILE, NERDS! 2012-12-19 00:25:14.785139 -0500 EST
|
||||
package conway
|
||||
|
||||
// WARNING: GENERATED FILE, NERDS! 2012-12-26 10:57:04.843003 -0500 EST
|
||||
|
||||
const (
|
||||
GAME_OF_LIFE_INDEX_HTML = `
|
||||
gameOfLifeIndexHtml = `
|
||||
H4sIAAAJbogC/5RV32/bNhB+719xUwJIxlQpCboBsRW/dMOWYWiDxAO2p4GRzjJdilTJU1ov8P8+
|
||||
Ur8tu0HjB1ni3X3f3cfjMfnhl4/vV//c/QobKsTyTdL8ASQbZJl7sa/ESeDyvZJf2M438BsrENQa
|
||||
/uRrTOLG2DgKLj8B7Uq88Qi/Upwa44FGceMZ2gk0G0TyYKNxfePFhhjxNJZKF0zw/zCqveMWyqSa
|
||||
@ -17,7 +18,7 @@ KIUdhq+AsO2hq0Og7m06sdysnI7RblI9qmw3KtbZ39rxmcs5pCgJ9ZFMZ/2WjeIKpnNuYy6AVaSG
|
||||
yr7wjDZzuLy4eld+XZykEbimY5JJdxxRvSVVzuHqcoxasiyz46gxXY8tj0pnqBuDDQGjBM/g7Pr6
|
||||
emBulXNi1RdW3N1YidOo1TLjT3Vn94n1Qiaby29dadbSOY3jtRLDPjiaisiOA2d2zeAt7+wziZvl
|
||||
036u77zlg31O/ZLYUh3RTlT1Tnj3rxaxrtvmX9/h/wcAAP//rQ2TxtsHAAA=`
|
||||
NORMALIZE_CSS = `
|
||||
normalizeCss = `
|
||||
H4sIAAAJbogC/7xY3Y/bxhF/11+xuSCofRV1OjnXODzkwXVi1KiDFLGLFrga4JJciluRu8zuUjq5
|
||||
zf/emf2gSIon94CT7Qfq9mO+5zcze3X5FRFS1bTin9gi05psV4vl4pr8l/z89gN5xzMmNIO/1tws
|
||||
uLzqzpLLq9ns6pL88GT/ZoSQv3z4+d0NybluKronOSu44IZLoXHz6Vh54WfkkryWSrHMaJKklcw2
|
||||
@ -54,7 +55,7 @@ jB58k3SaaVjJSouxyYnJAtXsUToIlvRmuyDgQ4R8eD6DVrpqsWeKavkpwctFa6B8R5ACsng+YS4n
|
||||
RhwH2d1K5EhHA7D83J2cZVK5Z7+Hjdt7KD2to++MB/VrkKXAHz1in4wie9/Lebxx3DOP4n0Q5+On
|
||||
vzC6EJ0BUlcpVceJOznVulcsGHdCLz8xZo3q66H7pq2RwwAcj1AwK40S9akfuBDz9JlnIFJLDY0P
|
||||
jOvo+VCJjC1zEIJVZyi7Mng4graxoo1mmEDu121/29P0/v1fAAAA//9ByiR32xoAAA==`
|
||||
JQUERY_MIN_JS = `
|
||||
jqueryMinJs = `
|
||||
H4sIAAAJbogC/7y9eXfjRpIv+v87530HEV0jA8UUJZXtudOgULzlWtru9tZdNW27KdoHIkEJLhKg
|
||||
sUgli5zP/uIXkZlIgKBcM/ed2+0SsSRyjYyMPU6fDo5+/XudFPdHt+ej/xh9evTrb7gbzfP10dbc
|
||||
5MX16SqdJ1mZHD09/X//H39ZZ/MqzTM/UVXwYO6OfvGT4OE2Lo6q6JtpMoseduMiqeoiO7odJfH8
|
||||
|
@ -21,13 +21,13 @@ const b64Width = 76
|
||||
|
||||
var (
|
||||
webAssetsTmpl = template.Must(template.New("web_assets").Parse("" +
|
||||
"// WARNING: GENERATED FILE, NERDS! {{.Now}}\n" +
|
||||
"package conway\n" +
|
||||
"// WARNING: GENERATED FILE, NERDS! {{.Now}}\n" +
|
||||
"\n" +
|
||||
"const (\n" +
|
||||
" GAME_OF_LIFE_INDEX_HTML = `{{.IndexHTML}}`\n" +
|
||||
" NORMALIZE_CSS = `{{.NormalizeCSS}}`\n" +
|
||||
" JQUERY_MIN_JS = `{{.JqueryMinJS}}`\n" +
|
||||
" gameOfLifeIndexHtml = `{{.IndexHTML}}`\n" +
|
||||
" normalizeCss = `{{.NormalizeCSS}}`\n" +
|
||||
" jqueryMinJs = `{{.JqueryMinJS}}`\n" +
|
||||
")\n"))
|
||||
normalizeCssUrl = "http://necolas.github.com/normalize.css/2.0.1/normalize.css"
|
||||
jqueryMinJsUrl = "http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"
|
||||
|
Loading…
Reference in New Issue
Block a user