fern_sim_test/spores.rs
1pub struct Sporangium;
2
3use cells::{Cell, Gene};
4
5pub struct Spore {
6 size: f64,
7}
8
9pub fn produce_spore(factory: &mut i32) -> Spore {
10 Spore { size: 1.0 }
11}
12
13pub(crate) fn genes(spore: &Spore) -> Vec<Gene> {
14 todo!()
15}
16
17fn recombine(parent: &mut Cell) {
18 todo!()
19}
20
21mod cells {
22 pub struct Cell {
23 x: f64,
24 y: f64,
25 }
26 impl Cell {
27 pub fn distance_from_origin(&self) -> f64 {
28 f64::hypot(self.x, self.y)
29 }
30 }
31
32 pub struct Gene;
33}