Quest 4: Teeth of the Wind
- Keep top level comments as only solutions, if you want to say something other than a solution put it in a new post. (replies to comments can be whatever)
- You can send code in code blocks by using three backticks, the code, and then three backticks or use something such as https://topaz.github.io/paste/ if you prefer sending it through a URL
Link to participate: https://everybody.codes/
8 Comments
mykl@lemmy.world · 3 pts · 289d
Uiua
Fortunately the ratios for the common gears all proved to be rational in part 3.
janAkali@lemmy.sdf.org · 2 pts · 294d
Nim
For part 3 I parse gears as tuples, with regular gears having same value on both ends e.g.
Full solution at Codeberg: solution.nim
lwhjp@piefed.blahaj.zone · 2 pts · 294d
I liked this one!
Pyro@programming.dev · 2 pts · 283d
Python
reboot6675@sopuli.xyz · 2 pts · 279d
Ohh so it was possible to use floats for this! I was "worried" that it would lead to precision errors haha so I ended up "cheating" with BigInt (Golang) to make all the multiplications first and one division at the end
Pyro@programming.dev · 2 pts · 279d
Yeah, it may be possible for precision errors to accumulate in my solution but for EC the inputs are few enough that it doesn't really matter. Maybe I got a little lucky with my input too.
reboot6675@sopuli.xyz · 1 pts · 279d
vole@lemmy.world · 2 pts · 290d
maaath
Scheme/Guile
hades@programming.dev · 2 pts · 294d
Rust