diff --git a/src/main/interpreter/Visitor.java b/src/main/interpreter/Visitor.java index e267e61..aaddecb 100644 --- a/src/main/interpreter/Visitor.java +++ b/src/main/interpreter/Visitor.java @@ -447,7 +447,7 @@ public MSType visitFuncCall(MineScriptParser.FuncCallContext ctx) { throw new RuntimeException(getFuncCallErrorMessage(id, new int[]{1}, "number", actualParams)); } - retVal = new MSNumber((int) Math.round(Math.sqrt(n.getValue()))); + retVal = new MSNumber((int) Math.floor(Math.sqrt(n.getValue()))); } case "Random" -> { /*If no parameter is used returns a random unbounded int*/ @@ -478,21 +478,21 @@ public MSType visitFuncCall(MineScriptParser.FuncCallContext ctx) { this.turtleDelay = 200 - n.getValue() * 20; } - case "GetXPosition" -> { + case "GetXCoordinate" -> { if (actualParams.size() != 0) { throw new RuntimeException(getFuncCallErrorMessage(id, new int[]{0}, "", actualParams)); } retVal = new MSNumber(pos.getX()); } - case "GetYPosition" -> { + case "GetYCoordinate" -> { if (actualParams.size() != 0) { throw new RuntimeException(getFuncCallErrorMessage(id, new int[]{0}, "", actualParams)); } retVal = new MSNumber(pos.getY()); } - case "GetZPosition" -> { + case "GetZCoordinate" -> { if (actualParams.size() != 0) { throw new RuntimeException(getFuncCallErrorMessage(id, new int[]{0}, "", actualParams)); }