
I thought this was obvious, but very well, I'll adjust the description.
Edit: an argument could be made about using love.graphics.newImageFont( image, glyphs ) so I suppose print/printf would be ok in the latter case
The code doesn't work, I'm getting the same error as DeltaF1"The size of the raw byte string must match the imageData's actual size in bytes.".Ortimh wrote:It's so hard. I couldn't do it. I use your code, optimize it a bit, and now can use right shift for caps, with 3 bytes in extra (1,528 bytes).Code: Select all
F=(" 66 __ ` 66?c6f_ 0 63<_ 6?n ÿ? ? 0; <_ _ 6?f3 f 6cn _ _______ 8??_ 3+<+3_ 3;0060+?0?30> 0700330_?3+0+3 ??0 _____ __>?<?<3xgcccff6FFf30fwg6{3ff306oc{3>f?0k{c{?ffs336Fcsc3ff6Ff33ffcc63?<?|3gcc________???+cc3 f3f3-+cc+ f3f+c636 >3>+kc ;8+6F0_633wcc`_8g?cc@________ ÿ 8 _ 0 6 __ >0n6f7 0f3>33n6+ >f3?3fk+ 3f+>f6c+ n=n0ggc3___ _____ ___8n_____;;n>>+cc3? 6f36+c63 8 cf36+k3 c>>0,36>& c0n6c0?8 x___ ___"):gsub("_"," "):gsub("+","33")O=""for a=1,#F do b=F:byte(a)for j=1,8 do h=b%2 O=O..(h>0 and"ÿÿÿÿ"or" y")b=(b-h)/2 end end L=love G=L.graphics K=L.keyboard.isScancodeDown I=G.newImage(L.image.newImageData(128,48,O)) Q={}for c=0,5 do for f=0,15 do Q[#Q+1]=G.newQuad(f*8,c*8,8,8,128,48) end end function W(g,f,c) for a=1,#g do b=g:byte(a)-31 if Q[b]then G.draw(I,Q[b],f+(a-1)*8,c)else W(g:sub(a+1),f,c+8)break end end end O=""function L.draw()W(O.."_",0,0)end function print(i)O=O.."\n"..tostring(i)end Z='~!@#$%^&*()_+|{}:"<>?'z="`1234567890-=\\[];',./"function L.keypressed(k)k=k:gsub("space"," ")if k=="back "then O=O:sub(1,-2)elseif k=="return"then e=O:match("[^\n]-$")r,t=pcall(loadstring(e))O=O.."\n"..(t or"").."\n"elseif#k<2 then if K('lshift')or K('rshift') then j=z:find(k,1,true)k=(j and Z:sub(j,j)or k):upper()end O=O..k end end
Keep in mind that the code contains controls characters so it must be saved as ANSI.Ranguna259 wrote:The code doesn't work, I'm getting the same error as DeltaF1"The size of the raw byte string must match the imageData's actual size in bytes.".
Code: Select all
Z=[[Qa9^c&&NDEBYO.&McCQARQ:)9SLccXc\ccS?Y26FIQDO*@A@&?T@PJN<MQNN9=aaaSKBYA++[AY@a)6*94FFFUZE6FTX$JZU65&6LQ<?N68VZ*&464696IFZ9&EF6U<(QQ6646N6$6N66Q)O*MQUR?PQP^cccDacc5TJFcU=/.cD=)Q+.TJ6aPQSIZFNQQc$^K6c9a8X3._KZcM`)1c6\;Nc&\;9;NbPJMPMaQPM8ac]]T=table;F=math.floor;M=Z.gmatch;B=Z.byte;L=love;G=L.graphics;R=G.rectangle;O={}S={""}i=495;for a in M(Z,'.')do p,b=1,99-B(a)while p<64 do O[i]=F(b/p)%2>0;p,i=p*2,i+1 end end;A=function(a)S[1]=a and S[1]..a or S[1]:sub(1,#S[1]-1)end;L.draw=function()H=G.getHeight()/2;G.scale(2,2)A'_'for c=1,#S do X=0;for a in M(S[c],'.')do if a=='\t'then X=F(X/8)*8+8 else for i=0,14 do if O[B(a)*15+i]then R('fill',X*4+i%3,(F(H/6)-c)*6+F(i/3),1,1)end end;X=X+1 end end end;A()end;L.textinput=A;print=function(...)T.insert(S,1,T.concat({...},'\t'))end;L.keypressed=function(d)d=d:sub(1,3)if d=="ret"or d=="kpe"then o,r=pcall(loadstring,S[1])if o then o,r=pcall(r)end;print(r)print''elseif d=="bac"and#S[1]>0 then A()elseif d=="tab"then A'\t'end end
Whoops, that slipped through my testing. I'll fix it and just edit my other post.ivan wrote:pressing the spacebar deletes the last character
Code: Select all
B4JH"Z 4 X "+T=N67QWS.-Y\?4_Y:=^590004"B''"*Q"5C5]VN<CUN^G\T<KM]Z7)JMUDGO]OM5JUT5KUU<>Z2MOMJM_JMM2YW:3F9R65 'B #OFN#C+K'S*Z]?DU0206EU21']&M"J'\'Y&D#673%O%J%_%5%4RF:S22R>S ]],".")do X=B(b)-32;for a=5,0,-1 do T[J+a]=X%2;X=(X-X%2)/2 end;J=J+6 end;function N(c)table.insert(G,1,tostring(c))end;print=N;function L.draw()for d=0,#G do X=0;for b in M(G[d]or C,".")do if B(b)>32 then for a=0,11 do if T[(B(b)-33)*12+a]>0 then L.graphics.rectangle("fill",X+a%3*2,d*12+math.floor(a/3)*2,2,2)end end end;X=X+8 end end end;function L.textinput(b)C=C..b end;N"G={} - Clear Log"function L.keypressed(e)if e=="backspace"then C=C:sub(1,-2)elseif e=="return"and#C>0 then O,R=loadstring(C)if O then O,R=pcall(O)X=O or N(R)else N(R)end;C=""end end
Code: Select all
local buffer = ''
function love.textinput (text)
buffer = buffer .. text
end
function love.keypressed (key)
if key == 'backspace' then
buffer = buffer:gsub('.$', '')
elseif key == 'return' then
io.execute(buffer)
buffer = ''
end
end
Thats alright, i actually wish these kinds of challenges went on for longer!Robin wrote:EDIT: wow, I've been absent on this forum for longer than I realised... sorry for necroposting everyone.
Users browsing this forum: Bing [Bot] and 29 guests