-
Notifications
You must be signed in to change notification settings - Fork 8
Zig day 3 #69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Zig day 3 #69
Conversation
|
|
||
| return Map { | ||
| .bytes = bytes, | ||
| .line_width = line_width, // TODO: account for arbitrary line ending format |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Behold, the most boring collection of words in the universe: "arbitrary line ending format". 😆 Do not mention this on a date 💯
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't promise anything 😁
| var real_x = (x_pos + n_skipped) % self.line_width; | ||
| var real_y = y_pos * self.line_width; | ||
|
|
||
| closed += @boolToInt(self.bytes[real_x + real_y] == '#'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the @ signifying compile-time in this language?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Arxcis Comptime has no extra syntax in Zig other than "comptime". @ means compiler builtin function. It's in other words language features that does a given operation, like casting or adding with overflow (will panic with safety on otherwise)
To run an expression on compile time you simply say comptime *expression*. See:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😄 Aha! Very helpful 👍
No description provided.