25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.

51 satır
839B

  1. interface Printable
  2. method print()
  3. end interface
  4. interface Resettable
  5. method reset()
  6. method active() as boolean
  7. end interface
  8. class Counter implements Printable, Resettable
  9. private word value
  10. private byte[4] history
  11. public method init(start as word)
  12. var copy as word
  13. copy = start
  14. self.value = copy
  15. self.history[0] = 0
  16. end method
  17. public method destroy()
  18. self.value = 0
  19. return
  20. end method
  21. public method print()
  22. print self.value
  23. end method
  24. public method reset()
  25. self.value = 0
  26. end method
  27. public method active() as boolean
  28. if self.value <> 0
  29. return true
  30. else
  31. return false
  32. end if
  33. end method
  34. end class
  35. program Main
  36. var count as Counter
  37. var output as Printable
  38. count = new Counter(10)
  39. output = count
  40. output.print()
  41. delete output
  42. end program

Powered by TurnKey Linux.