ziglings/exercises
62
1.5k
Fork
You've already forked exercises
478

Exercise 71 and 82 are unsolvable after build change related fixes, new solutions rely on knowledge from 104 #453

Open
opened 2026年06月08日 18:21:31 +02:00 by MonstraG · 3 comments

This PR: #443 changes exercises 071_comptime6 and 082_anonymous_structs3 such that expected solution involves iterating over both names and types sequences via for (seq_a, seq_b) |a, b|

inlinefor(field_names,field_types)|field_name,field_type|{

But, this is feature is taught in 103_for4.

Only range iterations for (seq_a, 0..) |a, index| are known at this stage.

This PR: https://codeberg.org/ziglings/exercises/pulls/443 changes exercises `071_comptime6` and `082_anonymous_structs3` such that expected solution involves iterating over both names and types sequences via `for (seq_a, seq_b) |a, b|` ```zig inline for (field_names, field_types) |field_name, field_type| { ``` But, this is feature is taught in `103_for4`. Only range iterations `for (seq_a, 0..) |a, index|` are known at this stage.
Contributor
Copy link

Hi,

I see what you mean, but I don't think the difference between iterating through a sequence and a range and iterating through two sequences is that significant, and it can be considered known.

Hi, I see what you mean, but I don't think the difference between iterating through a sequence and a range and iterating through two sequences is that significant, and it can be considered known.

Clearly it cannot be considered known, because it is taught in a future exercise. (And as such, a simple solution could be to move that exercise, 103_for4 earlier.)

Additionally, as somebody who is learning zig, I'm gonna tell you that it cannot be considered known as I didn't know it and had to look it up.

Clearly it cannot be considered known, because it is taught in a future exercise. (And as such, a simple solution could be to move that exercise, `103_for4` earlier.) Additionally, as somebody who is learning zig, I'm gonna tell you that it cannot be considered known as I didn't know it and had to look it up.
Contributor
Copy link

I understand that as I am also still in the learning process of zig and I also see your point.
Although I still believe one can come to the conclusion to use two sequences, maybe it's possible to move exercise 103_for4 somewhere to the front. What would you say @chrboesch?

I understand that as I am also still in the learning process of zig and I also see your point. Although I still believe one can come to the conclusion to use two sequences, maybe it's possible to move exercise 103_for4 somewhere to the front. What would you say @chrboesch?
Sign in to join this conversation.
No Branch/Tag specified
main
v0.16.0
v0.15.1
v0.14.0
v0.13.0
v0.12.0
v0.11.0
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
ziglings/exercises#453
Reference in a new issue
ziglings/exercises
No description provided.
Delete branch "%!s()"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?