Animate a pendulum: Difference between revisions

Content added Content deleted
(Add Zig solution)
m (→‎{{header|Zig}}: update @intToFloat() to @floatFromInt())
Line 5,581: Line 5,581:
while (!c.WindowShouldClose()) // Detect window close button or ESC key
while (!c.WindowShouldClose()) // Detect window close button or ESC key
{
{
const half_width = @intToFloat(f32, c.GetScreenWidth()) / 2;
const half_width = @as(f32, @floatFromInt(c.GetScreenWidth())) / 2;
const pivot = c.Vector2{ .x = half_width, .y = 0 };
const pivot = c.Vector2{ .x = half_width, .y = 0 };