News for hackers. Stuff that matters.
Re:Notch trying jsFiddle by jrogers65 on Monday December 03, 2012 @04:34AM (#4864649)
I would argue that this is terrible code. It's not using the appropriate tools (webGL), it's badly structured, uncommented and unmaintainable (seriously, why on earth would anyone name their variables zd, _zd and __zd?). The Minecraft source code is also of notoriously poor quality. I honestly don't understand how you came to your conclusion.
Re:Notch trying jsFiddle by mmcnickle on Monday December 03, 2012 @04:54AM (#4864704)
The code is a direct port of Minecraft4k[1], it's optimised for space considerations.

[1] https://twitter.com/notch/status/275329867984302081

Re:Notch trying jsFiddle by jrogers65 on Monday December 03, 2012 @05:16AM (#4864768)
But that directly backs up my argument. From the horses mouth:

"Code is awful due to the nature of the project"

Re:Notch trying jsFiddle by antirez on Monday December 03, 2012 @07:48AM (#4865144)
It's an handful amount of lines of code doing a world generation, texture map generation, and ray casting rendering with a few tricks like a simple lightning model that still looks good.

All this using nothing more than a frame buffer, so you could port this easily from a C64 to any other computer. This code contains a lot of knowledge VS use of pre-build APIs.

If a programmer reads this code and understands how every part works, he or she ends knowing a lot more about computer graphics than before.

Re:Notch trying jsFiddle by General_Mayhem on Monday December 03, 2012 @08:06AM (#4865199)
>This code contains a lot of knowledge VS use of pre-build APIs.

It contains a lot of general knowledge about 3D graphics, and absolutely 0 specific knowledge about the environment in which it's running. All he's accomplished by doing it this way is show off that he knows trig and prevent any of it from being hardware accelerated.

>If a programmer reads this code and understands how every part works

But he never will, because the code is illegible.

Re:Notch trying jsFiddle by antirez on Monday December 03, 2012 @08:45AM (#4865307)
I hope this simplified version helps. I removed texture mapping and camera rotation, plus simplified a few unusual constructs.

https://gist.github.com/4195130

Re:Notch trying jsFiddle by HyprMusic on Monday December 03, 2012 @08:59AM (#4865348)
JsFiddled version: http://jsfiddle.net/ter7G/