Created
June 20, 2015 05:54
-
-
Save XMPPwocky/5faeb30d848368406d33 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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