This commit is contained in:
jonathan santis 2024-12-24 15:06:10 +01:00
parent f45821ca48
commit 80816f56f6

View File

@ -31,6 +31,7 @@ pub fn main() !void
if(try checkOrder(allocator,dat,&rules)) | failed_rule |
{
print("dataset failed at rule {d}\n",.{failed_rule});
//try to rearange those
}
else
{
@ -177,3 +178,26 @@ fn getMiddleFromSlice(data : []u64) usize
return middle;
}
fn orderNums(allocator : std.mem.Allocator, data : *[]u64, rules : *std.ArrayList([]u8)) ! void
{
const rules_i = try parseRule(allocator,rule);
for(data) | dat |
{
const failed_rule_index = try checkOrder(allocator,dat,rules);
const failed_rule = rules[failed_rule_index];
failed_rule_i = parseRule(allocator,failed_rule);
const tmp = failed_rule_i[1];
//find the number in dat
if(std.mem.indexOf(u64,dat,tmp)) | index |
{
for(
}
}