News for hackers. Stuff that matters.

lbatchelor

Your landing page makes a lot of claims that are not true

- that the code is 100% mit licensed (it's not)

- that this is in any way gdpr compliant (there are literal rules around this)

- that your data is encrypted and private (it isn't encrypted? Unless being written in Italian is encryption now?)

- that they'll have 99.9% uptime (there is no SLA for vercel hobby tiers)

- "No middlemen. No third-party storage. Every submission lives in your GitHub..." (that is the very definition of third-party storage and a middleman)

Re:Show HN: A full game of snake encoded in a url on Monday January 09, 2023 @10:48AM (#34311623)
You are on a completely different level. Wow. I am going to spend absolutely too long tomorrow trying to work out how on earth you've done that. Cheers!
Re:Show HN: A full game of snake encoded in a url on Monday January 09, 2023 @09:31AM (#34310708)
Can't update the post now, but I've actually got it down to 713 bytes, which I'm pretty happy with! I could remove features/colors/styles at this point, but I think I'll leave it there for now.

If anyone's interested, I've tried to annotate a fair amount of the tricks I've used so far: https://github.com/lukebatchelor/url-snake/blob/main/golf/de...

let e=document.body,t="Space: start/reset. Arrows: Move<div><canvas id=a><style>#a{border:solid}{background:tan}</style>",r=40,n=400,o,d=[[4,3]],s=d[0],c="#000",p=(e="red",t=n,a=0,l=a)=>{C[f="fillStyle"]=e,C.fillRect(ar,lr,t,t)},h=(e,t=n/2,a=t,l="center")=>{C[f]=c,C.textAlign=l,C.fillText(e,t,a)};e.innerHTML=t,C=a.getContext`2d`,a.height=a.width=n,C.font="30px f",e.onkeyup=({which:e})=>{36<e&&e<41?H=e-38:32!=e||o||(o=1,d=[[4,3]],H=2,S=0)},setInterval(i=>{if(o){let[e,t]=d[0],a=e+H%2,l=t+(H-1)%2,n=([e,t])=>e==a&&t==l;if(d.pop(),a<0||9<a||l<0||9<l||d.some(n))return o=0,p(),h`:(`;d=[[a,l],...d],n(s)&&(d[++S]=d[S-1],s=[(D=new Date)%10,DS%10]),p`tan`,d.map(e=>p(c,r,...e)),p(i,r,...s),h(S,9,30,"left")}},n);

Re:Show HN: A full game of snake encoded in a url on Monday January 09, 2023 @09:18AM (#34310565)
I think it was changed by mods unfortunately :/
Re:Show HN: A full game of snake encoded in a url on Sunday January 08, 2023 @09:44AM (#34299484)
Ooh! Don't know how I missed that, I'll give it a go! Cheers!
Re:Show HN: A full game of snake encoded in a url on Sunday January 08, 2023 @01:03AM (#34296511)
Edit: I've actually managed to get the javascript down to a measly 859 bytes now. Pretty happy with some of the code golfing techniques I came up with
Re:Show HN: A full game of snake encoded in a url on Saturday January 07, 2023 @06:51PM (#34294388)
That was actually the original plan! But unfortunately it seems like my phone's qr code reader won't open it in a browser automatically. I then tried using a url shortener to link to it but absolutely no shortener that I could find would take a data: url.

I could host my own shortener to do it, but it feels like that is cheating the spirit of the challenge.

I'll keep playing with it though, add touch device controls, maybe a site to allow generating different versions of the url (different colours, sizes, game over messages, etc).

Re:Show HN: A full game of snake encoded in a url on Saturday January 07, 2023 @06:46PM (#34294341)
Wow, that's actually impressive. Any idea how chat gpt would know that? Surely it's not making the request for it and surely it's not actually decoding any base64 right?
Re:Making a digital clock in Google Sheets on Saturday December 26, 2020 @04:32AM (#25542365)
Ha! That is so cool. I was super interested in the idea so tried doing it myself without looking at your solution and came up with a quite an elegant solution using only 8 formulas and some named ranges (could be 4 if you inlined them more but I kept them separate for clarity).

https://docs.google.com/spreadsheets/d/1T3bv8ThluHc18ghI8u9m...

Thank you for the inspiration!

Inspired by ts-sql (https://github.com/codemix/ts-sql) and json-parser-in-typescript-very-bad-idea-please-dont-use (https://github.com/jamiebuilds/json-parser-in-typescript-ver...) I decided to try writing a tic tac toe ai in typescripts type system. Mainly as a way to get exposure to more complex typing. It's not as clean or impressive as these other implementations but I learned a lot building it!

Massive shout out to Barld Boot who's tic tac toe implementation I based this off! https://medium.com/@bakeds/play-tic-tac-toe-with-the-help-of...

Re:Cypher on Sunday September 23, 2018 @12:07AM (#18049343)
Not working for me either, in Australia
Oh! Apologies. You are completely right. No idea how I missed that.

Pushed a fix. Thanks for reporting!

Hiya, I pushed a fix last night when someone reported something similar.

I tried your sequence and it looks like it loses now so I think that might be fixed.