aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNic Gaffney <gaffney_nic@protonmail.com>2024-06-20 02:25:21 -0500
committerNic Gaffney <gaffney_nic@protonmail.com>2024-06-20 02:25:21 -0500
commita805bb704a67d112146c5ea6544d0c14ffa2f5ef (patch)
tree6e5b6302acbf94aefacac119ed815e8832c9b611 /src
parent0dc97d45f1b228f6f3b9feb1773b972eca343766 (diff)
downloadparticle-sim-a805bb704a67d112146c5ea6544d0c14ffa2f5ef.tar.gz
Removed debug print and added some comments
Diffstat (limited to 'src')
-rw-r--r--src/rules.zig3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/rules.zig b/src/rules.zig
index 2a2f1d3..af299ec 100644
--- a/src/rules.zig
+++ b/src/rules.zig
@@ -33,12 +33,12 @@ pub fn printRules(rules: [cfg.colorAmnt][cfg.colorAmnt]f32) void {
}
}
+/// Loads rules from a csv
pub fn loadRules(allocator: std.mem.Allocator, absolutePath: [:0]u8) !void {
const file = try std.fs.openFileAbsoluteZ(absolutePath, .{ .mode = .read_only });
defer file.close();
var reader = file.reader();
for (&cfg.rules) |*row| {
- std.debug.print("Row\n", .{});
for (row) |*col| {
const buf = try reader.readUntilDelimiterAlloc(allocator, ',', 16);
defer allocator.free(buf);
@@ -48,6 +48,7 @@ pub fn loadRules(allocator: std.mem.Allocator, absolutePath: [:0]u8) !void {
}
}
+/// Save rules to a csv
pub fn saveRules(absolutePath: [:0]u8) !void {
const file = try std.fs.createFileAbsoluteZ(absolutePath, .{ .read = true });
defer file.close();