Skip to content

Instantly share code, notes, and snippets.

@captainsafia
Created February 5, 2013 17:36
Show Gist options
  • Save captainsafia/4716111 to your computer and use it in GitHub Desktop.
Save captainsafia/4716111 to your computer and use it in GitHub Desktop.
My solutions to the AI Playground aritificial intelligence challenges -- http://aichallenges.appspot.com/mainpage
// You are given a map of arbitrary size represented
// as a two-dimensional array, and your job is to
// return the same map, but rotated 180 degrees.
this.run = function(map) {
var newmap = [];
for (var i = map.length-1; i >= 0; i--) {
newmap.push(map[i].reverse());
}
return newmap;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment