Guest User

Untitled

a guest
Dec 18th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. MyUtils = new Object();
  2. MyUtils.initial = function () {
  3.     Billboard(10,10);
  4.     addChar(2, 2, 'ABBA');
  5.     draw();
  6. }
  7.  
  8. var Billboard = function(numRows, numCols){
  9.    
  10.     // matrix for the billboard
  11.     this.raster = [];
  12.     // create function to initialize matrix
  13.     this.init = function() {
  14.         for (var i = 0; i < numRows; i++) {
  15.             this.raster[i] = [];
  16.             for (var j = 0; j < numCols; j++) {
  17.                 this.raster[i][j] = '.';
  18.             }
  19.         }
  20.         // run initializer
  21.         this.init();
  22.     }
  23.  
  24.     this.addChar = function(posX , posY, woord) {
  25.         var teller = 0;
  26.         for (var i = posY; i < (posY+woord.length); i++) {
  27.             this.raster[posX][i] = woord.charAt(teller);
  28.             teller++;
  29.         }
  30.     }
  31.  
  32.     this.draw = function() {
  33.         var strArr = "";
  34.         for (var i = 0; i < this.raster.length; i++) {
  35.             strArr += this.raster[i] + '\n';
  36.         }
  37.         WScript.StdOut.Write(strArr);
  38.     }
  39. }
Add Comment
Please, Sign In to add comment