Andy Sloane writes about graphics, math and programming projects, including the donut.c explanation, a Tron bot and indoor localization.
HN links it for the donut.c math and obfuscated C; one commenter says the site has the highest awesomeness-per-bit ratio on the Internet.
;; Easymacs sets some common Windows key bindings like ctrl-c to copy, ctrl-s to save, etc.
(load "c:/Otech/programs/easymacs/easymacs.el")
(defun init-streamfocus ()
(interactive)
;; Slime is for starting or connecting to SBCL
;; To start: C-x slime RET
(add-to-list 'load-path "c:/Otech/sf/lib/slime")
;;(setq inferior-lisp-program "C:/Otech/programs/sbcl-1.0.9/sbcl")
;(setq inferior-lisp-program "C:/Program Files/LispWorks/lispworks-4450")
(add-hook 'lisp-mode-hook (lambda () (slime-mode t)))
(add-hook 'inferior-lisp-mode-hook (lambda () (inferior-slime-mode t)))
;; (defun lw-start ()
;; (interactive)
;; (shell-command (concat "C:/Program Files/LispWorks/lispworks-4450.exe -multiprocessing "
;; "-init c:/Otech/swank.lisp&")))
;;;For SBCL on Windows
;(setq inferior-lisp-program "sbcl")
;(add-to-list 'load-path "C:/Program Files/Steel Bank Common Lisp/1.0.22/sbcl.exe")
;;For Allegro on Windows
(setq inferior-lisp-program "allegro")
(add-to-list 'load-path "C:/Program Files/acl81/allegro.exe")
(require 'slime)
(slime-setup '(slime-fancy slime-banner))
;;allegro
(global-set-key "\C-cs" 'slime-selector)
(setq slime-complete-symbol-fancy t)
(setq slime-complete-symbol-function 'slime-fuzzy-complete-symbol)
(setq slime-multiprocessing t)
;; choose one of the below based on Express or non-Express usage
;(setq slime-lisp* "alisp.exe")
(setq slime-lisp "allegro.exe")
;;(setq *slime-lisp* "allegro-express.exe")
(setq…
I've written several raytracers and rasterizers that are smaller than 200 lines of C++, though quite likely they're worse pedagogically than Jacco's (slashdotted, but available at https://web.archive.org/web/20220615174927/https://jacco.ompf2.com/2022/06/15/how-to-build-a-bvh-part-9b-massive/) tutorial, and they also don't illustrate useful optimizations. Hopefully, what mine lack in cluefulness and performance they make up in breadth, diversity, and brevity: they are written in C, C++, Python, JS, Lua, and Clojure, with output to JPEG files, PPM files, X11, the Linux framebuffer, ASCII art, Unicode Braille art, and the browser <canvas>.
· http://canonical.org/~kragen/sw/aspmisc/my-very-first-raytracer.html 184 lines of C, including vector arithmetic, input parsing, and PPM output. I'm not sure what you mean by "excluding the headers" — this one doesn't have any headers of its own (why would a 200-line program have headers of its own? Are you on a Commodore 64 such that the compilation time for 200 lines of code is so high that you need separate compilation?) but it #includes math.h, stdio.h, stdlib.h, and string.h, which total almost 1800 lines of code on my machine and presumably 15× that by the time you count their transitive includes.
· http://canonical.org/~kragen/sw/dev3/circle.clj 39 lines of Clojure, including the model, which is a single sphere; it uses java.awt.image for JPEG output. About half of the code is implementing basic vector math by hand. A…
Check out as well
- 3D Rendering on an Arduboy: https://www.a1k0n.net/2017/02/01/arduboy-teapot.html
- General overview of Arduboy — open-source homebrew 8-bit platform, and its community: https://www.inputmag.com/reviews/arduboy-fx-review-no-quirk-playdate-but-still-adorably-dope-200-games-list-learn-coding
- Some people make their own Arduboys: https://www.hackster.io/contests/arduboycontest
Wow, really the best email address spam protection method [0]:
_=0;k;main(){while(_<641){for(k=0;"##K#8(38D-##C]L5870.X7\\M_b;90\\"
"MC-M/NZGB6Q,I0VGB6a0FbN<VG.6Q\\bNb7^@`X=N@`XQaOVX:^]NX=:Z8PY]B`:>P"
"NY8^$#SM):XA"[_/6]-35>>_++%6&1;k++);putchar(k[" _/\\\n,`)('<-"]);}}
[0] - bottom of OP's homepage https://www.a1k0n.net/
> We did some inverse model explanation work which quickly showed that our car was paying attention to the overhead skylights more than the actual tracks.
It must've been posted here before: this is exactly the strategy Andy Sloane used to localize his car.
https://www.a1k0n.net/2021/01/22/indoor-localization.html
I know almost nothing, my desire came from reading this http://www.a1k0n.net/2011/07/20/donut-math.html . In case that helps you.
3d rendering on ascii terminal, if you can, build and run the source ( http://www.a1k0n.net/2006/09/15/obfuscated-c-donut.html ), it's always pretty to see running.