Documentation
¶
Index ¶
- Constants
- Variables
- func ConvertToRGBA(colorToConvert color.Color) color.RGBA
- func GetColorDifference(color1 color.RGBA, color2 color.RGBA) float64
- func RandomDivisibleBy(min int, max int, divisibleBy int) int
- func RandomRGBA(colors ...string) color.RGBA
- func RandomWithin(min int, max int) int
- func Squared(number float64) float64
- type Cell
- type Grid
- func (grid *Grid) Draw(screen *ebiten.Image)
- func (grid *Grid) DrawGlider(glider Spaceship, startingX int, startingY int, color color.RGBA) *Grid
- func (grid *Grid) GetNeighborhoodDiversity(cellX int, cellY int) float64
- func (g *Grid) Layout(outsideWidth, outsideHeight int) (int, int)
- func (grid *Grid) Update(screen *ebiten.Image) error
- type Position
- type Spaceship
Constants ¶
View Source
const (
ScreenWidth, ScreenHeight = 600, 600
StartingPopulation = 8000
RateOfGeneration = 5
CellSize = 5
)
Variables ¶
View Source
var Glider = Spaceship{
{0, 0, 0, 0, 0},
{0, 0, 0, 1, 0},
{0, 1, 0, 1, 0},
{0, 0, 1, 1, 0},
{0, 0, 0, 0, 0},
}
Functions ¶
func RandomRGBA ¶
func RandomWithin ¶
Types ¶
type Grid ¶
type Grid struct {
// contains filtered or unexported fields
}
func (*Grid) DrawGlider ¶
func (*Grid) GetNeighborhoodDiversity ¶
TODO: Need to thoroughly test GetNeighborhoodDiversity
Click to show internal directories.
Click to hide internal directories.