Incorrect colors as squares

Project link:

1-sentence description of the issue:
Incorrect colors as squares

What do you want your code to do?
Be green or dark green based on the tile string
It is supposed to be dark green once.
1 = green 2 = dark green

What is the code currently doing?
Being dark green 3 times

Screenshots:

9 Likes

I checked it out, did a little debugging and realized that it stops acknowledging the 1 as a 1 (or something like that, doesn’t make much sense) and does the else option instead.
I noticed that if you split the string in tile to multiple paragraphs, it fixes the problem. Not sure what causes it.

I’m wondering if you use letters instead of numbers you might not have to split the string.

I’ll bet @/Tri-Angle is gonna give a better resolution~

9 Likes

i did not check the code and i bet that adding a non-number character at the end of the string will fix the problem :sunglasses:

edit: confirmed, adding a non-number character wherever in the variable fixes the problem - hopscotch is struggling with big numbers.
if you saw my post explaining my new pixel art method and you’re trying to implement my concept in your code, please give me a temporary credit until the official release. thank you.

8 Likes

Floating point // rounding errors

Add a character to the string that’s not a number before getting characters between () and ()

8 Likes

Imo, it’s probably just easier to use letters instead of numbers. At least you can avoid this issue altogether.

7 Likes

I used a backslash because spaces or letters might confuse me.

7 Likes

I wasn’t, I was just trying to make cool tiles without using clones

7 Likes

okay good to hear, because mine is exactly like yours but with algebra haha :sweat_smile: good luck on your project ;)

7 Likes

@Bobinny, i think the bug has been fixed, right?

ugh i really hope we have pokes

2 Likes

Yep this is solved

3 Likes

I think poking people to topics are gone

1 Like

@Bobinny Clive?

3 Likes

Since it’s been marked as solved, I can close it. Feel free to let us know in Leaders QnA if anyone wants it opened again.