Legends of Code & Magic - Puzzle discussion

I’m pretty sure this is the problem.

    const cardCount = parseInt(readline());
    for (let i = 0; i < cardCount; i++) {
        var inputs = readline().split(' ');
        const cardNumber = parseInt(inputs[0]);
        const instanceId = parseInt(inputs[1]);
        const location = parseInt(inputs[2]);
        const cardType = parseInt(inputs[3]);
        const cost = parseInt(inputs[4]);
        const attack = parseInt(inputs[5]);
        const defense = parseInt(inputs[6]);
        const abilities = inputs[7];
        const myHealthChange = parseInt(inputs[8]);
        const opponentHealthChange = parseInt(inputs[9]);
        const cardDraw = parseInt(inputs[10]);
    }

Notice that we’re not writing with i, we’re just incrementing it. That would explain why the only values I can get are the right-most (i.e. the last to be written), because it’s just over-writing them.

I tried to adjust it, but it throws an error (“I’m not reading all the information before”… etc). Unless I’m misunderstanding, this means this puzzle isn’t solvable in Javascript.

Have you tried adding the code to store the inputs your code has read in a list/array/etc for further processing?

I do see 238 players coding in JavaScript in the puzzle’s leaderboard, so the puzzle is perfectly solvable in JavaScript.

Hmmm. That’s interesting! I did, but I only tried the one and it threw that error. Clearly there’s a workaround that I’m missing.

I found a workaround. I just deleted that section and re-wrote it.

There has to be a simple way to push to Silver. Pushing to Bronze is easy. Wood 1 and 2 choose the min value cards, and if you can attack the opponent cards and the player your cards you win (left to right). When guards (pick at least 5) are available leave 2 or 3 slots open for other cards on the board and don’t attack with your guards. Also for wood 3 switch to picking the max value cards.

As part of the league Wood 2, I cannot understand why I am losing health points for no reason.

It seems that each time I cannot draw one card I lose up to 5 health points!

Is it possible to actually beat the bronze boss ? It feels like I am trying to catch up with my own tail. Boss score was 24.68 mine was 24.27. I have tinkered with bot configurations and managed to get 24.86 but boss now is at 25 scoring. is it just a bad luck or something else?

for anyone trying to push it, it might be just an rng. I managed to push to silver while being stuck at #1 in bronze just by pure luck frankly speaking. didn’t change anything and just relaunched the bot in arena. Boss managed to loose more and i got in. It felt kinda clunky and lazy but sometimes it might work

Hi, i was wondering

I am a javascript web developper, i like bot battle, but is there any sense to create AI “by hand” when machine learning exist ?

I enjoy this puzzle a lot as Legend of runeterra top 200 competitive player.

Can i compete with machine learning ?

TY

There’s not a lot of machine learning going on even at the top of the leaderboard, other than letting your bot play against a different version of itself to get some stats (e.g. to learn what cards to draft). There are games where the top spots have been taken over by neural networks; this is not one of them (yet).