38
loading...
This website collects cookies to deliver better user experience
person.turn("left", true) // turn left and take one step forward
person.turn("left", false) // turn left and stay at the same place
// change to
person.turn("left", {"stepForward": true})
person.turn("left", {"stepForward": false})
person.turn("left", true) // turn left and take one step forward
person.turn("left", false) // turn left and stay at the same place
// change to
person.turnAndStepForward("left") // if this combination is often used
x.setDisabled(true)
and use x.setEnabled(true)
instead. This is to help with understanding statements more intuitively. It is also important to use one over the other consistently.aString.trim() // modify the existing string
aString.trimmed() // only return a modified string
person.turn("left")
car.steer("left")
turn
for both.person.turn("left")
car.turn("left")
person.rotate(1, 2) // first horizontally, second vertically
rectangle.rotate(1, 2) // first vertically, second horizontally
rotate
but the parameters are two different ordered pairs of the same values. That is a disaster in the making.