The case for post-ai waterfall dev
Kapendev
alexandroskapretsos at gmail.com
Sun Nov 22 03:19:06 UTC 2026
On Sunday, 22 November 2026 at 02:31:38 UTC, monkyyy wrote:
> On Sunday, 22 November 2026 at 02:06:19 UTC, Kapendev wrote:
>> On Saturday, 21 November 2026 at 22:36:29 UTC, monkyyy wrote:
>>> On Saturday, 21 November 2026 at 20:00:10 UTC, Kapendev wrote:
>>>> On Saturday, 21 November 2026 at 05:00:21 UTC, monkyyy wrote:
>>>>> Token maxxers are winding down their leader boards but they
>>>>> still have uncapped token loops for their exceptionally
>>>>> well-lit "dark factorys". This may continue even pass the
>>>>> crash.
>>>>>
>>>>> Most software should be smaller, most software should be
>>>>> disposed of, most software wasnt fully thought out and has
>>>>> piles of tech debt.
>>>>
>>>> No.
>>>
>>> yes
>>
>> No no no no no!
>
> given full vibe coding please improve this program with < 15
> minutes of human effort
>
> https://pastebin.com/zSEerHwz
>
> what development philosophy gets the best results?
No idea, it came up with this after 3 tries:
```d
// Drag with the left mouse button to draw boxes; nearby edges
snap together.
// Backspace removes the last one.
import parin;
enum snap = 50; // edges closer than this get merged
float[4][8] boxes; // each box is [x0, y0, x1, y1]
int count;
Vec2 corner;
float lo(float a, float b) => a < b ? a : b;
float hi(float a, float b) => a > b ? a : b;
float dist(float a, float b) => hi(a, b) - lo(a, b);
Rect rect(float[4] b) => Rect(b[0], b[1], b[2] - b[0], b[3] -
b[1]);
// Averages all edges on the same axis (0 = x, 1 = y) within
`snap` of v,
// or sticks to the screen border if close to it.
float snapEdge(float v, int axis, float limit) {
if (v < snap) return 0;
if (v > limit - snap) return limit;
float sum = 0;
int n = 0;
foreach (b; boxes[0 .. count]) {
foreach (k; 0 .. 2) {
if (dist(b[axis + k * 2], v) < snap) { sum += b[axis
+ k * 2]; n += 1; }
}
}
return sum / n; // v is itself one of the edges, so n >= 1
}
bool snapDemo(float dt) {
if (isPressed(Mouse.left)) corner = mouse;
float[4] drag = [lo(corner.x, mouse.x), lo(corner.y,
mouse.y), hi(corner.x, mouse.x), hi(corner.y, mouse.y)];
if (isDown(Mouse.left)) drawRect(rect(drag), white, 1);
if (isReleased(Mouse.left) && count < 8 && rect(drag).w > 4
&& rect(drag).h > 4) boxes[count++] = drag;
if (isPressed(Keyboard.backspace) && count > 0) count -= 1;
foreach (i, b; boxes[0 .. count]) {
float[4] s;
foreach (k; 0 .. 4) s[k] = snapEdge(b[k], k % 2, k % 2 ?
windowHeight : windowWidth);
drawRect(rect(s), Rgba(cast(ubyte) (60 + i * 25),
cast(ubyte) (200 - i * 20), cast(ubyte) (120 + i * 15), 255));
drawRect(rect(b), white, 1); // what you actually drew
}
return false;
}
mixin runDemo!snapDemo;
```
More information about the Digitalmars-d
mailing list