--- a/flowsnake.js Sat Nov 09 23:47:14 2013 +0900
+++ b/flowsnake.js Sat Nov 09 23:47:54 2013 +0900
step: function(visible) {
+ if (this.pointer >= this.rule.length) {
switch (this.rule[this.pointer]) {
- if (this.pointer < this.rule.length) {
--- a/index.html Sat Nov 09 23:47:14 2013 +0900
+++ b/index.html Sat Nov 09 23:47:54 2013 +0900
$('pre').css({'left': '50%', 'margin-left': - $('pre').width() / 2});
- window.setInterval(function() {
+ var interval = window.setInterval(function() {
+ if (!flowsnake.step(true)) {
+ window.clearInterval(interval);