def realCoin(coins):
coinArray = []
for coin in coins:
coinArray.append(coin.value)
for index in range(len(coinArray)):
value = coinArray[index]
for j in range(index, len(coinArray)):
val = coinArray[j]
if value != val:
self.say(value)
return coins[index]
loop:
items = self.findItems()
item = realCoin(items)
if item:
self.moveXY(item.pos.x, item.pos.y)
I’m at a complete loss here. Is there a level that might help lead me into this? This level was played out of order but even going back to it at the end of the desert I have not idea how to compare the value of two coins.
I can:
create a variable and set it to 0
initialize the loop index
while the index is less than the length of the coins array
*** and here’s the problem, how do I compare this coin to the previous to know if it’s the same ***
no idea what code to say skip it
if it’s different then collect it (I think I can figure this out)