Methods and Attributes

Cards (3)

  • PUBLIC and PRIVATE
    PRIVATE attempts = 3
    PUBLIC PROCEDURE setAttempts(number)
    Attempts = number
    ENDPROCEDURE
    PRIVATE FUNCTION getAttempts()
    RETURN attempts
    END FUNCTION
  • player.setAttempts(5)
    PRINT(player.getAttempts())
  • Methods and attributes are assumed to be public unless otherwise stated