Просмотр исходного кода

selfDefending test implementation

sanex3339 9 лет назад
Родитель
Сommit
b5948435ae
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      src/custom-nodes/self-defending-nodes/SelfDefendingUnicodeNode.ts

+ 1 - 1
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);