This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8" /> | |
<title>The Game</title> | |
</head> | |
<body> | |
<canvas id="board" width='700' height='600'></canvas> | |
<script src="http://code.jquery.com/jquery-1.9.1.js"></script> | |
<script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8" /> | |
<title>Canvas Background</title> | |
</head> | |
<body> | |
<header> | |
<h1>Hello canvas background</h1> | |
</header> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun naranjas(n:int) = | |
let fun funcion_auxiliar(numero, acumulador) = | |
if numero = 0 then | |
acumulador | |
else | |
funcion_auxiliar(numero - 1, acumulador * numero) | |
in | |
funcion_auxiliar(n, 1) | |
end; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Creates a new Sync MapIterator over objects with an asyncrhonus mapFunction | |
* @param {[array]} objects [object array to iterate over] | |
* @param {[Function]} mapFunction [function to apply over each object sync mode] | |
* @param {Function} done [function to call when it's done] | |
*/ | |
var SyncMapIterator = function(objects, mapFunction, done){ | |
this.objects = objects; | |
this.i = 0; | |
this.retries = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Creates a new Sync MapIterator over objects with an asyncrhonus mapFunction | |
* @param {[array]} objects [object array to iterate over] | |
* @param {[Function]} mapFunction [function to apply over each object sync mode] | |
* @param {Function} done [function to call when it's done] | |
*/ | |
var SyncMapIterator = function(objects, mapFunction, done){ | |
this.objects = objects; | |
this.i = 0; | |
this.retries = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>Fundamentos de física</title> | |
<link rel="stylesheet" type="text/css" href="style.css"> | |
</head> | |
<body> | |
<h1>Aplicando físicas a videojuegos</h1> | |
<canvas id="scene" width="600" height="400"></canvas> | |
<script type="text/javascript" src="main.js"></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function main(operation){ | |
return (new Function('return ' + operation))(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var replaces = { | |
'á':'a', | |
'é':'e', | |
'í':'i', | |
'ó':'o', | |
'ú':'u', | |
'Á':'A', | |
'É':'E', | |
'Í':'I', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var memo = { | |
'0': 0, | |
'1': 1, | |
'2': 2, | |
'3': 6 | |
}; | |
function main(n){ | |
if(n<=2){ | |
return memo[n]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function main(word){ | |
word = word.replace(/\s/g,''); | |
return word == word.split('').reverse().join(''); | |
}; |