Gem by gem: Is there something wrong with my code?


#1
baseGem = hero.findByType("root-gem")[0]
# Those gems are not linked yet.
freeGems = hero.findByType("gem")

# Use the property "next" to link elements to the list.
# Append an element before the base gem.
freeGems[0].next = baseGem
# And one more at the new head of the list:
baseGem.next = freeGems[1]
# Next add more gems at the end.
freeGems[1].next = freeGems[2]
# Add two more gems one by one:
freeGems[2].next = freeGems[3]
freeGems[3].next = freeGems[4]
freeGems[4].next = freeGems[5]
while True:
    if hero.isPathClear(hero.pos, {"x": 76, "y": 34}):
        hero.moveXY(76, 34)

I know there is something wrong as the final gem does not move in to place and open the door for me.

I think it should be in this area:

freeGems[4].next = freeGems[5]

#2

By the way are any of u above or at level 66?


#3

That is impossible. (20 characters)


#4

Kinda, possible, if you spend a loooooong time simulating;)


#5

Nope. Because of the diminishing return, it would take a lifetime of simulating. Not sure even that would be enough. It gets to the point where millions upon millions of simulations only yield a couple of hundred XP points and gems.

Trust me, I know from experience.


#7

Or try this on like a lot of computers.


Try gem farming.


#8

gem farming = simulations

At one point I was using about 20 or so computers with approximately 80 - 100 tabs running in the browsers. It was too long ago to remember exactly. But it gets to the point where you simulate/farm for days and get next to nothing for it. 60 million simulations yielded little more than 50 million.

If level 66 was attainable, someone would have done it by now. The highest I’ve ever seen anyone’s level is in the forties. BTW, I got that # from scanning the clans member lists when looking for a clan with a lot of active, high-level members and a message board to communicate (still haven’t found one).

What’s the highest level you’ve ever seen?


#9

level 45(20 characters)


#10

That’s about the same as the highest I’ve ever seen. With an additional 21 levels to go and each level increasing in size, my best guestimate would be that level 66 isn’t currently possible with the game the way it presently exists.


#11

back to the topic, I think

freeGems[4].next = freeGems[5]

is wrong


#12

Yes it is, but you would have to hack, as the replayable levels give lots of exp and gems.


#13

How is repeating replayable levels considered a “hack?”


#14

IT isn’t, getting to level 66 because of those replayable levels would require at least level 11 from each, which is definitely hacking.


#15

hint:
reorder your sequence
freeGems[0].next = freeGems[1]


Gem by Gem problems
#16

Without hacking is what I mean, okay?


#17

Theoretically you could do it, you’d just have to have massive computing power, like having the whole CPU of a supercomputer dedicated to simulating games, since codecombat uses the computer processor to run most of the game. :stuck_out_tongue:


#18

No, not even theoretically. The formula for the diminishing return is 20x^0.4, where x is the number of games simulated. Eventually, you get zero return for billions of simulations. The more you simulate, the less you get. The following link contains an interactive graph with the formula. A massive, NSA-style supercomputer would just get you to zero return faster.

Formula link.

Is simulating worth it? Heck yes it is. Especially if you need better gear and don’t have the
$cash to spend. But I don’t care how long you simulate or how powerful your computer is - eventually you reach a point (after many millions of simulations) where you get little or nothing for your efforts.

`


#19

Oh. Makes sense. (20 chars)