This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| cnt IS $0 | |
| argv IS $1 | |
| t IS $255 | |
| k GREG 0 | |
| LOC Data_Segment | |
| GREG @ | |
| NewLn BYTE #a,0 | |
| LOC #100 | |
| Main SET k,0 | |
| Loop LDOU t,argv,k |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| argv IS $1 | |
| t IS $255 | |
| k GREG 0 | |
| LOC Data_Segment | |
| GREG @ | |
| NewLn BYTE #a,0 | |
| LOC #100 | |
| Main SET k,0 | |
| Loop LDOU t,argv,k | |
| BZ t,Term |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function classof(o) { | |
| if (o === null) return "Null"; | |
| if (o === undefined) return "Undefined"; | |
| return Object.prototype.toString.call(o).slice(8, -1); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function Range(from, to) { | |
| this.from = from; | |
| this.to = to; | |
| } | |
| Range.prototype = { | |
| constructor: Range, | |
| includes: function (x) { | |
| return this.from <= x && x <= this.to; | |
| }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function Range(from, to) { | |
| this.from = from; | |
| this.to = to; | |
| } | |
| Range.prototype.includes = function (x) { | |
| return this.from <= x && x <= this.to; | |
| }; | |
| Range.prototype.foreach = function (f) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var F = function() {}; // This is a function object | |
| var p = F.prototype; // This is the prototype object associated with it | |
| var c = p.constructor; // This is the function associated with the prototype | |
| c === F // => true, F.prototype.constructor === F fo any function | |
| var o = new F(); // Create an object o of class F | |
| o.constructor === F // => true, the constructor property specifies the class |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function Range(from, to) { | |
| this.from = from; | |
| this.to = to; | |
| } | |
| Range.prototype = { | |
| includes: function (x) { | |
| return this.from <= x && x <= this.to; | |
| }, | |
| foreach: function (f) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function inherit(p) { | |
| if (p == null) | |
| throw TypeError(); | |
| if (Object.create) | |
| return Object.create(p); | |
| var t = typeof p; | |
| if (t !== "object" && t !== "function") | |
| throw TypeError(); | |
| function f() {}; | |
| f.prototype = p; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function Set() { | |
| this.values = {}; | |
| this.n = 0; | |
| if (arguments.length == 1 && isArrayLike(arguments[0])) | |
| this.add.apply(this, arguments[0]); | |
| else if (arguments.length > 0) | |
| this.add.apply(this, arguments); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Suffix Array from JMBook | |
| // | |
| // | |
| #include <vector> | |
| #include <string> | |
| #include <algorithm> | |
| #include <cstdio> | |
| using namespace std; |