From 04e94c297f6426a323550cdb094b2be93ea37ca4 Mon Sep 17 00:00:00 2001 From: Spectre Date: Wed, 9 Oct 2024 23:14:59 +0200 Subject: [PATCH] ah I'm stupid generate groves right you idiot --- crop_rot/src/model.rs | 6 +++++- flake.nix | 5 +++++ 2 files changed, 10 insertions(+), 1 deletion(-) 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