Q:

Basic height map generator

I've made this relatively basic height map generator on my own just to see if I could pull it off because I'm still a newbie when it comes to programming. So my question is: "Is there a fairly obvious way I can optimize it?". I put in effort to make the code as clean as I can write it so any input from a quick review (if you have nothing better to do of course) would be greatly appreciated. Here is the ORIGINAL code:
using System;
using System.Diagnostics;

namespace height_map_generator
{

    class Program
    {
        private static readonly int bufferWidth = 237;
        private static readonly int bufferHeight = 90;

        private static readonly double nodeProbability = 0.007; //Initial node spawn probability in each point of buffer array. (The higher this number is the more peaks on the map.)
        private static readonly double intervalFraction = 0.03; //Number must be between 0 and 1. (The lower this number - the higher the variability and sharpness of terrain.)

        private static readonly double maxDistanceFromCentre = Math.Sqrt(Math.Pow(bufferWidth / 2, 2) + Math.Pow(bufferHeight / 2, 2));
        private static readonly double distanceInterval = maxDistanceFromCentre * intervalFraction;

        private static readonly Random rand = new Random();

        private static int[,] mapBuffer = new int[bufferWidth, bufferHeight];
        private static int[,] nodePositionValue = new int[bufferWidth, bufferHeight];
        private static int[] nodeXposition = new int[bufferWidth * bufferHeight];
        private static int[] nodeYposition = new int[bufferHeight * bufferWidth];

        private static int nodeCount = 0; //Currently not in use.

        static void Main(string[] args)
        {
            Console.SetBufferSize(bufferWidth, bufferHeight);
            Console.ForegroundColor = ConsoleColor.Green;

            string elapsedTime = null;

            Stopwatch sw = new Stopwatch();
            sw.Start();

            constructNodes(nodeProbability); // First.
            setNodeCoordinates(); // Second.
            compareDistancesAndSetEachPoint(); // Third.

            sw.Stop();
            elapsedTime = sw.Elapsed.ToString();

            writeTerrain(); // Final.

            Console.SetBufferSize(bufferWidth, bufferHeight + 2);
            Console.WriteLine();
            Console.Write("Operation completed in: " + elapsedTime);

            Console.ReadKey(); //Wait before quitting.
        }

        private static void constructNodes(double probability)
        {
            for (int y = 0; y < bufferHeight; y++)
            {
                for (int x = 0; x < bufferWidth; x++)
                {
                    if (probabilityResult(probability))
                    {
                        int nodeAmp = generateNodeAmplitude();

                        mapBuffer[x, y] = nodeAmp;
                        nodePositionValue[x, y] = nodeAmp;
                    }
                }
            }
        }

        private static void setNodeCoordinates()
        {
            int nodes = 0;

            for (int y = 0; y < bufferHeight; y++)
            {
                for (int x = 0; x < bufferWidth; x++)
                {
                    if (nodePositionValue[x, y] != 0)
                    {
                        nodeXposition[nodes] = x;
                        nodeYposition[nodes] = y;
                        nodes++;
                    }
                }
            } 

            nodeCount = nodes;
        }

        private static void compareDistancesAndSetEachPoint()
        {
            for (int y = 0; y < bufferHeight; y++)
            {
                for (int x = 0; x < bufferWidth; x++)
                {
                    if (spaceAvailable(x, y))
                    {
                        int n = 0;

                        double minimumDistance = 0;
                        int nodeAmplitude = 0;

                        foreach (int i in nodeXposition)
                        {
                            if (n == 0)
                                minimumDistance = Math.Sqrt(Math.Pow(x - nodeXposition[n], 2) + Math.Pow(y - nodeYposition[n], 2));
                            else if (minimumDistance > Math.Sqrt(Math.Pow(x - nodeXposition[n], 2) + Math.Pow(y - nodeYposition[n], 2)))
                            {
                                minimumDistance = Math.Sqrt(Math.Pow(x - nodeXposition[n], 2) + Math.Pow(y - nodeYposition[n], 2));

                                nodeAmplitude = nodePositionValue[nodeXposition[n], nodeYposition[n]];
                            }

                            n++;
                        }

                        setAmplitude(x, y, minimumDistance, nodeAmplitude);
                    }
                }
            } 
        }

        private static void writeTerrain()
        {
            for (int y = 0; y < bufferHeight; y++)
            {
                for (int x = 0; x < bufferWidth; x++)
                {
                    Console.SetCursorPosition(x, y);
                    Console.Write(mapBuffer[x, y]);
                }
            }
        }

        /*******************************************************************************/

