Open main menu

CDOT Wiki β

Changes

Team Blam-GridCode

264 bytes added, 12:20, 30 September 2010
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++);
}
}
for (x = 0; x < 20; x++)
{
Console.SetCursorPosition(x, i);
Console.Write("x");
}
 
for (i = 0; i < 20; i++)
{
Console.SetCursorPosition(i, 0);
Console.Write("x");
}
 
for (x = 0; x < 20; x++)
{
Console.SetCursorPosition(i, x);
Console.Write("x");
}
}
}
}
</pre>
1
edit