From b5948435aec49d4b6e40f03bd175194f55857f4e Mon Sep 17 00:00:00 2001 From: sanex3339 Date: Sat, 4 Jun 2016 18:35:13 +0300 Subject: [PATCH] selfDefending test implementation --- .../self-defending-nodes/SelfDefendingUnicodeNode.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/custom-nodes/self-defending-nodes/SelfDefendingUnicodeNode.ts b/src/custom-nodes/self-defending-nodes/SelfDefendingUnicodeNode.ts index bc5526b7..2136b7dc 100644 --- a/src/custom-nodes/self-defending-nodes/SelfDefendingUnicodeNode.ts +++ b/src/custom-nodes/self-defending-nodes/SelfDefendingUnicodeNode.ts @@ -37,7 +37,7 @@ export class SelfDefendingUnicodeNode extends Node { randomIndex: number = 0; if (programBodyLength > 2) { - randomIndex = Utils.getRandomInteger(programBodyLength, programBodyLength / 2); + randomIndex = Utils.getRandomInteger(programBodyLength / 2, programBodyLength); } NodeUtils.insertNodeAtIndex(blockScopeNode.body, this.getNode(), randomIndex);