diff options
author | Jedidiah Barber <contact@jedbarber.id.au> | 2022-11-17 00:36:11 +1300 |
---|---|---|
committer | Jedidiah Barber <contact@jedbarber.id.au> | 2022-11-17 00:36:11 +1300 |
commit | 07390c4a715e2e536f68ade43e16719a3d362d9e (patch) | |
tree | 68b9c32d34413957f1aea8d50112a9313862a380 /src/fluid_simulator.adb | |
parent | b4d7acde7be1809625dd80666d52998ef46a59ea (diff) |
Input now scaled up to 80x50 internally
Diffstat (limited to 'src/fluid_simulator.adb')
-rw-r--r-- | src/fluid_simulator.adb | 13 |
1 files 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; |