Skip to content

Instantly share code, notes, and snippets.

View kietnguyen's full-sized avatar
🎯
Focusing

Kiet Nguyen kietnguyen

🎯
Focusing
View GitHub Profile
@kietnguyen
kietnguyen / falling-rocks.js
Last active August 29, 2015 14:22
devdating.net Programming Challenge
/*
Rocks are falling from the sky! You get an array of rocks o and platforms #
Simulate rocks' flight until they hit a platform, another rock or the bottom. Platforms stay put.
map is an array in the format ['ooo###...', ...], where map[2][5] translates to the rock at x: 2, y: 5
return the result after all rocks have stopped moving.
*/
(function() {
return map.map(function(col) {
var count = 0,