This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package mapgen | |
type PerlinNoisePRNG struct { | |
seed, octaves int | |
persistence, frequency, amplitude float64 | |
} | |
func (prng *PerlinNoisePRNG) NoiseAt(x, y float64) float64 { | |
n := int(y) * 47 + int(x) + prng.seed | |
n = (n << 13) ^ n |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package doomed | |
import("testing"; "fmt") | |
func TestNewBoard(t *testing.T) { | |
b := NewBoard(17, 17) | |
if len(b.grid) != 17 { t.Errorf("Board size is wrong!") } | |
} | |
func TestGenerator(t *testing.T) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package doomed | |
import ("math/rand"; "fmt") | |
// UGH WHY AM I DOING IT LIKE THIS | |
const ( | |
Unused = -1 | |
NotGenerated = 0 | |
Mountain = 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import( "fmt"; "time" ) | |
// type Board | |
// The game board | |
type Board struct { | |
tiles [][]int | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
seven@broodmother :: ~/Workspaces/pegex-cdent ‹master*› % make test 2 ↵ | |
mkdir -p lib/Pegex | |
mkdir -p lib/Pegex/Parser | |
mkdir -p lib/Pegex/Pegex | |
mkdir -p lib/Pegex/Grammar | |
coffee --compile -p src/Pegex/Parser/Indent.coffee > lib/Pegex/Parser/Indent.js | |
coffee --compile -p src/Pegex/Parser.coffee > lib/Pegex/Parser.js | |
coffee --compile -p src/Pegex/Pegex/AST.coffee > lib/Pegex/Pegex/AST.js | |
coffee --compile -p src/Pegex/Pegex/Grammar.coffee > lib/Pegex/Pegex/Grammar.js | |
coffee --compile -p src/Pegex/Compiler.coffee > lib/Pegex/Compiler.js |
NewerOlder