summaryrefslogtreecommitdiff
path: root/2024/PHP/day_04/Position.php
diff options
context:
space:
mode:
authorDJ O'Leary <dijitol@proton.me>2025-03-10 00:53:54 +0100
committerDJ O'Leary <dijitol@proton.me>2025-03-10 00:53:54 +0100
commit344c90117651f0d8df46d5c10a28040b230348bf (patch)
tree5919e62b9bb90e1fce75e93150b356e1f52b9a77 /2024/PHP/day_04/Position.php
parent89c6ad2d91e18bcdd93d3f7ac85b3c0dbfd9d1b4 (diff)
fix: Formatting
Diffstat (limited to '2024/PHP/day_04/Position.php')
-rw-r--r--2024/PHP/day_04/Position.php124
1 files changed, 63 insertions, 61 deletions
diff --git a/2024/PHP/day_04/Position.php b/2024/PHP/day_04/Position.php
index 182da7e..0dcf96c 100644
--- a/2024/PHP/day_04/Position.php
+++ b/2024/PHP/day_04/Position.php
@@ -4,74 +4,76 @@ declare(strict_types=1);
class Position implements Stringable
{
- public function __construct(public $x, public $y) {}
+ public function __construct(public $x, public $y)
+ {
+ }
- public function __toString(): string
- {
- return "({$this->x}, {$this->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 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 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 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 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 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 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 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);
- }
+ /**
+ * Not validated
+ */
+ public function getNorthWest(): self
+ {
+ return new self($this->x - 1, $this->y - 1);
+ }
}