View Single Post
This simulates ascii sand falling in a grid. Sand is a '.', spaces are just empty space, and '#' is a rock. Rocks don't fall dumbo.
I saw this as an [Easy] challenge on reddit, but all the solutions people were posting used various algorithm libraries and stuff. w/e

yes



This isn't really anything special, but I like how it all works and how the errors are handled (actually I took out grid boundaries for now, that's why catch case 1 is redundant right now). If you're wondering what the mystery function converttoint does, it's something I made and put in my own personal header. It's just this:

converttoint()

Last edited by Fear; Mar 31, 2014 at 08:46 AM.