Konstantin Ryadov JVM engineer turned AI engineer. Things I have built.

Labyrinth generated with JavaScript

The code:

<script>
for (var line=1; line<30; line++) {
  for(var i=1;i<30;i++) {
    var s = (Math.floor((Math.random()*2)%2)) ? "╱" : "╲";
    document.write(s);
  }
  document.writeln("<br>");
}
</script>

The result:

A maze of ╱ and ╲ characters

Found on http://js.do


Originally published in Russian on LiveJournal.

All posts