Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Jun 20th, 2012  |  syntax: JavaScript  |  size: 0.76 KB  |  views: 8  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. var contender_f_and_b_2 = (function () {
  2.     var my = {};
  3.  
  4.     my.sName="FelixAndBertrand 2";
  5.     my.sColor = "";
  6.     my.sColorTest = "";
  7.     my.iPoints = 0;
  8.  
  9.     var iGridWidth;
  10.  
  11.     my.init = function(sColorIn,iGridWidthIn){
  12.         my.sColor = sColorIn;
  13.         iGridWidth = iGridWidthIn;
  14.     }
  15.     my.runTurn = function(fCallback,iMaxMSEC){
  16.  
  17.         var a = Math.round(Math.random() * 100);
  18.         rowsOrCols = (Math.round(Math.random() * 2) === 0);
  19.         for (var b=0; b<100; b++){
  20.             if (rowsOrCols) {
  21.                 $('#t' + a + 'x' + b).css("background",my.sColor);
  22.             } else {
  23.                 $('#t' + b + 'x' + a).css("background",my.sColor);
  24.             }
  25.         }
  26.         fCallback();
  27.     };
  28.  
  29.     return my;
  30. }());
clone this paste RAW Paste Data