Skip to content

Commit fb01518

Browse files
committed
DFSmethods. Add the Step entity. Add TODO instructions and new methods signatures.
1 parent 4de30d3 commit fb01518

File tree

3 files changed

+32
-9
lines changed

3 files changed

+32
-9
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package com.google.hashcode.entity;
2+
3+
/**
4+
* Step as an entity is a slice tha can be added to a particular slice inside a particular pizza, considering
5+
* pizza's slice instructions
6+
*
7+
* @author Grigoriy Lyashenko (Grog).
8+
*/
9+
public class Step {
10+
11+
public Slice startPosition;
12+
13+
public Cell delta;
14+
}

src/main/java/com/google/hashcode/utils/DFSMethods.java

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import com.google.hashcode.entity.Cell;
44
import com.google.hashcode.entity.Pizza;
55
import com.google.hashcode.entity.Slice;
6-
import com.google.hashcode.entity.SliceInstruction;
6+
import com.google.hashcode.entity.Step;
77
import org.slf4j.Logger;
88
import org.slf4j.LoggerFactory;
99

@@ -18,7 +18,6 @@ public abstract class DFSMethods {
1818
private DFSMethods() {
1919
}
2020

21-
2221
/**
2322
* Step as an entity is an amount of a pizza cells, that can be added to a slice of a pizza or a pizza cell.<br>
2423
* Step as an action is a process of:<br>
@@ -58,16 +57,25 @@ public static Optional<Slice> rightStep(Pizza pizza, Slice slice) {
5857
}
5958

6059
/**
61-
* Step as an action it's a process, when a slice adding to itself a subset of a pizza cells and remains rectangular.
62-
* Step as an entity is a Slice tha can be added to a particular slice inside a particalur pizza
63-
* considering slice instructions
60+
* Step as an action it's a process, when a slice adding to itself a subset of a pizza cells and remains rectangular
61+
* and valid.
6462
*
65-
* @param pizza given pizza
66-
* @param slice given slice in the pizza
67-
* @param sliceInstruction restrictions for a steps
63+
* @param pizza given pizza
64+
* @param output given slice in the pizza
6865
* @return available steps
6966
*/
70-
List<Slice> getAvailableSteps(Pizza pizza, Slice slice, SliceInstruction sliceInstruction) {
67+
List<Step> getAvailableSteps(Pizza pizza, List<Slice> output) {
68+
//TODO implement.For each slice find all available steps. We DON'T change the pizza on this stage
69+
return new ArrayList<>();
70+
}
71+
72+
Slice performStep(Pizza pizza, List<Step> steps) {
73+
//TODO pick-ups a step with a minimal steps number, execute it(cut it from the pizza, and a slice)
74+
return null;
75+
}
76+
77+
List<Slice> cutAllStartPositions(Pizza pizza) {
78+
//TODO pick-ups a step with a minimal steps number, execute it(cut it from the pizza, and a slice). The pizza is a mutable object
7179
return new ArrayList<>();
7280
}
7381

src/main/java/com/google/hashcode/utils/IoUtils.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ public static String convertToHumanReadableTable(Cell[][] ingredients) {
8787
output.append("\n");
8888
}
8989
return output.toString();
90+
//TODO reimplement for the pizza
9091
}
9192

9293
/**

0 commit comments

Comments
 (0)