From bf6560bb2007581892932a367f4319f2f2a01919 Mon Sep 17 00:00:00 2001 From: Martin Kagamino Lehoux Date: Thu, 27 Aug 2026 11:23:39 +0200 Subject: Make old project runnable on Go 1.27 with mise and README - init go.mod (Go 1.27, progressbar/v3 v3.19.1) and fix import - fix FMin returning max, remove deprecated RenderBlank, apply go fix range loops - add mise.toml (go 1.27, tasks: build/run/check with go fix -diff/clean) - add focused README and update .gitignore for build artifacts --- main.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'main.go') diff --git a/main.go b/main.go index 957fc92..1330e74 100644 --- a/main.go +++ b/main.go @@ -5,7 +5,7 @@ import ( "math" "math/rand" - "github.com/schollz/progressbar" + "github.com/schollz/progressbar/v3" ) const ( @@ -55,14 +55,13 @@ func main() { // move := Vec3D{2.0, 0.0, 0.0} frame := Frame{} bar := progressbar.New(Height) - bar.RenderBlank() // for k := 0; k < FPS*DURATION; k++ { // origin := AddVec3D(start, ScalarProduct(float64(k)/float64(FPS*DURATION), move)) // camera.origin = origin - for x := 0; x < Height; x++ { - for y := 0; y < Width; y++ { + for x := range Height { + for y := range Width { var colorList [RaysPerPixel]Color - for it := 0; it < RaysPerPixel; it++ { + for it := range RaysPerPixel { u := (float64(y) + rand.Float64()) / float64(Width) v := (float64(x) + rand.Float64()) / float64(Height) ray := camera.GetRay(u, v) -- cgit v1.3