Skip to content

Commit

Permalink
feat: add game of life example
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanbabcock committed Dec 10, 2024
1 parent e09fb15 commit 2272b10
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions examples/game_of_life.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
use anyhow::Result;
use std::process::Command;

/// Conway's Game of Life in FFmpeg
/// <https://en.wikipedia.org/wiki/Conway%27s_Game_of_Life>
/// <https://ffmpeg.org/ffmpeg-filters.html#life>
pub fn main() -> Result<()> {
Command::new("ffplay")
.arg("-hide_banner")
.arg("-f").arg("lavfi")
.arg("-i").arg("life=s=300x200:mold=10:r=60:ratio=0.08:death_color=#C83232:life_color=#00ff00,scale=1200:800:flags=16")
.spawn()?
.wait()?;
Ok(())
}

0 comments on commit 2272b10

Please sign in to comment.