瀏覽代碼

selfDefending test implementation

sanex3339 9 年之前
父節點
當前提交
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);