Commits

Sven Hendriks  committed 84bb325

Added vim modeline; Moved from tabs to spaces.

  • Participants
  • Parent commits 839dbd3
  • Tags 0.0.1b

Comments (0)

Files changed (1)

File jquery.conway.js

+/* vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4
+*/
 /**
  * jQuery conway plugin
  * Copyright (c) 2011, Sven Hendriks (hendriks.sven@googlemail.com)
         for(k = i-1; k <= i+1; k += 1) {
             for(l = j-1; l <= j+1; l += 1) {
                 if( ! (k===i && l===j)) {
-                //    continue;
-                //}
-                if(k < 0) {
-                    y = conf.rows - 1;
-                } else if(k >= conf.rows) {
-                    y = 0;
-                } else {
-                    y = k;
-                }
-                if(l < 0) {
-                    x = conf.cols - 1;
-                } else if(l >= conf.cols) {
-                    x = 0;
-                } else {
-                    x = l;
-                }
+                    if(k < 0) {
+                        y = conf.rows - 1;
+                    } else if(k >= conf.rows) {
+                        y = 0;
+                    } else {
+                        y = k;
+                    }
+                    if(l < 0) {
+                        x = conf.cols - 1;
+                    } else if(l >= conf.cols) {
+                        x = 0;
+                    } else {
+                        x = l;
+                    }
 
-                // loop over bits
-                for(bit = 0, op = 1; bit < how_many_bits; bit += 1, op <<= 1) {
-                    if((grid[y][x] & op) !== 0) {
+                    // loop over bits
+                    for(bit = 0, op = 1; bit < how_many_bits; bit += 1, op <<= 1) {
+                        if((grid[y][x] & op) !== 0) {
                         sums[bit] += 1;
+                        }
                     }
                 }
-                }
             }
         }
         return sums;