From dd3754f7568d3ece1fea2240896c6a6353e6bea9 Mon Sep 17 00:00:00 2001 From: melkor Date: Thu, 28 Mar 2024 15:25:27 -0700 Subject: [PATCH] Collapse long code samples --- README.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index bd4c745..26314bb 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,8 @@ fn main() { } ``` -Here's a more involved example that finds the frames on which each player died: +
+A more involved example ```rust use std::{fs, io}; @@ -43,6 +44,7 @@ use peppi::frame::Rollbacks; // You can just hard-code constants instead, if you prefer. use ssbm_data::action_state::Common::{self, *}; +/// Print the frames on which each player died. fn main() { let mut r = io::BufReader::new(fs::File::open("game.slp").unwrap()); let game = read(&mut r, None).unwrap(); @@ -87,8 +89,10 @@ fn main() { } } ``` +
-For parsing live games, you can drive things yourself: +
+Live parsing ```rust use std::fs; @@ -121,6 +125,7 @@ fn main() { } } ``` +
## Development