Simple cellular-automata-based liquid flow simulation, implemented in SQL
Loosely based on https://www.reddit.com/r/cellular_automata/comments/6jhdfw/i_used_1dimensional_cellular_automata_to_make_a/.
The SQL code in
fluid.sql should work with any contemporary version of PostgreSQL.
fluid.sql, uncomment one of the few initial fluid container scenarios (they start with
\COPY input(cells) FROM stdin). A sample container has already been uncommented for you. Feel free to create your own.
Run the SQL code, e.g., via