Comment

Comment by ZephyrBlu

Can someone who knows C help me understand the source code?

https://gist.github.com/skeeto/da7b2ac95730aa767c8faf8ec3098...

The concepts and equations he has are pretty simple but I'm really not seeing how they translate into code.

The code also isn't the easiest to try and understand for me. Multiple 1-3 letter or otherwise (Seemingly) poorly named variables, some C jargon I'm not familiar with (Mostly the -> operator) and the fact it's a relatively large chunk of code.

It seems like the core logic loop is here: https://gist.github.com/skeeto/da7b2ac95730aa767c8faf8ec3098...

And the position and acceleration of the car is altered each iteration through randomization?

It's hard to piece together.

parent ZephyrBlu 6 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton