CS2613/assignments/A4/valley.js

28 lines
715 B
JavaScript
Raw Normal View History

2022-11-04 15:07:21 -03:00
let life=require("./moarlife.js");
let valley = new life.LifelikeWorld(
["############################",
"##### ######",
"## *** **##",
"# *##** ** O *##",
"# *** O ##** *#",
"# O ##*** #",
"# ##** #",
"# O #* #",
"#* #** O #",
"#*** ##** O **#",
"##**** ###*** *###",
"############################"],
{"#": life.Wall,
"O": life.PlantEater,
"*": life.Plant}
);
function loop () {
valley.turn();
console.log("\33c");
console.log(valley.toString());
setTimeout(function() { loop(); },250);
}
loop();