######
# p# #
# # a#
# pa #
# #p #
######
"######\n# p# #\n# # a#\n# pa #\n# #p #######"
i.e. An animal may act more than once if it moves to a cell that has not yet acted
<body>
<script src="https://redrockcode.com/educationMaterials/workbenchProjects/phase-i/virtual-life-01-app/animate-world.js"></script>
<script src="world.js"></script>
<script>
animateWorld(world)
</script>
</body>
How to define an object
var world = {};
How to define a function for an object
world.turn = function() {
console.log("Taking a turn");
}