diff --git a/crop_rot/src/model.rs b/crop_rot/src/model.rs index 3961ce0..6975940 100644 --- a/crop_rot/src/model.rs +++ b/crop_rot/src/model.rs @@ -117,7 +117,11 @@ impl Harvest where T: Harvestable + Debug + Clone + Display { pub fn new(color_weights: &ColorWeights, config: &Config) -> Harvest { - let rolled_fields: usize = rand::distributions::Uniform::new(3, 6).sample(&mut thread_rng()) * 2; + let rolled_fields: usize = ( + 3 + + rand::thread_rng().gen_range(0..=1) + + rand::thread_rng().gen_range(0..=1) + ) * 2; let mut fields: Vec = Vec::new(); diff --git a/flake.nix b/flake.nix index 11a3b21..239f24c 100644 --- a/flake.nix +++ b/flake.nix @@ -26,6 +26,9 @@ else rust.stable.latest.default; }) ]; + + python-packages = ps: with ps; [numpy]; + supportedSystems = ["x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin"]; forEachSupportedSystem = f: nixpkgs.lib.genAttrs supportedSystems (system: @@ -36,6 +39,8 @@ devShells = forEachSupportedSystem ({pkgs}: { default = pkgs.mkShell { packages = with pkgs; [ + (python3.withPackages python-packages) + rustToolchain openssl pkg-config