plasma/plasma.rs
1use terminal_graphics_interactive::prelude::*;
2
3fn main() -> std::io::Result<()> {
4 // Move the mouse to send ripples across it. Press q to quit.
5 sketch_with(Palette::fire(), |cell| {
6 let ripple = cell.dist_to_mouse() * 0.25 - cell.t * 3.0;
7 ((cell.x * 0.15 + cell.t).sin() + (cell.y * 0.2 - cell.t * 0.7).sin() + ripple.sin()) / 3.0
8 })
9}