implementation for 3rd individual project
This commit is contained in:
parent
b023049f27
commit
0270ceb6e3
@ -31,6 +31,26 @@ class GarbageTruck():
|
|||||||
self.coor = [random.randint(0,19),random.randint(0,19)]
|
self.coor = [random.randint(0,19),random.randint(0,19)]
|
||||||
return self.coor
|
return self.coor
|
||||||
|
|
||||||
|
|
||||||
|
def empty(self, i):
|
||||||
|
if i == "plastic":
|
||||||
|
self.plastic -= 1
|
||||||
|
return True
|
||||||
|
elif i == "paper":
|
||||||
|
self.paper -= 1
|
||||||
|
return True
|
||||||
|
elif i == "glass":
|
||||||
|
self.glass -= 1
|
||||||
|
return True
|
||||||
|
elif i == "cardboard":
|
||||||
|
self.cardboard -= 1
|
||||||
|
return True
|
||||||
|
elif i == "metal":
|
||||||
|
self.metal -= 1
|
||||||
|
return True
|
||||||
|
else:
|
||||||
|
return False
|
||||||
|
|
||||||
#check id garbage truck full
|
#check id garbage truck full
|
||||||
def amIFull(self):
|
def amIFull(self):
|
||||||
if ( self.plastic==self.capacity and self.paper==self.capacity and
|
if ( self.plastic==self.capacity and self.paper==self.capacity and
|
||||||
|
Loading…
Reference in New Issue
Block a user