        private static void setAmplitude(int x, int y, double distance, int nodeAmplitude)
        {
            int k = 1;

            while (true)
            {
                if (distance <= k * distanceInterval)
                {
                    //---------------------------------------COSMETIC 'IF' STATEMENT----------------------------------------- (Should be removed when using the data.)
                    if (k + nodeAmplitude <= 9)
                        mapBuffer.SetValue(nodeAmplitude + k, x, y);
                    else
                        mapBuffer.SetValue(9, x, y);
                    //-------------------------------------------------------------------------------------------------------

                    break;
                }

                k++;
            }
        }

        private static bool spaceAvailable(int x, int y)
        {
            if (nodePositionValue[x, y] == 0)
                return true;
            else
                return false;
        }

        private static bool probabilityResult(double percent)
        {
            if (percent <= 0 || percent > 1)
                throw new ArgumentOutOfRangeException("Probability must be between 0 and 1.");

            return rand.NextDouble() <= percent;
        }

        private static int generateNodeAmplitude()
        {
            int num = rand.Next(1, 4);

            return num;
        }
    }
}

A:

A couple quick things:
If you are using while loops for iterations, just use for loops.
//I have to look in three places to understand how the loop works
int x = 0;
while(x < 10){x++;}

//Everything I need is right here 
for(int x = 0; x < 10; x++){}

In probability result, you can drop the if and the new variable. Just do it like this
private static bool probabilityResult(double percent)
{
    if (percent <= 0 || percent > 1)
            throw new ArgumentOutOfRangeException("Probability must be between 0 and 1.");

    return rand.NextDouble() <= percent;
}

You can apply the same logic to several of your other functions. No need to save data to temp var if you're going to return it immediately 
As far as actual performance goes, instead of using a multidimensional array ([,]), use a jagged array([][]). Due to compiler optimizations jagged arrays often perform better.

A:

DRY

for (int y = 0; y < bufferHeight; y++)
{
    for (int x = 0; x < bufferWidth; x++)
    {
    }
}

If you happen to write the same code more then once it usually means something needs to be encapsulated.
As far as loops are concerned you have two choices:

convenience first - go with LINQ and helper strucutres like Point
performance first - go with loops and delegates

I prefer the first option and switch do the second one only if something really seems to run slow and I notice and measured it.
So how would it look like if you ware lazy and wanted to get the job done quickly? You would create a map point generator:
public static class Map
{ 
    public static IEnumerable<Point> GeneratePoints(int width, int height)
    {
        for (int y = 0; y < height; y++)
            for (int x = 0; x < width; x++)
                yield return new Point(x, y);
    }
}

that you can reuse everywhere you need the coordinates:
foreach(var point in Map.GeneratePointS(bufferWidth, bufferHeight))
{
    ...
}

Assuming the spaceAvailable method works with Point you could greatly shorten the compareDistancesAndSetEachPoint to soemthing like this:
var availablePoints = Map.GeneratePoints(bufferWidth, bufferHeight).Where(spaceAvailable);
foreach (var point in availablePoints)
{
    ...
}

In the second case you would use a delegate:
public static void ForEachPoint(int width, int height, Action<int, int, int> action)
{
    var i = 0;
    for (int y = 0; y < height; y++)
        for (int x = 0; x < width; x++)
            action(x, y, i++);
}

so the processing would now look like this
Map.ForEachPoint(bufferWidth, bufferHeight), (x, y, i) =>
{
    ...
});

where for each point the action is executed however its signature Action<int, int, int> isn't easy to understand and actually needs commenting. You can avoid this by creating a custom delegate:
public delegate void ProcessPointCallback(int x, int y, int index);

you would then change the signature of the ForEachPoint method to
public static void ForEachPoint(int width, int height, ProcessPointCallback processPoint) 

and the rest remains the same.

Other suggestions

private static bool spaceAvailable(int x, int y)
{
    if (nodePositionValue[x, y] == 0)
        return true;
    else
        return false;
}

You don't need an if for something like this. It's better to just write:
private static bool spaceAvailable(int x, int y)
{
    return nodePositionValue[x, y] == 0;
}

while (true)
{
    if (distance <= k * distanceInterval)
    {
      ...
    }

    k++;
}

You should try to avoid nesting and actually use the while() as an if. This means you should put the condition for the loop where it belongs (and adjusting it of course):
while (distance > k * distanceInterval)
{
    ...
}

A:

Ideally, you should not orchestrate the entire lifecycle of your application from Program class, but I left it...
There are also lots of things I was unable to understand, and I left them aside [consider as a "homework" for you :)].
I am using a few classes since I believe you wanted to see a more object oriented approach.
Notice that the code is still neither super clean (OOP-wise), nor super efficient, but gives you the basic direction (@Zebraman has a great comment on the underlying data structure you use). Let me know if you want anything to be explained in detail.
class Program
{
    private static readonly int bufferWidth = 237;
    private static readonly int bufferHeight = 90;

    private static readonly double nodeSpawnProbability = 0.007; //Initial node spawn probability in each point of buffer array. (The higher this number is the more peaks on the map.)
    private static readonly double intervalFraction = 0.03; //Number must be between 0 and 1. (The lower this number - the higher the variability and sharpness of terrain.)

