From 07390c4a715e2e536f68ade43e16719a3d362d9e Mon Sep 17 00:00:00 2001 From: Jedidiah Barber Date: Thu, 17 Nov 2022 00:36:11 +1300 Subject: Input now scaled up to 80x50 internally --- src/fluid_simulator.adb | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/fluid_simulator.adb b/src/fluid_simulator.adb index 9d9186b..f36b834 100644 --- a/src/fluid_simulator.adb +++ b/src/fluid_simulator.adb @@ -84,10 +84,11 @@ procedure Fluid_Simulator is IO.Get_Immediate (Input); if Input = Latin.LF then X := 1.0; - Y := Y + 1.0; + Y := Y + 2.0; else if Input > Latin.Space and Input < Latin.DEL then Store.Append (Create (X, Y, (Input = '#'))); + Store.Append (Create (X, Y + 1.0, (Input = '#'))); end if; X := X + 1.0; end if; @@ -108,8 +109,8 @@ procedure Fluid_Simulator is for P of Input loop X := Integer (Fixed.Re (P.Place)); Y := Integer (Fixed.Im (P.Place)); - if X >= 0 and X <= 80 and Y >= 0 and Y <= 25 then - Grid (X, Y) := True; + if X >= 0 and X <= 80 and Y >= 0 and Y <= 50 then + Grid (X, Y / 2) := True; end if; end loop; for J in Integer range 1 .. 25 loop @@ -188,10 +189,10 @@ procedure Fluid_Simulator is Threshold : in Quantity) is begin for C in reverse Store.First_Index .. Store.Last_Index loop - if Fixed.Re (Store (C).Place) < 0.0 - Threshold or + if Fixed.Re (Store (C).Place) < 1.0 - Threshold or Fixed.Re (Store (C).Place) > 80.0 + Threshold or - Fixed.Im (Store (C).Place) < 0.0 - Threshold or - Fixed.Im (Store (C).Place) > 25.0 + Threshold + Fixed.Im (Store (C).Place) < 1.0 - Threshold or + Fixed.Im (Store (C).Place) > 50.0 + Threshold then Store.Delete (C); end if; -- cgit