Skip to content

Commit

Permalink
Collapse long code samples
Browse files Browse the repository at this point in the history
  • Loading branch information
hohav committed Mar 28, 2024
1 parent 73f00b5 commit dd3754f
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ fn main() {
}
```

Here's a more involved example that finds the frames on which each player died:
<details>
<summary>A more involved example</summary>

```rust
use std::{fs, io};
Expand All @@ -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();
Expand Down Expand Up @@ -87,8 +89,10 @@ fn main() {
}
}
```
</details>

For parsing live games, you can drive things yourself:
<details>
<summary>Live parsing</summary>

```rust
use std::fs;
Expand Down Expand Up @@ -121,6 +125,7 @@ fn main() {
}
}
```
</details>

## Development

Expand Down

0 comments on commit dd3754f

Please sign in to comment.