1
edit
Changes
no edit summary
*If you have any changes / upgrades to this code, post here for the benefit of others*
**Edit: Updated it to use an array for grid storage**
<pre>
/*
* Basic char array grid creator
* Created by: Andrew Condinho
* 9/30/2010
*/
using System;
using System.Collections.Generic;
static void Main(string[] args)
{
//create array to hold grid coordinates char[,] gridArray = new char[20, 20]; //populate grid -- !!!replace this with a grid generator!!! for (int i = 0; i < 20; i++) { gridArray[0, i] = 'x'; gridArray[19, i] = 'x'; } for (int i = 1; i < 19; i++) { gridArray[i, 0] = 'x'; gridArray[i, 19] = 'x'; } drawGrid(gridArray);
//Grid is useable starting at 1,1
}
static void drawGrid(char [,] gArray)
{
int i hop = 01; int x = 0; for (int i = 10; i < 1920; i++)
{
for (int x = 0; x < 20; x++) { Console.SetCursorPositionWrite(0gArray[i, ix]); } Console.WriteSetCursorPosition("x"0, hop++);
}
}
}
}
</pre>