Ugrás a fő tartalomra

3D labirintus 254 byte-ból kódolva

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 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!

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

Have you ever tried to program anything in one page?  Do you have a favourite one-page program? Let us know in the comments!