mirror of
https://codeberg.org/scip/golsky.git
synced 2025-12-16 12:10:58 +01:00
branchless experiments (failed and reverted, see commented code)
This commit is contained in:
@@ -133,9 +133,13 @@ func (scene *ScenePlay) UpdateCells() {
|
||||
// set history to current generation so we can infer the
|
||||
// age of the cell's state during rendering and use it to
|
||||
// deduce the color to use if evolution tracing is enabled
|
||||
// 60FPS:
|
||||
if state != nextstate {
|
||||
scene.History.Data[y][x] = scene.Generations
|
||||
}
|
||||
|
||||
// 10FPS:
|
||||
//scene.History.Data[y][x] = (state ^ (1 ^ nextstate)) * (scene.Generations - scene.History.Data[y][x])
|
||||
}
|
||||
}
|
||||
|
||||
@@ -446,7 +450,8 @@ func (scene *ScenePlay) Draw(screen *ebiten.Image) {
|
||||
float64(y*scene.Config.Cellsize),
|
||||
)
|
||||
|
||||
age = scene.Generations - scene.History.Data[y][x]
|
||||
//age = scene.Generations - scene.History.Data[y][x]
|
||||
age = scene.History.Data[y][x]
|
||||
|
||||
switch scene.Grids[scene.Index].Data[y][x] {
|
||||
case Alive:
|
||||
|
||||
@@ -252,6 +252,17 @@ func main() {
|
||||
ym := y & (c - 1)
|
||||
|
||||
fmt.Println(xm & ym)
|
||||
|
||||
a := 1
|
||||
b := 1
|
||||
//gen := 100
|
||||
hist := 0
|
||||
for gen := 0; gen < 50; gen++ {
|
||||
fmt.Println((a ^ (1 ^ b)) * (gen - hist))
|
||||
if gen == 25 {
|
||||
a = 0
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func _main() {
|
||||
|
||||
Reference in New Issue
Block a user