This commit is contained in:
Adam Millerchip 2022-01-01 12:55:42 +09:00
parent fb9eb1e1b6
commit a90a0744d1
1 changed files with 2 additions and 2 deletions

View File

@ -43,7 +43,7 @@ const Schooner = struct {
//
// Please change this so that it sets a 0 scale to 1
// instead.
if (my_scale == 0) @compileError("Scale 1:0 is not valid!");
if (my_scale == 0) my_scale = 1;
self.scale = my_scale;
self.hull_length /= my_scale;
@ -69,7 +69,7 @@ pub fn main() void {
// Hey, we can't just pass this runtime variable as an
// argument to the scaleMe() method. What would let us do
// that?
var scale: u32 = undefined;
comptime var scale: u32 = undefined;
scale = 32; // 1:32 scale