Skip to content

Instantly share code, notes, and snippets.

@XMPPwocky
Created June 20, 2015 05:54
Show Gist options
  • Save XMPPwocky/5faeb30d848368406d33 to your computer and use it in GitHub Desktop.
Save XMPPwocky/5faeb30d848368406d33 to your computer and use it in GitHub Desktop.
use std::io;
use std::io::prelude::*;
use std::fs::File;
fn main() {
println!("starting test");
let fp = File::open("SCC.txt").ok().expect("file problems");
let mut r = io::BufReader::new(fp);
let mut line = String::new();
let mut parts: Vec<&str> = Vec::new();
loop {
let n = r.read_line(&mut line).unwrap();
if n == 0 {
break;
}
parts.extend(line.trim().split(' '));
if parts.len() < 2 {
println!("damn");
return;
}
let start: i32 = parts[0].trim().parse().unwrap();
let end: i32 = parts[1].trim().parse().unwrap();
//println!("{}: {}", start, end);
line.clear();
parts.clear();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment