3D labirintus 254 byte-ból kódolva
Originally shared by mos6502
This week, an interactive 3-D program in just under one page of code! Previously[1] we posted about a Doom port to the VIC-20, but last year Diego Lucio D'Onofrio posted[2] about [Crescent]'s program "1 Block Interactive Raycaster" aka 1bir which is seen here - watch to the end for some implementation notes. As Slashdot says, "In 254 bytes 1bir sets up the screen for drawing, creates sine and cosine tables for 256 brads[3] based on a simple approximation, casts rays into a 2D map that lives inside the C64 KERNAL ROM, renders the screen in coordination with KERNAL, evaluates 8-way joystick input and detects collision against walls. The ray casting[4] core employs a brute force algorithm to determine visible walls, while the mapping portion supports both open-ended (infinitely looped) and traditional, closed maps" [5]
Nearby on pouet.net we find another single page program: Game of Life - C64 version [256b]
In both cases the authors are kind enough to share their source code. And a commenter was able to save 2 bytes!
http://tech.slashdot.org/comments.pl?sid=3753421&cid=43735691
Previously[6] we've mentioned Bruce Clark's tight coding, including his one-page machine monitor called C'mon. But not his one-page self-bootstrapping symbolic assembler at http://forum.6502.org/viewtopic.php?p=14200
Have you ever tried to program anything in one page? Do you have a favourite one-page program? Let us know in the comments!
[1] https://plus.google.com/108984290462000253857/posts/PEkEhCrKr6q
[2] https://plus.google.com/107952781798820424630/posts/NxVRBTwJkuA
[3] http://en.wikipedia.org/wiki/Binary_scaling#Binary_angles
[4] http://en.wikipedia.org/wiki/Ray_casting
[5] http://tech.slashdot.org/story/13/05/15/1913222/interactive-raycaster-for-the-commodore-64-under-256-bytes
[6] https://plus.google.com/108984290462000253857/posts/hhhNZprmoya
https://www.youtube.com/watch?v=JxS0_ckSwqk
Originally shared by mos6502
This week, an interactive 3-D program in just under one page of code! Previously[1] we posted about a Doom port to the VIC-20, but last year Diego Lucio D'Onofrio posted[2] about [Crescent]'s program "1 Block Interactive Raycaster" aka 1bir which is seen here - watch to the end for some implementation notes. As Slashdot says, "In 254 bytes 1bir sets up the screen for drawing, creates sine and cosine tables for 256 brads[3] based on a simple approximation, casts rays into a 2D map that lives inside the C64 KERNAL ROM, renders the screen in coordination with KERNAL, evaluates 8-way joystick input and detects collision against walls. The ray casting[4] core employs a brute force algorithm to determine visible walls, while the mapping portion supports both open-ended (infinitely looped) and traditional, closed maps" [5]
Nearby on pouet.net we find another single page program: Game of Life - C64 version [256b]
In both cases the authors are kind enough to share their source code. And a commenter was able to save 2 bytes!
http://tech.slashdot.org/comments.pl?sid=3753421&cid=43735691
Previously[6] we've mentioned Bruce Clark's tight coding, including his one-page machine monitor called C'mon. But not his one-page self-bootstrapping symbolic assembler at http://forum.6502.org/viewtopic.php?p=14200
Have you ever tried to program anything in one page? Do you have a favourite one-page program? Let us know in the comments!
[1] https://plus.google.com/108984290462000253857/posts/PEkEhCrKr6q
[2] https://plus.google.com/107952781798820424630/posts/NxVRBTwJkuA
[3] http://en.wikipedia.org/wiki/Binary_scaling#Binary_angles
[4] http://en.wikipedia.org/wiki/Ray_casting
[5] http://tech.slashdot.org/story/13/05/15/1913222/interactive-raycaster-for-the-commodore-64-under-256-bytes
[6] https://plus.google.com/108984290462000253857/posts/hhhNZprmoya
https://www.youtube.com/watch?v=JxS0_ckSwqk
Megjegyzések
Megjegyzés küldése