Advertisement
Frumkin

Untitled

Jul 4th, 2021
227
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. module
  2. Vector2D
  3. {
  4. public
  5. decimal
  6. (
  7. 0.0
  8. )
  9. x
  10. ;
  11. public
  12. decimal
  13. (
  14. 0.0
  15. )
  16. y
  17. ;
  18. public
  19. constructor
  20. (
  21. x
  22. :
  23. readonly
  24. decimal
  25. ,
  26. y
  27. :
  28. readonly
  29. decimal
  30. )
  31. {
  32. [
  33. context
  34. ]
  35. .
  36. x
  37. =
  38. x
  39. ;
  40. [
  41. context
  42. ]
  43. .
  44. y
  45. =
  46. y
  47. ;
  48. }
  49. public
  50. function
  51. toString
  52. (
  53. )
  54. returns
  55. string
  56. {
  57. return
  58. "X: "
  59. +
  60. x
  61. .
  62. toString
  63. (
  64. )
  65. +
  66. ", Y: "
  67. +
  68. y
  69. .
  70. toString
  71. (
  72. )
  73. ;
  74. }
  75. }
  76. entry
  77. {
  78. Vector2D
  79. (
  80. 4.5
  81. ,
  82. 9.8
  83. )
  84. vector
  85. ;
  86. terminal
  87. .
  88. log
  89. (
  90. vector
  91. .
  92. toString
  93. (
  94. )
  95. )
  96. ;
  97. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement