run :: () -> bool { root := Rectangle.{ 0.0, 0.0, 1000.0, 1000.0, }; t := rcut_from_right(*root, 0.5); ass(t, Rectangle.{ 500.0, 0.0, 500.0, 1000.0 }); t = rcut_from_left(*root, 0.1); ass(t, Rectangle.{ 0, 0, 50, 1000 }); t = rcut_from_top(*root, 0.8); ass(t, Rectangle.{ 50, 0, 450, 800 }); t = rcut_from_bottom(*root, 0.34); ass(t, Rectangle.{ 50, 932, 450, 68 }); return true; } #scope_file Rectangle :: struct { x: float; /** top-left corner position x */ y: float; /** top-left corner position y */ width: float; height: float; } ass :: (a: Rectangle, b: Rectangle, loc := #caller_location) #expand { ok := true; ok &= a.x == b.x; ok &= a.y == b.y; ok &= a.width == b.width; ok &= a.height == b.height; if !ok then #insert,scope() ASS_CODE; } #import "Basic"; #import "Print_Vars"; #import,file "../0x2_Rectcut.jai"; #load "assertion.jai";