A Spreadsheet in 295 bytes of JavaScript
A Spreadsheet in 295 bytes of JavaScript
Main logic by Ondras Zarovi (source),
inspired by Thomas Street,
golfed down by me, subzey, p01 and rlauck. See the commit history.
Features:
- Excel-like syntax (formulas start with "=")
- Support for arbitrary expressions (=A1+B2)
- Automatic localStorage persistence
Source:
<table id=t><script>with(t)A=function(){for(a=h=''
;9>a;a++)for(h+="<tr>",c=0;d=" ABCDE"[c];)h+="<td>
"+(c++?a?t[d+=a]=t[d]?eval("top[d][V='value']="+(l
[d]||"''").replace(/^=/,'')):"<input id=D onfocus=
D[V]=[l.D] onblur=A(l.D=D[V])>".replace(/D/g,d):d:
a)},A(A(l=localStorage),innerHTML=h)</script>