Skip to content

Commit

Permalink
Merge pull request #116 from ForeverZer0/go-implementation
Browse files Browse the repository at this point in the history
Added Go implementation
  • Loading branch information
Auburn authored Sep 30, 2023
2 parents 95900f7 + f6a9e03 commit 7aefb5a
Show file tree
Hide file tree
Showing 3 changed files with 2,489 additions and 0 deletions.
23 changes: 23 additions & 0 deletions Go/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
## Getting Started

Here's an example for creating a 128x128 array of Perlin noise

```go
import "fastnoise"

// Create and configure noise state (either float32 or float64)
noise := fastnoise.New[float32]()
noise.NoiseType(fastnoise.Perlin)

// Gather noise data
const size = 128
data := make([]float32, size * size)

for i := 0; i < len(data); i++ {
x := i % size
y := i / size
data[i] = noise.Noise2D(x, y)
}

// Use noise data (all values are in range of -1.0 and 1.0)
```
Loading

0 comments on commit 7aefb5a

Please sign in to comment.