sandpile 0.1.0

Library to do sandpile computations
Documentation
  • Coverage
  • 20%
    1 out of 5 items documented0 out of 3 items with examples
  • Size
  • Source code size: 7.90 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 464.08 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • chinmaydd/Sandpile
    1 0 1
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • chinmaydd

Sandpile

Sandpile implementation in Rust. WIP.

Build Status

Usage Example

extern crate sandpile;
use sandpile::Sandpile;

fn main() {
    let rows = 3;
    let cols = 3;

    // Create a new sandpile.
    let a = Sandpile::new(rows, cols, Some(vec![1,2,3,1,2,3,1,2,3]));

    // Create another sandpile.
    // Since no initialization data is provided,
    // the sandpile will be populated with 0s
    let b = Sandpile::new(rows, cols, None);

    // We have overloaded the '+' operator for sandpiles.
    let c = a + b;

    println!("{}", c);
}
/*
Output: 
1 | 2 | 3 | 
1 | 2 | 3 | 
1 | 2 | 3 | 
*/

License

MIT