Why this this code only output ""? (Codeingame's Thor challenge) : <p>I need help finding the mistake I have made with an alternative approach through diferences of the x and y values on the Thor-challenge of Codeingame.</p>

<p>Here is the code of the game loop:</p>

<pre><code>// game loop
    while (1) {
        int remainingTurns; // The remaining amount of turns Thor can move. Do not remove this line.
        cin &gt;&gt; remainingTurns; cin.ignore();
        int difx = lightX-initialTX;
        int dify = lightY-initialTY;
        float mathquot=dify/difx;
        string out ="";
        if(difx==0 || dify==0){
            if(difx=0){
                if(dify&lt;0) out="W"; initialTY-=1;
                if(dify&gt;0) out="E"; initialTY+=1;
            }
            if(dify=0){
                if(difx&lt;0) out="N"; initialTX-=1;
                if(difx&gt;0) out="S"; initialTX+=1;
            }
        }else{
            if(mathquot&gt;0 &amp;&amp; (difx&gt;0 &amp;&amp; dify&gt;0)) out="SE"; initialTY +=1; initialTX+=1;
            if(mathquot&gt;0 &amp;&amp; (difx&lt;0 &amp;&amp; dify&lt;0)) out="NW"; initialTY -=1; initialTX-=1;
            if(mathquot&lt;0 &amp;&amp; difx&lt;0) out="SW";  initialTY +=1; initialTX-=1;
            if(mathquot&lt;0 &amp;&amp; dify&lt;0) out="NE";  initialTY -=1; initialTX+=1;
        }
        // Write an action using cout. DON'T FORGET THE "&lt;&lt; endl"
        // To debug: cerr &lt;&lt; "Debug messages..." &lt;&lt; endl;


        // A single line providing the move to be made: N NE E SE S SW W or NW
        cout &lt;&lt; out &lt;&lt; endl;
    }
</code></pre>
