Skip to content

Instantly share code, notes, and snippets.

@Jorger
Created September 16, 2018 22:14
Show Gist options
  • Save Jorger/cb9f08b220e0c66fabdd5a8a1f48accc to your computer and use it in GitHub Desktop.
Save Jorger/cb9f08b220e0c66fabdd5a8a1f48accc to your computer and use it in GitHub Desktop.
let finalElements = 0;
for (let connected of connectedPipes) {
if (
actualWorld[1][connected][2] !== 1 &&
actualWorld[1][connected][2] !== 2
) {
//Se establece el color...
actualWorld[1][connected][4] = initialColor;
} else {
if (actualWorld[1][connected][2] === 2) {
//Es un elemento final de los pipes que se han conectado...
if (actualWorld[1][connected][4] === initialColor) {
finalElements++;
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment