Monday, October 08, 2018

Proposal: Quick, like its on Fire! [cleanup]

became popular 3 to 0 after 48 hours. Enacted by Derrick.

Adminned at 10 Oct 2018 17:07:01 UTC

In this proposal, the character string "\]" is considered to instead be "]"

replace the function isAdj2Coord with:

function isAdj2Coord(row,column, equipment, firewall) {
properties = [\];
directions = [[-1,-1],[0,-1],[1,-1],[-1,0],[1,0],[-1,1],[0,1],[1,1]];

for (var i = 0; i < directions.length; i++) {
character = fireCellValue(row + directions[i\][0], column + directions[i\][1], firewall);
if (character == equipment) {
return true;
}
}
return false;
}



replace the function fireCellValue with:

function fireCellValue(row, column, firewall){
return firewall[row]? firewall[row][column]:undefined;
}
This maintains functionality while increasing readability, throwing fewer errors, and taking up less space. Thus it is a cleanup.

Comments

Kevan:

10-09-2018 09:36:05 UTC

imperial

Kevan:

10-10-2018 10:36:59 UTC

for CoV so that this won’t time out and fail.

Brendan:

10-10-2018 15:54:01 UTC

for since the previous proposal timed out as I was voting on it.