redc
Version:
Compiles RED lang into Minecraft schematics
34 lines (33 loc) • 1.4 kB
JavaScript
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var REDCError = /** @class */ (function (_super) {
__extends(REDCError, _super);
function REDCError(message) {
var _this = _super.call(this, message) || this;
Object.setPrototypeOf(_this, REDCError.prototype);
return _this;
}
return REDCError;
}(Error));
export { REDCError };
export var WORD_SIZE = 6;
export var MEMORY_SIZE = Math.pow(2, WORD_SIZE);
export var ROM_SIZE = 12 * 20 - 1;
// offset from pos 0 at seg 0 to the first word being read by the circuit.
export var OFFSET = 16;
export var BULGES = 2;
export var NUM_SEGMENTS = BULGES * 8 + 4;
export var CAPACITY = NUM_SEGMENTS * 12 - 1;