Converting this python logic into C#
<p>I have been searching for an example implementation of a influence map spreading algorithm and I found one written in python, i thought, great! Since I have used python in the past and I thought it would be simple to understand the core ideas of the algorithm.</p>

<p>However I found this rather cryptic implementation : </p>

<pre><code># spread the influence
while iterations:
    neighbors[:-1,:] += weightmap[1:,:] # shift up
    neighbors[1:,:] += weightmap[:-1,:] # shift down
    neighbors[:,:-1] += weightmap[:,1:] # shift left
    neighbors[:,1:] += weightmap[:,:-1] # shift right
    # keep influence values balanced
    neighbors *= FACTOR
    # prepare for next iteration
    weightmap,neighbors = neighbors,weightmap
    iterations -= 1
</code></pre>

<p>Now, I looked into the python docs and found out about those "matrices selection" of "from:to". However, translating what I thought was the C# equivalent, I found myself looking at a piece of code that didnt make much sense.</p>

<p>So I turn to you, how would I translate that piece of code into C#? Assuming normal building blocks like While( something ), For(;;) and array[posX, posY] = something.</p>

<p>Thank you</p>
