N
N
NubasLol2018-07-19 16:46:12
Twig
NubasLol, 2018-07-19 16:46:12

Twig's if statement not working properly, why?

{% for i in 0..9 %}
    <tr>
        {% for j in 0..9 %}
            <td id ="{{ i ~ j }}"
                    {% if gameArray[i][j] == "killed" %}
                        {{ 'class="killed"' }}
                    {% endif %}

            >
                {{  gameArray[i][j]}}
            </td>
        {% endfor %}
    </tr>
{% endfor %}

Now there is not a single cell with the value "kill" in the array, but it still assigns the class kill everywhere

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question