Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- MyUtils = new Object();
- MyUtils.initial = function () {
- Billboard(10,10);
- addChar(2, 2, 'ABBA');
- draw();
- }
- var Billboard = function(numRows, numCols){
- // matrix for the billboard
- this.raster = [];
- // create function to initialize matrix
- this.init = function() {
- for (var i = 0; i < numRows; i++) {
- this.raster[i] = [];
- for (var j = 0; j < numCols; j++) {
- this.raster[i][j] = '.';
- }
- }
- // run initializer
- this.init();
- }
- this.addChar = function(posX , posY, woord) {
- var teller = 0;
- for (var i = posY; i < (posY+woord.length); i++) {
- this.raster[posX][i] = woord.charAt(teller);
- teller++;
- }
- }
- this.draw = function() {
- var strArr = "";
- for (var i = 0; i < this.raster.length; i++) {
- strArr += this.raster[i] + '\n';
- }
- WScript.StdOut.Write(strArr);
- }
- }
Add Comment
Please, Sign In to add comment