LifeRunner
اصنع نسخة من BugRunner.java باسم LifeRunner.java وأضف العمليات ذات النماذج الأولية التالية:
يجب أن تصنع makeLifeWorld شبكة عناصر (Actors) بالإضافة إلى ActorWorld، ثم تستدعي makeRocks، التي ستضع LifeRock في كل موقع من الشبكة.كود:/** * Makes a Game of Life grid with an r-pentomino. */ public static void makeLifeWorld(int rows, int cols) /** * Fills the grid with LifeRocks. */ public static void makeRocks(ActorWorld world)
المفضلات