Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
executable file 57 lines (50 sloc) 1.53 KB
<html>
<div id="lol">
<span> Size: </span>
<input id=sizeX type="text" value="800" />
<input id=sizeY type="text" value="500" />
<span id=start>Start </span>
<span id=pause>Pause </span>
<span id=rand>random </span>
<span >Block size: </span>
<input id=blocksize type="text" value="4" />
<span id=clear>Clear</span>
</div>
<canvas id="canvasElement" width=800 height=500 style="border:1px solid black"></canvas>
<script type="text/javascript" charset="utf-8" src="http://code.jquery.com/jquery-1.7.1.min.js"></script>
<script type="text/javascript" charset="utf-8">
$('#sizeX').change(function(){
console.log(this);
sizeX=$(this).val()/4;
$('#canvasElement').attr('width',$(this).val());
buildArray();
});
$('#sizeY').change(function(){
sizeY=$(this).val()/4;
$('#canvasElement').attr('height',$(this).val());
buildArray()
});
$('#blocksize').change(function(){
clear();
size = parseInt($(this).val());
sizeX = parseInt($('#sizeX').val());
sizeY = parseInt($('#sizeY').val());
resize(sizeX,sizeY);
buildArray();
});
$('#rand').click(function(){
buildRandomData('1000');
})
$('#start').click(function(){
continueGame = true;
playGame();
})
$('#pause').click(function(){
continueGame = false;
})
$('#clear').click(function(){
clear();
});
</script>
<script type="text/javascript" charset="utf-8" src="life.js"></script>
</html>
Something went wrong with that request. Please try again.