58struct Bays_B2_S34_Functor
60 template <
typename State>
61 [[
nodiscard]]
constexpr State operator()(
const State ¤t,
62 const std::size_t alive)
const noexcept
64 const bool alive_now = current != State{};
75 std::size_t alive = 0;
78 if (
lat.at_axial(
Hex_Axial{static_cast<ca_index_t>(q), static_cast<ca_index_t>(r)})
82 std::printf(
"\nStep %2zu alive=%zu\n", step, alive);
91 const auto v =
lat.at_axial(
93 std::printf(
"%c ", v != 0 ?
'#' :
'.');
113 seed.set_axial(p, 1);
116 std::printf(
"Aleph::CA Phase-6 example: Bays' B2/S34 hex life on a 16x16 toroidal lattice\n");
123 for (std::size_t s = 1; s <= 6; ++s)
129 std::printf(
"\n--- TikZ render of step 6 ---\n");
132 return v != 0 ?
"black" :
"white";
Common typedefs and tag types for the Cellular Automata module.
Hexagonal lattice with axial accessors over a 2D storage.
Six-neighbour hex pattern in axial coordinates over a 2D lattice.
Rule whose next state depends on (current, alive_count).
Synchronous double-buffered engine.
void step()
Apply the rule to every cell once and swap buffers.
size_t blossom_maximum_cardinality_matching(const GT &g, DynDlist< typename GT::Arc * > &matching, SA sa=SA())
Alias of compute_maximum_cardinality_general_matching().
std::ptrdiff_t ca_index_t
Signed coordinate component used by lattices and neighborhoods.
void render_hex_lattice_tikz(std::ostream &os, const Lattice &lat, Palette &&palette, double radius=0.5, bool pointy_top=true)
Render a hex frame as a stand-alone TikZ picture.
std::size_t ca_size_t
Unsigned size component used for extents and counts.
constexpr ca_size_t hex_distance(Hex_Axial a, Hex_Axial b) noexcept
Hex distance between two axial coordinates.
Main namespace for Aleph-w library functions.
and
Check uniqueness with explicit hash + equality functors.
Axial integer coordinates (q, r) of a hex cell.
The lattice wraps around on every axis.
Synchronous double-buffered engine for cellular automata.
Hexagonal lattice with axial / offset / cube coordinate conversions and a TikZ-compatible pixel mappi...
Neighborhoods catalogue for Aleph::CA.
Rule mechanisms for Aleph::CA.
Dense, contiguous storage for cellular automata cells (1D/2D/3D).