Langton-s-Ant/index.html

40 lines
909 B
HTML

<html dir="ltr" lang="en-US">
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="resource://activity-stream/css/activity-stream.css">
<style>
table, th, td {
border: 1px solid black;
padding: 15px;
}
.ant {
background: red !important;
}
.black {
background: black;
}
</style>
</head>
<body>
<div class="prgm">
</div>
<button onclick="moving()" style="position: fixed;top: 0;">Move</button>
<input style="position: fixed;bottom: 0;" class="moves"/>
</body>
<script type="text/javascript" src="prgm.js"></script>
<script>
function moving() {
for (var i = document.getElementsByClassName("moves")[0].value - 1; i >= 0; i--) {
Prgm.Ant.move();
}
}
window.onload = function() {
stop = false;
Prgm.setElement("test");
Prgm.init(document.getElementsByClassName("prgm")[0], 250);
Prgm.Ant.setAt(50, 200);
};
</script>
</html>