We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.

Loops – is “i” necessary or just a name for individual object in group?

Home Forums Puzzles Loops – is “i” necessary or just a name for individual object in group?

Viewing 15 posts - 16 through 30 (of 40 total)
  • Author
    Posts
  • #71458
    c4cc
    Participant

    I made the change as indicated in red. Still not working

    430878484-289536107492906-2424992886442237375-n

    #71459
    kdv
    Participant

    Use debugging. See the console log.

    Puzzles and JS coding. Fast and expensive.

    If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of the meaning at all.

    #71529
    c4cc
    Participant

    Sorry for late reply. I did try to use debugging, still no change

    oile46x1

    • This reply was modified 9 months, 1 week ago by c4cc.
    #71533
    kdv
    Participant

    Your stats dictionary is empty. You did some mistake when creating a list of clones. Debug every step.

    Puzzles and JS coding. Fast and expensive.

    If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of the meaning at all.

    #71547
    c4cc
    Participant

    Debugged:

    oile46x1

    oile46x1

    It says undefined, yet for some reason, you didn’t define the enemy clones for clone in the testapp, yet it works?

    #71548
    c4cc
    Participant

    Should work exactly like here https://v3d.net/trh

    Here you didn’t define the original enemy (as dicts)? Yet yours could still work

    #71549
    kdv
    Participant

    you didn’t define the original enemy

    it’s not a variable to be declared and defined.

    In you case two variables used in the loop are defined after this loop did its work.

    Puzzles and JS coding. Fast and expensive.

    If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of the meaning at all.

    #71554
    c4cc
    Participant

    In you case two variables used in the loop are defined after this loop did its work.

    I see, how did you define those variables before the loop worked? Yours were also outside the loop as well.

    • This reply was modified 9 months, 1 week ago by c4cc.
    #71556
    kdv
    Participant

    I just placed them BEFORE the loop. You placed those variables AFTER the loop.

    How are puzzles being executed in terms of sequence?

    Puzzles and JS coding. Fast and expensive.

    If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of the meaning at all.

    #71565
    c4cc
    Participant

    I just placed them BEFORE the loop. You placed those variables AFTER the loop.

    I placed them before the loop too now, yet I can’t get the individual clones to be removed as you did?

    430878484-289536107492906-2424992886442237375-n

    #71566
    kdv
    Participant

    BEFORE the loop!!! Not inside the loop! You absolutly don”t understand what you are doing? :scratch: Just forget it. I’m out, I can’t help you.

    Puzzles and JS coding. Fast and expensive.

    If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of the meaning at all.

    #71569
    c4cc
    Participant

    Sorry for the stupid-ass mistake, I was stressed out just now doing stuff. Finally fixed it, it works now. Thanks for helping me man. :good:

    Attachments:
    You must be logged in to view attached files.
    #71597
    c4cc
    Participant

    Btw, I found another undefined error as highlighted:

    oile46x1

    Do I have to assign that BattleStats to a dict before the “i-enemy” loop?

    • This reply was modified 9 months, 1 week ago by c4cc.
    #71599
    kdv
    Participant

    No. You just trying to get wrong keys.

    Puzzles and JS coding. Fast and expensive.

    If you don’t see the meaning in something it primarily means that you just don’t see it but not the absence of the meaning at all.

    #71604
    c4cc
    Participant

    So if I am to define that “BattleStats” outside the loop to solve that undefined error, you also didn’t define your “params” out of the loop in your example as here:

    Should work exactly like here https://v3d.net/trh


    Should work exactly like here https://v3d.net/trh

    I apologize if my question is stupid, but I don’t know how you managed to insert a dict into a loop without defining it outside the loop.

    • This reply was modified 9 months, 1 week ago by c4cc.
    • This reply was modified 9 months, 1 week ago by c4cc.
    • This reply was modified 9 months, 1 week ago by c4cc.
Viewing 15 posts - 16 through 30 (of 40 total)
  • You must be logged in to reply to this topic.