CellularAutomata
Loading...
Searching...
No Matches
states.hpp
1#pragma once
2
3#include "../core/common.hpp"
4
5namespace CellularAutomata
6{
10 namespace States
11 {
20 template <typename T>
21 void normal(T* array, const unsigned int h, const unsigned int w);
22
31 template <typename T>
32 void binary(T* array, const unsigned int h, const unsigned int w);
33
37 namespace Objects
38 {
54 template <typename T>
55 inline void copyInto(
56 T* src, const unsigned int src_h, const unsigned int src_w,
57 T* dst, const unsigned int dst_h, const unsigned int dst_w,
58 const unsigned int y, const unsigned int x);
59
70 template <typename T>
71 void Glider(State<T>* state, const unsigned int x, const unsigned int y);
72
83 template <typename T>
84 void Spaceship(State<T>* state, const unsigned int x, const unsigned int y);
85
96 template <typename T>
97 void Bipole1(State<T>* state, const unsigned int x, const unsigned int y);
98
109 template <typename T>
110 void Bipole2(State<T>* state, const unsigned int x, const unsigned int y);
111
122 template <typename T>
123 void r_Pentomino(State<T>* state, const unsigned int x, const unsigned int y);
124 }
125 }
126
127}
128
129#include "states.inl"
2D buffered matrices
Definition common.hpp:56
void Bipole2(State< T > *state, const unsigned int x, const unsigned int y)
Copies a (alternative) bipole (5x5) into given position (https://conwaylife.com/wiki/Bipole)
Definition states.inl:89
void Bipole1(State< T > *state, const unsigned int x, const unsigned int y)
Copies a bipole (4x4) into given position (https://conwaylife.com/wiki/Bipole)
Definition states.inl:77
void r_Pentomino(State< T > *state, const unsigned int x, const unsigned int y)
Copies a R-pentomino (3x3) into given position (https://conwaylife.com/wiki/R-pentomino)
Definition states.inl:102
void copyInto(T *src, const unsigned int src_h, const unsigned int src_w, T *dst, const unsigned int dst_h, const unsigned int dst_w, const unsigned int y, const unsigned int x)
Copy an (small) array into another (large) array at a given position.
Definition states.inl:37
void Glider(State< T > *state, const unsigned int x, const unsigned int y)
Copies a glider (3x3) into given position (https://conwaylife.com/wiki/Glider)
Definition states.inl:54
void Spaceship(State< T > *state, const unsigned int x, const unsigned int y)
Copies a spaceship (4x5) into given position (https://conwaylife.com/wiki/Spaceship)
Definition states.inl:65
void binary(T *array, const unsigned int h, const unsigned int w)
Fills the kernel with either 0 or 1.
Definition states.inl:19
void normal(T *array, const unsigned int h, const unsigned int w)
Fills the kernel with values between [0, 1].
Definition states.inl:10
Main namespace.
Definition common.hpp:33