Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Locked thread
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

Adbot
ADBOT LOVES YOU

  • Locked thread