Fruit - rotemish7/OOP_Ex3-4 GitHub Wiki
This class represents an object of the type fruit.
All the fruits as several fields:
type: 1 or -1, the type determind how you can eat that fruit. value: represnts the value added to your grade after eating that fruit. Fruit as two types:
- Apple
- banana
To be able to "eat" an apple you must approach him from a low to high, meaning: if an apple is located on the edge 4-5 you must approach from node 4 otherwise you wont "eat" the apple.
Banana: To be able to "eat" a banana you must approach from high to low, meaning: if a banana is located on the edge 8-9 you must approach from node 9 otherwise you wont "eat" the banana.