Skip to content

Conversation

@Avokadoen
Copy link
Contributor

No description provided.


return Map {
.bytes = bytes,
.line_width = line_width, // TODO: account for arbitrary line ending format
Copy link
Owner

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 💯

Copy link
Contributor Author

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] == '#');
Copy link
Owner

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?

Copy link
Contributor Author

@Avokadoen Avokadoen Dec 8, 2020

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:

Copy link
Owner

@Arxcis Arxcis Dec 8, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😄 Aha! Very helpful 👍

@Arxcis Arxcis merged commit a43b3a9 into Arxcis:main Dec 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants