Detailed Example

For the given example terrain, these results and images were produced with
w = simulateFlood(terrain);
animateFlood(terrain, w, 0.5);
action water levels image
initial state
     0     0     0     0     0     0     0     0     0
     0     0     0     0     0     0     0     0     0
     0     0     0     0     0     0     0     0     0
     0     0     0     0     0     0     0     0     0
     0     0     0     0     0     0     0     0     0
     0     0     0     0     0     0     0     0     0
	
recalculate with outside level 1
     0     0     0     0     0     0     1     0     0
     0     0     0     0     0     0     0     0     0
     0     0     0     0     0     0     0     0     0
     0     0     0     0     0     0     0     0     0
     0     0     0     0     0     0     0     0     0
     0     0     0     0     0     0     0     0     0
	
recalculate with outside level 2
     0     0     0     0     0     0     2     0     0
     0     0     0     0     0     0     0     0     0
     0     0     0     0     0     0     0     0     0
     0     0     0     0     0     0     0     0     0
     0     0     0     0     0     0     0     0     0
     0     0     0     0     0     0     0     0     0
	
recalculate with outside level 3
     0     0     0     0     0     0     3     0     0
     0     0     0     0     0     0     1     0     0
     0     0     0     0     0     0     0     0     0
     0     0     0     0     0     0     0     0     0
     0     0     0     0     0     0     0     0     1
     0     1     0     0     0     0     0     0     0
	
recalculate with outside level 4
     0     0     0     0     0     0     4     0     0
     0     0     0     0     0     0     2     0     0
     0     0     0     0     0     0     0     0     0
     0     0     0     2     0     0     0     0     0
     0     0     0     2     0     0     0     0     2
     0     2     0     1     0     0     1     0     1
	
recalculate with outside level 5
     0     0     0     0     0     0     5     0     0
     0     0     0     0     0     0     3     0     0
     0     0     0     0     0     0     0     0     0
     1     2     0     3     0     0     0     0     0
     0     0     0     3     0     3     0     1     3
     0     3     1     2     0     1     2     0     2
	
recalculate with outside level 6
     0     0     0     1     0     0     6     0     0
     0     5     3     1     1     0     4     0     1
     0     1     4     0     0     0     0     1     1
     2     3     0     4     0     0     0     0     0
     1     0     0     4     0     4     0     2     4
     0     4     2     3     0     2     3     0     3
	
recalculate with outside level 7
     1     1     0     2     0     0     7     0     0
     1     6     4     2     2     1     5     1     2
     0     2     5     0     0     0     1     2     2
     3     4     0     5     1     0     1     0     0
     2     1     0     5     0     5     0     3     5
     0     5     3     4     1     3     4     0     4
	
recalculate with outside level 8
     2     2     0     3     0     1     8     0     1
     2     7     5     3     3     2     6     2     3
     1     3     6     0     0     1     2     3     3
     4     5     1     6     2     0     2     1     1
     3     2     0     6     1     6     1     4     6
     0     6     4     5     2     4     5     0     5
	
recalculate with outside level 9
     3     3     0     4     0     2     9     0     2
     3     8     6     4     4     3     7     3     4
     2     4     7     1     1     2     3     4     4
     5     6     2     7     3     0     3     2     2
     4     3     1     7     2     7     2     5     7
     0     7     5     6     3     5     6     1     6
	
recalculate with outside level 10
     4     4     0     5     0     3    10     1     3
     4     9     7     5     5     4     8     4     5
     3     5     8     2     2     3     4     5     5
     6     7     3     8     4     0     4     3     3
     5     4     2     8     3     8     3     6     8
     1     8     6     7     4     6     7     2     7
	
recalculate with outside level 11
     5     5     1     6     1     4    11     2     4
     5    10     8     6     6     5     9     5     6
     4     6     9     3     3     4     5     6     6
     7     8     4     9     5     1     5     4     4
     6     5     3     9     4     9     4     7     9
     2     9     7     8     5     7     8     3     8
	
recalculate with outside level 10
     4     4     0     5     0     3    10     1     3
     4     9     7     5     5     4     8     4     5
     3     5     8     2     2     3     4     5     5
     6     7     3     8     4     0     4     3     3
     5     4     2     8     3     8     3     6     8
     1     8     6     7     4     6     7     2     7
	
recalculate with outside level 9
     3     3     0     4     0     2     9     0     2
     3     8     6     4     4     3     7     3     4
     2     4     7     1     1     2     3     4     4
     5     6     2     7     3     0     3     2     2
     4     3     1     7     2     7     2     5     7
     0     7     5     6     3     5     6     1     6
	
recalculate with outside level 8
     2     2     0     3     0     1     8     0     1
     2     7     5     3     3     2     6     2     3
     1     3     6     0     0     1     2     3     3
     4     5     1     6     2     0     2     1     1
     3     2     0     6     1     6     1     4     6
     0     6     4     5     2     4     5     0     5
	
recalculate with outside level 7
     1     1     0     2     0     0     7     0     0
     1     6     4     2     2     1     5     1     2
     0     2     5     0     0     0     1     2     2
     3     4     0     5     1     0     1     0     0
     2     1     0     5     0     5     0     3     5
     0     5     3     4     1     3     4     0     4
	
recalculate with outside level 6
     0     0     0     1     0     0     6     0     0
     0     5     3     1     1     0     4     0     1
     0     1     4     0     0     0     0     1     1
     2     3     0     4     0     0     0     0     0
     1     0     0     4     0     4     0     2     4
     0     4     2     3     0     2     3     0     3
	
recalculate with outside level 5
     0     0     0     0     0     0     5     0     0
     0     4     2     0     0     0     3     0     0
     0     0     3     0     0     0     0     0     0
     1     2     0     3     0     0     0     0     0
     0     0     0     3     0     3     0     1     3
     0     3     1     2     0     1     2     0     2
	
recalculate with outside level 4
     0     0     0     0     0     0     4     0     0
     0     4     2     0     0     0     2     0     0
     0     0     3     0     0     0     0     0     0
     0     1     0     2     0     0     0     0     0
     0     0     0     2     0     2     0     0     2
     0     2     0     1     0     0     1     0     1
	
recalculate with outside level 3
     0     0     0     0     0     0     3     0     0
     0     4     2     0     0     0     1     0     0
     0     0     3     0     0     0     0     0     0
     0     1     0     1     0     0     0     0     0
     0     0     0     1     0     2     0     0     1
     0     1     0     0     0     0     0     0     0
	
recalculate with outside level 2
     0     0     0     0     0     0     2     0     0
     0     4     2     0     0     0     0     0     0
     0     0     3     0     0     0     0     0     0
     0     1     0     1     0     0     0     0     0
     0     0     0     1     0     2     0     0     0
     0     0     0     0     0     0     0     0     0
	
recalculate with outside level 1
     0     0     0     0     0     0     1     0     0
     0     4     2     0     0     0     0     0     0
     0     0     3     0     0     0     0     0     0
     0     1     0     1     0     0     0     0     0
     0     0     0     1     0     2     0     0     0
     0     0     0     0     0     0     0     0     0
	
recalculate with outside level 0
     0     0     0     0     0     0     0     0     0
     0     4     2     0     0     0     0     0     0
     0     0     3     0     0     0     0     0     0
     0     1     0     1     0     0     0     0     0
     0     0     0     1     0     2     0     0     0
     0     0     0     0     0     0     0     0     0
	

Michael Goldwasser
Last modified: Saturday, 18 April 2009