Skip Navigation
Sebastian Lague's Tiny Chess Bot Coding Challenge

[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)

1
Challenge: Function that prints a `n` big tree
  • 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.

  • What are some examples of xkcd 2347?
  • 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.

  • Porting android game to pc with same code?
  • 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.

  • Is there any Linux tablet similar to a surface
  • Yes, I guess @Apostato@beehaw.org is right though that software compatibility for arm is improving, so it really depends on your use-case and workflow. I don't remember exactly what I was doing at the time I just remember the program I wanted couldn't run on arm.

  • Is there any Linux tablet similar to a surface
  • I tried a few different linux distros on various chromebooks, and regardless of if you pick a chromebook or another device, I highly recommend you don't get a device with an arm-based cpu. Pick a 2-in-1 that has a normal x86 processor so you don't have to deal with compatibility issues.

  • Are you still using AI tools to help with development?
  • 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.

  • Can you trust ChatGPT’s package recommendations?
  • I wouldn't trust the packages used by an LLM, or any other part of code they write, or any other text response they generate. Everything must be treated skeptically and verified!

    I use ChatGPT daily to assist with my job as a fullstack web developer. If I'm asking it for boilerplate code, I already know exactly what it should look like, and having ChatGPT generate the code and then proofreading it myself is usually a small timesaver. And even if it's not, the lower perceived effort on my part is beneficial for my mental load.

    When I ask it for code where I don't already know the 'right' answer (e.g. refactoring an algorithm to use loops instead of recursion, example for library with poor documentation, creating new function from scratch), I always write a series of test cases to ensure the code behaves as expected.

    Similarly if it suggests a library I am unfamiliar with, I'll check it's github or stats on npmjs to verify it's maintained and commonly used. Though it almost always picks the same library that I had picked previously (when one of my previous projects was in a similar situation). Probably because those libraries were the most commonly used. I never experienced a made up import; however, there were a couple instances where it made up a function that did not actually exist inside of the library.

  • InitialsDiceBearhttps://github.com/dicebear/dicebearhttps://creativecommons.org/publicdomain/zero/1.0/„Initials” (https://github.com/dicebear/dicebear) by „DiceBear”, licensed under „CC0 1.0” (https://creativecommons.org/publicdomain/zero/1.0/)L4
    l4sgc @programming.dev
    Posts 1
    Comments 11