Switch all experiments to use output instead of to_stdout
Getty Ritter
6 years ago
21 | 21 |
));
|
22 | 22 |
}
|
23 | 23 |
}
|
24 | |
drawing.to_stdout();
|
| 24 |
|
| 25 |
if let Err(e) = drawing.output("circles") {
|
| 26 |
eprintln!("{}", e);
|
| 27 |
}
|
25 | 28 |
}
|
78 | 78 |
}
|
79 | 79 |
}
|
80 | 80 |
|
81 | |
drawing.to_stdout();
|
| 81 |
if let Err(e) = drawing.output("grid") {
|
| 82 |
eprintln!("{}", e);
|
| 83 |
}
|
82 | 84 |
}
|
4 | 4 |
use rand::random;
|
5 | 5 |
|
6 | 6 |
fn main() {
|
7 | |
let cent = 0.393701;
|
| 7 |
// let cent = 0.393701;
|
8 | 8 |
let mut drawing = gt::svg(9.0, 12.0);
|
9 | 9 |
|
10 | 10 |
let xs: Vec<Vec<f64>> = (1..9).map(|_: u32| {
|
|
34 | 34 |
}
|
35 | 35 |
}
|
36 | 36 |
|
37 | |
drawing.to_stdout();
|
| 37 |
if let Err(e) = drawing.output("planets") {
|
| 38 |
eprintln!("{}", e);
|
| 39 |
};
|
38 | 40 |
}
|
6 | 6 |
let mut drawing = gt::svg(w, h);
|
7 | 7 |
|
8 | 8 |
let rs = (0u64..100)
|
9 | |
.scan((0u64, 5.5f64), |(_, s), x: u64| {
|
10 | |
Some((x, *s + (rand::random::<f64>() * 0.5) - 0.25))
|
| 9 |
.scan((0u64, 5.5f64), |&mut (_, s), x: u64| {
|
| 10 |
Some((x, s + (rand::random::<f64>() * 0.5) - 0.25))
|
11 | 11 |
});
|
12 | 12 |
|
13 | 13 |
for (x, r) in rs {
|
|
20 | 20 |
);
|
21 | 21 |
}
|
22 | 22 |
|
23 | |
drawing.to_stdout();
|
| 23 |
if let Err(e) = drawing.output("sunburst") {
|
| 24 |
eprintln!("{}", e);
|
| 25 |
};
|
24 | 26 |
}
|