summaryrefslogtreecommitdiff
path: root/go/lasagna/lasagna.go
diff options
context:
space:
mode:
authorDimitri Sokolyuk <sokolyuk@gmail.com>2022-11-22 14:16:16 +0100
committerDimitri Sokolyuk <sokolyuk@gmail.com>2022-11-22 14:16:16 +0100
commit4a01c0d39db1d310d8a4f88b543135be4aa700b4 (patch)
treeaed4069e695047410126f1376d023175741adf5d /go/lasagna/lasagna.go
parent62966e2253ff5a045852e46b443c5c2a9e7f9f63 (diff)
finish lasagna
Diffstat (limited to 'go/lasagna/lasagna.go')
-rw-r--r--go/lasagna/lasagna.go19
1 files changed, 19 insertions, 0 deletions
diff --git a/go/lasagna/lasagna.go b/go/lasagna/lasagna.go
new file mode 100644
index 0000000..5c1fbad
--- /dev/null
+++ b/go/lasagna/lasagna.go
@@ -0,0 +1,19 @@
+package lasagna
+
+// TODO: define the 'OvenTime' constant
+const OvenTime = 40
+
+// RemainingOvenTime returns the remaining minutes based on the `actual` minutes already in the oven.
+func RemainingOvenTime(actualMinutesInOven int) int {
+ return OvenTime - actualMinutesInOven
+}
+
+// PreparationTime calculates the time needed to prepare the lasagna based on the amount of layers.
+func PreparationTime(numberOfLayers int) int {
+ return numberOfLayers * 2
+}
+
+// ElapsedTime calculates the time elapsed cooking the lasagna. This time includes the preparation time and the time the lasagna is baking in the oven.
+func ElapsedTime(numberOfLayers, actualMinutesInOven int) int {
+ return PreparationTime(numberOfLayers) + actualMinutesInOven
+}