Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

If they are mapping index 1 to index 0, then it makes sense that 0 would map to -1 since it is one less than the first index. The bug is in the blockly sieve.

As an aside, Lua also uses 1-based indexing.



I understand why they are offsetting the index, it just makes things somewhat unintuitive. In most programming languages A[-1] is the same as A[len(A)-1] (assuming zero based indexing) ... so in Blocky is A[0] expected to mean the same thing as A[len(A)-1]? Nothing here is a show stopper, just a detail that could use a bit of tightening up.


Yeah, I didn't realize it was 1-indexed until you guys pointed it out.

Unsurprisingly, it still works (it just loops a few too many times).




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

Search: