Could you give me some NAME_1 code that meets the following requirements? I want to have code that can calculate something:
I have an object, rat, that has 4 properties: 'age' (in weeks), 'sex' (a boolean where true = male false=female), a boolean 'ispregnant' and a property of how many weeks the rat is pregnant now.
I want to iterate through time, one week at a time and every week be able to execute some code.
I start with 6 rat objects, all are aged 5 weeks, 1 is male and 5 are female, all females just became pregnant at the start.
Only female rats get pregnant.
Rats get pregnant the first time when they are 5 weeks old.
Rats are pregnant for 3 weeks before they give birth.
Rats give birth to 12 babies: 2 males and 10 females.
Rats have to wait for 1 week after giving birth, then become pregnant again.
No rats every die.
Every week I want a printout of how many rats there are now.
Let it run for 52 weeks. Do not include the following keywords: name_1, property, female, code
user