iro otaku

1

votes
3

answer
61

views

Find no of possible formations of explosive mines in a 2D matrix where some cells contain info about even/odd mines are adjacent to them

I am trying to make game involving 2D grid where given some hints a player can avoid cells containing explosive mines. I have come upon a particular scenario where given certain hints, i want to know how many formations of mines are possible. Let there be a 2D matrix. Each cell may be empty or may c...
iro otaku
1

votes
1

answer
25

views

why is subclass accessing superclass' attribute inspite of having its own attribute of same name when that attribute is declared private?

I have a parent class Animal and child class Dog. I wanted to create 1 instance of each and print the their count. Here is the working code: class Animal: count=0 def __init__(self): Animal.count+=1 @classmethod def getCount(cls): return cls.count class Dog (Animal): count=0 def __init__(self): supe...
iro otaku