    private static readonly double maxDistanceFromCentre = Math.Sqrt(Math.Pow(bufferWidth / 2, 2) + Math.Pow(bufferHeight / 2, 2));
    private static readonly double distanceInterval = maxDistanceFromCentre * intervalFraction;

    static void Main(string[] args)
    {
        Console.SetBufferSize(bufferWidth, bufferHeight);
        Console.ForegroundColor = ConsoleColor.Green;

        var stopwatch = new Stopwatch();
        stopwatch.Start();

        var grid = new GridFactory()
            .CreateGrid(bufferWidth, bufferHeight, nodeSpawnProbability); // First.

        // Variable is unused...
        var nodeCount = grid.NodeCount; // Second.
        // CompareAndSet(grid); // Third.

        stopwatch.Stop();

        WriteTerrain(grid); // Final.

        Console.SetBufferSize(bufferWidth, bufferHeight + 2);
        Console.WriteLine();

        Console.Write("Operation completed in: " + stopwatch.Elapsed.ToString());

        Console.ReadKey(); //Wait before quitting.
    }

    // private static void CompareAndSet(Grid grid)
    // {
    //     // TODO
    // }

    private static void WriteTerrain(Grid gridToPlot)
    {
        foreach (var location in gridToPlot.AllLocations)
        {
            Console.SetCursorPosition(location.X, location.Y);
            Console.Write(gridToPlot[location.X, location.Y]);
        }
    }

    private static void UpdateGridAmplitudes(Grid grid, int x, int y, double distance, int threshold)
    {
        int k = 1;
        while (true)
        {
            if (distance <= k * distanceInterval)
            {
                if (k + threshold <= 9)
                    grid[x, y].Amplitude = threshold + k;
                else
                    grid[x, y].Amplitude = 9;
                break;
            }
            k++;
        }
    }
}

Something that creates a Grid:
public class GridFactory
{
    private static readonly Random random = new Random();

    public Grid CreateGrid(int bufferWidth, int bufferHeight, double nodeSpawnProbability)
    {
        var grid = new Grid(bufferWidth, bufferHeight);
        foreach (var location in grid.AllLocations)
        {
            if (TrueIfRandomWith(nodeSpawnProbability))
                grid[location.X, location.Y].Amplitude = RandomAmplitude();
        }
        return grid;
    }

    private bool TrueIfRandomWith(double probability)
    {
        if (probability <= 0 || probability > 1)
            throw new ArgumentOutOfRangeException("Probability must be between 0 and 1.");
        return random.NextDouble() <= probability;
    }

    private int RandomAmplitude()
    {
        return random.Next(1, 4);
    }
}

Grid that represents a map:
public class Grid
{
    private readonly int _bufferWidth;
    private readonly int _bufferHeight;
    private readonly GridCell[,] _matrix;

    public Grid(int bufferWidth, int bufferHeight)
    {
        _bufferWidth = bufferWidth;
        _bufferHeight = bufferHeight;

        _matrix = new GridCell[_bufferWidth, _bufferHeight];
        foreach (var location in AllLocations)
            _matrix[location.X, location.Y] = new GridCell();
    }

    public GridCell this[int x, int y]
    {
        get
        {
            return _matrix[x, y];
        }
        set
        {
            _matrix[x, y] = value;
        }
    }

    public IEnumerable<GridLocation> AllLocations
    {
        get
        {
            var xs = Enumerable.Range(0, _bufferWidth);
            var ys = Enumerable.Range(0, _bufferHeight);
            var allGridCoordinates = xs.SelectMany(x => ys.Select(y => new GridLocation { X = x, Y = y }));
            return allGridCoordinates;
        }
    }

    public int NodeCount
    {
        get
        {
            return AllLocations
                .Count(location => this[location.X, location.Y].IsAvailable == false);
        }
    }
}

Grid location ("coordinate")
public class GridLocation
{
    public int X { get; set; }
    public int Y { get; set; }
}

Grid cell:
public class GridCell
{
    public bool IsAvailable { get; set; } = true;
    public int Amplitude { get; set; } = 0;
}

Update 1
There tons and tons of materials that explain what are the strengths (and the weaknesses) of the OOP. You can start from here.
Here are a few ideas about the application of OOP principles.
In OOP-ed code, the data and the related processing functions (methods) are encapsulated into small entities (classes). The encapsulation has various positive effects, and a few negative effects.
You may see that with the rewritten code we can change Grid, GridLocation, and GridCell more independently. For example, if we need to have some extra information about each location on the map, we may add some fields to GridCell class rather than creating a whole new int[,] extraDataMap which is by the way completely disconnected from the space and other maps...
It's really hard to explain the benefits of OOP in one example, but I think more will come as you learn through reading and practicing.

