Случайное дерево объектов

This commit is contained in:
2026-02-24 00:39:40 +03:00
parent aeda3ee0d0
commit 1a94cc8bfd
6 changed files with 203 additions and 48 deletions

View File

@@ -97,7 +97,7 @@ pub fn createLine(allocator: std.mem.Allocator) !Object {
pub fn createBrokenLine(allocator: std.mem.Allocator) !Object {
var obj = try createWithCommonProperties(allocator, .broken);
errdefer obj.deinit(allocator);
var points = std.ArrayList(Point2).init(allocator);
var points = std.ArrayList(Point2).empty;
try points.appendSlice(allocator, &.{
.{ .x = 0, .y = 0 },
.{ .x = 80, .y = 0 },