Commits

Shlomi Fish  committed 737a8e7

[JS] Implement _get_results_text_table.

  • Participants
  • Parent commits a1cb965

Comments (0)

Files changed (1)

File abc-path/js/abc-path.js

             });
             return;
         },
+        _get_results_text_table: function() {
+            var render_row = function(cols) {
+                return "| " + cols.map(function(s) {
+                    return s.length == 1 ? ("  " + s + "  ") : s;
+                }).join(" | ") + " |\n";
+            };
+            return [this._x_indexes.map(function (x) { 
+                return "X = " + (x+1); })].concat(
+                    this._y_indexes.map(function(y) {
+                        return this._x_indexes.map(function (x) {
+                            return this._get_possible_letters_string(x,y);
+                        })
+                    })).map(render_row).join('');
+        },
     },
 });