l4sgc

joined 1 year ago
 

[the video] [github]

TL/DW: The contest is to submit a C# chess bot in which the code uses a maximum of 1024 tokens. (Every usage of a variable, value, function, and operator, counts as a token)

[–] [email protected] 2 points 1 year ago

I'm a full-stack web developer. I mainly focus on frontend TypeScript/Angular at the moment, but we still support older products made with JavaScript/AngularJS. Across different projects I have had backends using php, Python/Django, Java/JSP, C#/asp.net, JavaScript/Express. Some languages have features or frameworks that make them easier for certain use cases, but sometimes I don't have any choice and one type of server is required to interface with external code or applications.

I don't know how likely it is that you will encounter a situation where Java is required, but that situation did arise for me and I am still forced to use it to support one of our products. If I had a choice though I would always pick C# over Java, since C# is pretty similar, but in my opinion every change is an improvement, and I feel like it has a lot of extra features.

Your preferences might be different though so I agree with the other sentiment that you should give everything a try, and see which languages/frameworks appeal to you and you want to learn more about.

[–] [email protected] 4 points 1 year ago

Didn't know about rcv123 before, I like how it shows all the stages of the tally

[–] [email protected] 4 points 1 year ago

Woops, can you tell my teachers were always on my case for misreading the assignment :P

[–] [email protected] 4 points 1 year ago

Oh I totally missed that the trunk was part of the spec, gotta fix my own answer too

[–] [email protected] 2 points 1 year ago* (last edited 1 year ago) (2 children)

My JavaScript solution - ~~82~~ 103 chars:

~~a=n=>{for(s='',i=1;i<=n;i++)s+=' '.repeat(n-i)+'* '.repeat(i)+'\n';console.log(s)}~~

a=n=>{for(s='',i=0;++i<=n;)s+=' '.repeat(n-i)+'* '.repeat(i)+'\n';console.log(s+' '.repeat(n-2)+'| |')}

I'm happy I was able to beat ChatGPT, it had the same strategy but used additional for loops instead of string.repeat(), so it was 113 chars. But I suspect further improvements might be possible with array.reduce or other prototype functions I'm forgetting about.

[–] [email protected] 3 points 1 year ago (2 children)

Just for fun I asked ChatGPT and got a Python in 65 chars:

def p(n):print('\n'.join(' '*(n-i)+'* '*i for i in range(1,n+1)))

Since I'm most familiar with JavaScript I'll try that myself now

[–] [email protected] 3 points 1 year ago

Wow I saw that my angular projects used core-js, but it seemed so massive and fundamental that I assumed it had the backing of a large company like angular itself. It's staggering to see that it was largely being held up by a single person and I hope their situation has improved since writing that blogpost. I can't even begin to imagine donating so much time and energy to a project even in spite of getting so much hate in return.

[–] [email protected] 3 points 1 year ago

Yes letting everyone choose their own icon shape is a great idea, and thanks for sharing that script, I've been missing the compact view!

[–] [email protected] 5 points 1 year ago

You need to provide information about what engine / framework / sdk you are using. If you are using something like GameMaker Studio all you have to do is click Windows in the target build platform list instead of Android. If you aren't using a game engine that supports multiple platforms you may have to redo all the java code related to UI and input yourself to work on Windows, but it is impossible to say without knowing more about how your project is set up.

[–] [email protected] 2 points 1 year ago (5 children)

My top choice for icon shape is definitely the vertical hexagons we have now, but the poll should probably include options for both vertical and horizontal hexagons. Maybe square and squircle as well.

[–] [email protected] 5 points 1 year ago

Doing web-dev it's not uncommon for me to run into libraries with poor documentation or missing examples. I could spend a lot of time trying to find the official docs, read through pages, not really find what I'm looking for, go to stackoverflow, maybe find something better maybe not. Now my first step is just asking ChatGPT my question. More often than not it gives me a working example, I get an answer faster than it would take to navigate official docs, and I can immediately get answers to followup questions or ask it to modify the example to be closer to what I actually need for my application.

[–] [email protected] 5 points 1 year ago

I've never even noticed an undo-copy option before, but as someone who frequently misses the button I intended to click, this is terrifying. Gonna have to git commit before every time I open explorer.

view more: next ›