Accessibility Specialist. I focus on ensuring content created, events held and company assets are as accessible as possible, for as many people as possible.
I used a great version of pong in an article on steganography that was something like 460 bytes fully functional with scoring etc. as the thing I was hiding in the image. Blew my mind!
Love your solution.
"The RegEx"...singular? You mean the 10 I have so far 😋🤣
Accessibility Specialist. I focus on ensuring content created, events held and company assets are as accessible as possible, for as many people as possible.
And once you run mine through a compiler / minifier and gzip them both up you saved...39 bytes! (1569 bytes vs 1530 bytes).
Those were the numbers I was talking about anyway, I don't work in Raw bytes as they are meaningless, gzipped and minified are the numbers that matter for network performance and sometimes more raw bytes means lower gzipped bytes!
I am not going to share minified code with people if I expect them to be able to dig around in it.
To really golf this you would have to completely rewrite most of it as the regexes are about 70% of the weight. Combining them into one gigantic RegEx would be one way and using capture groups.
Have a look at the page Alex linked the engine he used for his syntax highlighter was 140 bytes!
It quadruples the size! (The total is 562 bytes gzipped, damned impressive!)
Not sure if he fixed the problem in the comments where function(a,b){b/=2;return (a+b)/b;} is highlighted as a RegEx but mine can deal with that at least.
And above all....why are you golfing this silly monstrosity! I have no intention of making a WYSIWYG code editor combination in real life as I said 🤣 it lets you do things that are so so wrong like having a <h1>function(){</h1> - it hurts, it hurts so much! 😋
Hopefully both of those will give you some ideas on how to really "golf" them, but you would almost certainly be starting from scratch to get any meaningful gains over my code.
Accessibility Specialist. I focus on ensuring content created, events held and company assets are as accessible as possible, for as many people as possible.
Accessibility Specialist. I focus on ensuring content created, events held and company assets are as accessible as possible, for as many people as possible.
I always enjoy seeing people "Golf" things.
I used a great version of pong in an article on steganography that was something like 460 bytes fully functional with scoring etc. as the thing I was hiding in the image. Blew my mind!
Love your solution.
"The RegEx"...singular? You mean the 10 I have so far 😋🤣
Your code, cut in half.
I can definitely decrease it more. But that's enough for a WYSIWYG.
And once you run mine through a compiler / minifier and gzip them both up you saved...39 bytes! (1569 bytes vs 1530 bytes).
Those were the numbers I was talking about anyway, I don't work in Raw bytes as they are meaningless, gzipped and minified are the numbers that matter for network performance and sometimes more raw bytes means lower gzipped bytes!
I am not going to share minified code with people if I expect them to be able to dig around in it.
To really golf this you would have to completely rewrite most of it as the regexes are about 70% of the weight. Combining them into one gigantic RegEx would be one way and using capture groups.
Have a look at the page Alex linked the engine he used for his syntax highlighter was 140 bytes!
But yet again, once you add the RegExs back in...
It quadruples the size! (The total is 562 bytes gzipped, damned impressive!)
Not sure if he fixed the problem in the comments where
function(a,b){b/=2;return (a+b)/b;}
is highlighted as a RegEx but mine can deal with that at least.And above all....why are you golfing this silly monstrosity! I have no intention of making a WYSIWYG code editor combination in real life as I said 🤣 it lets you do things that are so so wrong like having a
<h1>function(){</h1>
- it hurts, it hurts so much! 😋Hopefully both of those will give you some ideas on how to really "golf" them, but you would almost certainly be starting from scratch to get any meaningful gains over my code.
No, the one that is used for my version:
Yours is an example of readability by comparison. 😁
Yeah but I couldn’t work out how to also do different colours, unless I used match groups I suppose and increment the group in the loop...
Probably could be done but obviously the idea is this is a base for something useful so I don’t think I will even try it! 😜🤣
That's exactly what I did.
Ah yes, I see it now, being a non code golfer I didn't get that was a counter you had implemented!