- invision
- Mar 2, 2009
-
I DIDN'T GET ENOUGH RAPE LAST TIME, MAY I HAVE SOME MORE?
|
You ever wrote some code, then in the middle of it went "I'm dumb", except you instead of doing it correctly you just beat it with a hammer and pray for the best?
code:namespace Day3_House_In_Vacuum
{
class Program
{
static void Main(string[] args)
{
string inputstring = String.input;
int length = inputstring.Length;
int[ , , ] map = new int[length*2, length*2, 1];//'cause negative indexes don't work and memory is cheap.
map[0, 0, 0] = 1; //since we've been here already.
int counter = 1; //for first move.
int character = 0; //for counting characters in the string
int x = 8192; //'cause we're gonna hit a negative index otherwise
int y = 8192; //and because I'm a lazy jerk
while (character < length)
{
char currentchar = inputstring[character];
Console.WriteLine(currentchar.ToString());
if (currentchar.ToString().Contains("^"))
{
x += 1; //move north
Console.WriteLine("north " + x);
if (map[x, y, 0] == 0)
{
counter++;
}
map[x, y, 0] = 1;
}
}
invision fucked around with this message at 12:17 on Dec 11, 2015
|
#
¿
Dec 11, 2015 11:39
|
|
- Adbot
-
ADBOT LOVES YOU
|
|
#
¿
May 12, 2024 19:07
|
|