Andy Sloane
a1k0n.net · Personal blog · on HN since 2007
Andy Sloane writes about graphics, math and programming projects, including the donut.c explanation, a Tron bot and indoor localization.
What HN saysHN 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.
57HN people shared it
27linked it in comments
41stories submitted
2.7Kstory points
6 months agolast shared
2007people per year2026
Most-shared posts
- 1Donut math - How donut.c works23 people · 596 points · first shared 2011 · 22 comments on HN
- 2ASCII animated donut in obfuscated C6 people · 81 points · first shared 2011 · 32 comments on HN
- 3Playing Fasttracker2 .XM files in JavaScript5 people · 168 points · first shared 2015 · 26 comments on HN
- 4How the Winning Tron Bot Works5 people · 117 points · first shared 2011 · 13 comments on HN
- 5Fast indoor 2D localization using ceiling lights4 people · 61 points · first shared 2021 · 5 comments on HN
- 6Yahoo Logo ASCII Animation in 462 bytes of C (2011)3 people · 476 points · first shared 2011 · 41 comments on HN
- 7Google AI Challenge: Winner post-mortem and source code3 people · 147 points · first shared 2010 · 36 comments on HN
- 8Pure Silicon Demo Coding: No CPU, No Memory, Just 4k Gates2 people · 417 points · first shared 2025 · 70 comments on HN
- 9Donut.c Without a Math Library2 people · 137 points · first shared 2021 · 22 comments on HN
- 10JavaScript XM Player2 people · 65 points · first shared 2015 · 11 comments on HN
- 113D rendering on an Arduboy2 people · 4 points · first shared 2017 · discussion on HN
- 12Embellished Donut in Obfucsated C2 people · 2 points · first shared 2011 · discussion on HN
- 13Homepage2 people · first shared 2012
- 14Fast line-following robots1 people · 207 points · first shared 2018 · 26 comments on HN
- 15From ASCII to ASIC: Porting donut.c to a tiny slice of silicon1 people · 162 points · first shared 2025 · 25 comments on HN
What HN people wrote when they linked it
elwell · 2018-11-15
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/
arscan · 2012-11-19
Ah great, I look forward to checking it out. Unfortunately I have to work during the day -- but for those giving the contest a shot, I recommend starting your research here:
http://www.a1k0n.net/2010/03/04/google-ai-postmortem.html
huhtenberg · 2011-07-09
http://a1k0n.net/2006/09/15/obfuscated-c-donut.html
Jesus Christ. I love you, dude. Your site must have the highest awesomeness-per-bit ratio on the Internet :)
reycharles · 2012-02-23
The blog post is from 2005[1].
[1]: http://www.a1k0n.net/
te · 2026-04-23
Here's an entrance to the rabbit hole: https://www.a1k0n.net/2021/01/22/indoor-localization.html
_kb · 2025-08-03
That's a bit of a hat tip to donut.c: https://www.a1k0n.net/2011/07/20/donut-math.html
woodrowbarlow · 2024-08-12
see also: donut.c which renders a 3d spinning torus in ascii. https://www.a1k0n.net/2006/09/15/obfuscated-c-donut.html
explanation with animations: https://www.a1k0n.net/2011/07/20/donut-math.html
nanomonkey · 2024-06-16
Fast Tracker 2 in javascript: https://www.a1k0n.net/2015/11/09/javascript-ft2-player.html
marci · 2023-11-16
Is GNU/Donut source code indented to have the shape of a donut?
Or maybe some displays that show ascii donuts: https://www.a1k0n.net/2011/07/20/donut-math.html
nullbyte · 2023-10-28
How it works: https://www.a1k0n.net/2011/07/20/donut-math.html
bakul · 2023-08-29
Some C programs, not all. For example Andy Sloane’s donut.c. Granted, it is beautifully obfuscated but still, it uses just standard C features.
https://www.a1k0n.net/2006/09/15/obfuscated-c-donut.html
bhickey · 2023-06-22
> 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
de_nied · 2021-11-11
Never forget the C donut
https://www.youtube.com/watch?v=DEqXNfs_HhY
https://www.a1k0n.net/2011/07/20/donut-math.html
retro_guy · 2021-06-23
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-b…
- Some people make their own Arduboys: https://www.hackster.io/contests/arduboycontest
smcameron · 2021-03-08
Reminds me of two other things:
* https://www.a1k0n.net/2011/07/20/donut-math.html
* https://www.iquilezles.org/www/articles/distfunctions/distfunctions.ht…
a1k0n · 2018-11-15
The canvases are just some javascript code which draw to the 2d context after a requestAnimationFrame(): https://www.a1k0n.net/js/steering.js
Sure, that sounds good!
fla · 2015-11-19
Don't miss the very interesting blog post http://www.a1k0n.net/2015/11/09/javascript-ft2-player.html
agumonkey · 2014-12-03
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.
dominicgs · 2014-01-23
I had no problems using: gcc -o donut donut.c -lm
You may also have errors in your version of donut.c, try copying the version from http://www.a1k0n.net/2006/09/15/obfuscated-c-donut.html
babawere · 2013-11-15
Click http://www.a1k0n.net/2011/07/20/donut-math.html to see how it works.
tvorryn · 2011-12-24
Haha. It didn't say that before, because he hadn't officially won yet. It's actually been propagated from Tron: http://a1k0n.net/2010/03/04/google-ai-postmortem.html
phreeza · 2010-12-02
His expression of surprise is a reference to the winners post-mortem last round. http://www.a1k0n.net/blah/
unwantedLetters · 2010-12-02
Postmortem of the previous winner: http://a1k0n.net/blah/archives/2010/03/index.html
Shocking how similarly they begin.
Is something going on here of which I am not aware? Why do they both start so similarly?
joshwa · 2007-11-01
from:
http://programming.reddit.com/info/5zikd/comments/
http://a1k0n.net/temp/paperback_sample.png
a more robust implementation:
http://ronja.twibright.com/optar/
kragen · 2022-06-15
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/202… 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…
kimburgess · 2020-10-21
gibsonf1 · 2009-10-02
;; 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…