Browse Source

Dataclass really wasn't needed

pull/3/head
Ryan Reed 3 years ago
parent
commit
a15bfb9416
1 changed files with 0 additions and 5 deletions
  1. +0
    -5
      puzzles/day02.py

+ 0
- 5
puzzles/day02.py View File

@ -11,10 +11,7 @@ import pathlib
import sys import sys
from typing import List, Tuple from typing import List, Tuple
from dataclasses import dataclass
@dataclass
class Location: class Location:
horizontal = 0 horizontal = 0
depth = 0 depth = 0
@ -32,7 +29,6 @@ class Location:
return self.horizontal * self.depth return self.horizontal * self.depth
@dataclass
class Puzzle1(Location): class Puzzle1(Location):
def forward(self, distance: int) -> None: def forward(self, distance: int) -> None:
self.horizontal += distance self.horizontal += distance
@ -44,7 +40,6 @@ class Puzzle1(Location):
self.depth += distance self.depth += distance
@dataclass
class Puzzle2(Location): class Puzzle2(Location):
def forward(self, distance: int) -> None: def forward(self, distance: int) -> None:
self.horizontal += distance self.horizontal += distance


Loading…
Cancel
Save