Nibbles clone in html/javascript