Beispiel #1
0
 private void GenerateColors()
 {
     _colors = new Grid<double>( _gridSize );
       _colors.SetEach( RandomHelper.Random.NextDouble );
 }
Beispiel #2
0
 private void GenerateBlock()
 {
     _blocks = new Grid<bool>(_gridSize);
       _blocks.SetEach(
     ( block, point ) =>
       !_paths[ point ] &&
       ( _trees[ point ] != '.'
       || _walls[ point ]
       || _rivers[ point ] )
       );
       var blocks = new Grid<byte>(_gridSize);
       blocks.SetEach(
     (value, point) =>
       (byte)(_blocks[point] ? 0 : 255)
       );
       File.WriteAllText( "blocks.pgm", blocks.ToPgm() );
 }