diff options
| author | DJ O'Leary <dijitol@proton.me> | 2025-03-03 01:14:16 +0100 |
|---|---|---|
| committer | DJ O'Leary <dijitol@proton.me> | 2025-03-03 01:14:16 +0100 |
| commit | 6860b6e83f2c6be5e59253105cf397c5b27b1590 (patch) | |
| tree | b4dbad23c012f4e547e5df1d24361818cee50b9a /2024/OCaml/lib/day_04/php/Position.php | |
| parent | 4da9eabd1223682c50209c7659537aaa0867a107 (diff) | |
feat: Move 2024 php files
Diffstat (limited to '2024/OCaml/lib/day_04/php/Position.php')
| -rw-r--r-- | 2024/OCaml/lib/day_04/php/Position.php | 77 |
1 files changed, 0 insertions, 77 deletions
diff --git a/2024/OCaml/lib/day_04/php/Position.php b/2024/OCaml/lib/day_04/php/Position.php deleted file mode 100644 index 182da7e..0000000 --- a/2024/OCaml/lib/day_04/php/Position.php +++ /dev/null @@ -1,77 +0,0 @@ -<?php - -declare(strict_types=1); - -class Position implements Stringable -{ - public function __construct(public $x, public $y) {} - - public function __toString(): string - { - return "({$this->x}, {$this->y})"; - } - - /** - * Not validated - */ - public function getNorth(): self - { - return new self($this->x, $this->y - 1); - } - - /** - * Not validated - */ - public function getNorthEast(): self - { - return new self($this->x + 1, $this->y - 1); - } - - /** - * Not validated - */ - public function getEast(): self - { - return new self($this->x + 1, $this->y); - } - - /** - * Not validated - */ - public function getSouthEast(): self - { - return new self($this->x + 1, $this->y + 1); - } - - /** - * Not validated - */ - public function getSouth(): self - { - return new self($this->x, $this->y + 1); - } - - /** - * Not validated - */ - public function getSouthWest(): self - { - return new self($this->x - 1, $this->y + 1); - } - - /** - * Not validated - */ - public function getWest(): self - { - return new self($this->x - 1, $this->y); - } - - /** - * Not validated - */ - public function getNorthWest(): self - { - return new self($this->x - 1, $this->y - 1); - } -} |
