Sheet
May, June 2014 - October 2017
A mini Excel clone in 188b/253b/277b, golfed in 2014 and enhanced during #golfctober 2017.
Features:
- supports any value: texts, numbers, floats, and formulae. Ex: "=A1+8"
- cells update in cascade, circular reference protection
- implicit Math object. Ex: "=sqrt(A1)"
- localStorage persistence
Read the commented source code of each demo to learn how they work!
- Github
- Website
Full:
o=b=>{for(i in{}+o)with(M=Math)M[y='ABCD'[i%5]+-~(i/5%6)]=b?document.write(y&&
i<30?`<input placeholder=${y} id=`+y:'<br',` onfocus=value=[l[id]] onblur=l[id
]=value,o()>`):(top[y].value=[/^=/.test(z=l[y])?eval('x'+z):x=z],x-~x?+x:x)};o
(o(l=localStorage))
Mini (supports numbers and formulae, no localStorage):
(o=v=>{for(i in z='<input onblur=o[id]=value;o`.value` id=')y="
ABCD"[i%5]+-~(i/5),v?eval(y+(v+o[y]).replace(/[A-Z]\d/g," +$&"+
v)):document.write(y||'<p ',z,y,' onfocus=value=[o[id]]>')})()