Skip to content

Commit

Permalink
- Added explanation text
Browse files Browse the repository at this point in the history
  • Loading branch information
maximecb committed Dec 31, 2012
1 parent 3fc7639 commit 93b3ee7
Show file tree
Hide file tree
Showing 6 changed files with 163 additions and 7 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ Turing-Drawings

Randomly generated Turing machines draw images and animations on a 2D canvas.
A simple JavaScript+HTML5 demo.

This project is distributed under a modified BSD license.
20 changes: 17 additions & 3 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
</td>

<!-- controls column -->
<td style="vertical-align: text-top;">
<td style="text-align:center; vertical-align: text-top;">
<form name="params" action="">

<div style="margin-top:8px; margin-bottom:8px;">
Expand All @@ -49,12 +49,26 @@
<input id="numSymbols" type="text" size="3" value="3">
</div>

<div style="text-align:center; margin:8px;">
<div style="margin-top:8px; margin-bottom:8px;">
<button type="button" onclick="randomProg();">Random</button>
<button type="button" onclick="restartProg();">Restart</button>
</div>

<div style="margin-top:40px;">
<div style="margin-top:16px; margin-bottom:16px; width:400px; text-align: justify;">
Turing Drawings uses randomly generated Turing machines to produce
drawings on a canvas, as a form of generative art. The typical
Turing machine formulation manipulates symbols on a one-dimensional
tape. Turing Drawings uses machines that operate on a finite 2D grid,
where each grid cell can contain one symbol which corresponds to a
color value. This 2D grid is represented in the canvas shown at the left,
which is dynamically updated as the Turing machine iterates.
<br><br>
You can generate new drawings by pressing the "Random" button above. If
you find a drawing you like, and would like to share it online, you can
do so by copying the custom URL shown in the text area below.
</div>

<div style="margin-top:8px; margin-bottom:8px;">
<div>
Shareable URL for this drawing:
</div>
Expand Down
36 changes: 36 additions & 0 deletions main.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,39 @@
/*****************************************************************************
*
* This file is part of the Turing-Drawings project. The project is
* distributed at:
* https://github.com/maximecb/Turing-Drawings
*
* Copyright (c) 2012, Maxime Chevalier-Boisvert. All rights reserved.
*
* This software is licensed under the following license (Modified BSD
* License):
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote
* products derived from this software without specific prior written
* permission.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
* NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*****************************************************************************/

//============================================================================
// Page interface code
//============================================================================
Expand Down
40 changes: 36 additions & 4 deletions programs.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,39 @@
/*****************************************************************************
*
* This file is part of the Turing-Drawings project. The project is
* distributed at:
* https://github.com/maximecb/Turing-Drawings
*
* Copyright (c) 2012, Maxime Chevalier-Boisvert. All rights reserved.
*
* This software is licensed under the following license (Modified BSD
* License):
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote
* products derived from this software without specific prior written
* permission.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
* NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*****************************************************************************/

var ACTION_LEFT = 0;
var ACTION_RIGHT = 1;
var ACTION_UP = 2;
Expand Down Expand Up @@ -172,8 +208,6 @@ Program.prototype.update = function (numItrs)
error('invalid action: ' + ac);
}



/*
assert (
this.xPos >= 0 && this.xPos < this.mapWidth,
Expand All @@ -191,8 +225,6 @@ Program.prototype.update = function (numItrs)
);
*/



this.itrCount++;
}
}
Expand Down
36 changes: 36 additions & 0 deletions utils-html.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,39 @@
/*****************************************************************************
*
* This file is part of the Turing-Drawings project. The project is
* distributed at:
* https://github.com/maximecb/Turing-Drawings
*
* Copyright (c) 2012, Maxime Chevalier-Boisvert. All rights reserved.
*
* This software is licensed under the following license (Modified BSD
* License):
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote
* products derived from this software without specific prior written
* permission.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
* NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*****************************************************************************/

// Default console logging function implementation
if (!window.console) console = {};
console.log = console.log || function() {};
Expand Down
36 changes: 36 additions & 0 deletions utils-misc.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,39 @@
/*****************************************************************************
*
* This file is part of the Turing-Drawings project. The project is
* distributed at:
* https://github.com/maximecb/Turing-Drawings
*
* Copyright (c) 2012, Maxime Chevalier-Boisvert. All rights reserved.
*
* This software is licensed under the following license (Modified BSD
* License):
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote
* products derived from this software without specific prior written
* permission.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
* NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*****************************************************************************/

/**
Assert that a condition holds true
*/
Expand Down

0 comments on commit 93b3ee7

Please sign in to comment.