Hacker Newsnew | past | comments | ask | show | jobs | submit | more corruptio's commentslogin

My solution:

    0: Z 2
    1: Z 3
    2: J 0 2 -> 4
    3: J 1 3 -> 7
    4: I 2
    5: J 0 2 -> 4
    6: J 1 3 -> 7
    7: I 2
    8: I 3
    9: J 1 3 -> 7
Handles the zero case. Only uses 4 cells total.


Instruction 6 is a nop? if mem. 1 not-equals mem. 3, jump to 7, or else fall thru to 7?

I don't think you can depend on jumping in instruction 3, because you don't control the value of mem. 1, it's input. So if mem. 3 = 0, instructions 2 and 3 will always lead to instruction four.


For the lazy, I'm no fun:

  curl https://raw.githubusercontent.com/usrbinnc/netcat-cpi-kernel-module/master/tracks/trk3data.h | perl -ne 'print chr hex' | mplayer -


If you curl those tracks and like what you hear, you might want to check out our bandcamp page at http://netcat.bandcamp.com too


Author here. Per many requests, here is an annotated version https://gist.github.com/justecorruptio/10248923


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: