4using System.Xml.Serialization;
10 static Random rand = new Random();
12 public static void Main() {
13 var n = GetInt("N = ", x => x > 0, "That is not a valid integer, larger than 0.");
14 var triangles = new Triangle.Triangle[n];
16 for (var i = 0; i < n; i++) {
17 triangles[i] = new Triangle.Triangle();
18 triangles[i].A = rand.NextDouble() * 29 + 1;
19 triangles[i].B = rand.NextDouble() * 29 + 1;
23 var stream = new FileStream("../../../triangles.xml", FileMode.Create);
25 var format = new XmlSerializer(typeof(Triangle.Triangle[]));
27 format.Serialize(stream, triangles);
29 Console.WriteLine("There was an error writing the file.");
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list