gdritter repos axidraw-experiments / b59eb76
Switch all experiments to use output instead of to_stdout Getty Ritter 5 years ago
5 changed file(s) with 20 addition(s) and 8 deletion(s). Collapse all Expand all
2121 ));
2222 }
2323 }
24 drawing.to_stdout();
24
25 if let Err(e) = drawing.output("circles") {
26 eprintln!("{}", e);
27 }
2528 }
7878 }
7979 }
8080
81 drawing.to_stdout();
81 if let Err(e) = drawing.output("grid") {
82 eprintln!("{}", e);
83 }
8284 }
6161 );
6262 }
6363 }
64 drawing.to_stdout();
64
65 if let Err(e) = drawing.output("hexes") {
66 eprintln!("{}", e);
67 }
6568 }
44 use rand::random;
55
66 fn main() {
7 let cent = 0.393701;
7 // let cent = 0.393701;
88 let mut drawing = gt::svg(9.0, 12.0);
99
1010 let xs: Vec<Vec<f64>> = (1..9).map(|_: u32| {
3434 }
3535 }
3636
37 drawing.to_stdout();
37 if let Err(e) = drawing.output("planets") {
38 eprintln!("{}", e);
39 };
3840 }
66 let mut drawing = gt::svg(w, h);
77
88 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))
1111 });
1212
1313 for (x, r) in rs {
2020 );
2121 }
2222
23 drawing.to_stdout();
23 if let Err(e) = drawing.output("sunburst") {
24 eprintln!("{}", e);
25 };
2426 }