Friday, September 28, 2018

Proposal: v0.1

timed out 5-0 enacted by card
as a note the last part of the proposal didn’t do anything because the text wasn’t there to be replaced.

Adminned at 30 Sep 2018 18:00:19 UTC

Replace the text of the Master Control Program rule with the following:-
// MASTER CONTROL PROGRAM

GNDT = `__GNDT`
MCPOutput = ""

if (GNDT == "__" + "GNDT") {
printLine("Illegal execution? A GNDT dump must be provided.");
} else {
GNDTLines = GNDT.split("\n")

GNDTLines.forEach(function(entry) {
GNDTFields = entry.split("\t")
programName = GNDTFields[0]
programInput = GNDTFields[1]
programOutput = GNDTFields[2]

if (programName == "card") {
return 0
}

inputRegister = programInput.charCodeAt(0) + programInput.charCodeAt(1)
outputRegister = programOutput.charCodeAt(0) + programOutput.charCodeAt(1)

if (inputRegister < outputRegister) {
printLine(programName + " check OK")
} else {
printLine(programName + " register disparity")
}
});
}

function printLine(message) {
MCPOutput += "[" + message + "]<"+"br"+">"
}


Replace "__GNDT is replaced by a single backquote (`) surrounding a GNDT dump" with "__GNDT is replaced by a GNDT dump".

Alright, let’s try a basic GNDT-reading MCP to see if anything breaks. This reads in the GNDT data and confirms some meaningless calculations; it has no effect (and there’s no mechanism to actually Execute the MCP yet anyway).

Comments

Kevan: he/him

28-09-2018 17:18:50 UTC

Okay, for reference: the only way I could get that to work was to select “Auto br” on the Formatting dropdown when writing the post (so that ExpressionEngine didn’t prettify all the quotemarks, but did put a carriage return after each line), and I had to break the br tag at the very end into chunks to stop ExpressionEngine from interpreting it as an actual br tag.

Apart from that this wasn’t too painful.

Kevan: he/him

28-09-2018 17:23:28 UTC

Hmm, it’s lost all the indenting I gave it, but jsfiddle has a “Tidy” button at the top to fix indenting, for those who want to read a cleaner version of it.

Brendan: he/him

28-09-2018 17:32:42 UTC

for

9spaceking:

28-09-2018 20:44:58 UTC

for

Lulu: she/her

30-09-2018 12:39:00 UTC

for

card:

30-09-2018 17:57:39 UTC

for