C Diamond Square Algorithm Creates Diagonal Cut Stack Overflow

C Diamond Square Algorithm Creates Diagonal Cut Stack Overflow