MCPcopy Create free account
hub / github.com/bedroombuilds/python2rust / Character

Class Character

29_pattern_matching_revisited/python/cmd_split.py:28–43  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

26 return self
27
28class Character:
29 def __init__(self):
30 self.backpack = set()
31 def take(self, obj, room):
32 if obj in room.objects:
33 self.backpack.add(obj)
34 room.objects.remove(obj)
35 else:
36 print("not found", obj)
37
38 def drop(self, obj, room):
39 if obj in self.backpack:
40 self.backpack.remove(obj)
41 room.objects.add(obj)
42 else:
43 print("not in backpack", obj)
44
45
46if __name__ == "__main__":

Callers 1

cmd_split.pyFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected