Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - DoomBringer316

Pages: [1] 2
1
The Waste Land / C++ garbage
« on: December 20, 2006, 09:42:55 am »
#include<iostream>

#define NULL 0

using namespace std;

template<typename T>class Vector
{
    T* Data;

    void Swap(int pos1, int pos2)
    {
        if ( pos1 < Size && pos2 < Size )
        {
            T temp = Data[pos1];
            Data[pos1] = Data[pos2];
            Data[pos2] = temp;
        }
        else
            throw "ERROR::VECTOR::SWAP invalid index";
    }
public:
    int Size;

    Vector()
    {
        Size = 0;
        Data = NULL;
    }

    ~Vector()
    {
        delete Data;
        Data = NULL;
        Size = 0;
    }

    T operator [] (int index)
    {
        if ( index < Size )
            return Data[index];
        else
            throw "ERROR::VECTOR::[] invalid index";
    }

    void Insert(T data)
    {
        T* NewData = new T[Size + 1];
        for ( int i = 0; i < Size; i++ )
        {
            NewData = Data;
        }
        NewData[Size] = data;

        Data = NewData;
        Size++;
    }
    //sorts descending for UpDown = 0 and ascending otherwise
    void Sort(int DownUp = 0)
    {
        if ( DownUp == 0 )
        {
            for ( int i = 0; i < Size; i++ )
            {
                for ( int j = i + 1; j < Size; j++ )
                {
                    if ( Data > Data[j] )
                    {
                        Swap(i,j);
                    }
                }
            }
        }
        else
        {
            for ( int i = 0; i < Size; i++ )
            {
                for ( int j = i + 1; j < Size; j++ )
                {
                    if ( Data < Data[j] )
                    {
                        Swap(i,j);
                    }
                }
            }
        }
    }
};

void main()
{
    Vector<int> MyVector;
    int temp;
    try
    {
        for ( int i = 0; i < 10; i++ )
        {
            cout << "Enter number " << i << ": ";
            cin >> temp;
            MyVector.Insert(temp);
        }
        MyVector.Sort();
        cout << endl;
        for ( int i = 0; i < MyVector.Size; i++ )
        {
            cout << MyVector << endl;
        }
    }
    catch( char* ex )
    {
        cout << ex << endl;
    }
}

2
The Pineapple / OMG I am new here.
« on: October 02, 2005, 08:40:30 am »
hey guyz watz goin on in dis forum?!?!

3
Site News / A Very Happy Birthday To Falco
« on: February 27, 2004, 01:06:04 pm »
Today just so happens to be Falco's birthday!1!!1!!!!! Have a great 17th, man. \m/

4
Everything Else / What Was The Best Present You Got
« on: December 25, 2003, 07:16:12 am »
Well, it's Christmas today, so what's the best thing you got? I got a brand new Fender acoustic guitar. It's beautiful, the wood on it is so nice. I love it.

5
The Pineapple / In Regards To Pwnage
« on: September 01, 2003, 04:17:10 pm »
Wow... where to start. Ok guys (and girls), I brought the word pwnage and all that follows with it to the boards just for a little bit of fun, to make things a little more interesting. But it has REALLY gotten out of hand. The C-man had to ban 6 people because of flaming, and no doubt the reason is because we all try to 'pwn' eachother. Honestly guys, it's getting old. Everyone tries to pwn eachother and then people leave because they don't feel welcome here. And I feel that it is my fault that the boards have gone down-hill recently because I am the one that started this. So I apologize to cmonkey for that. Just stop trying to pwn eachother. Half of you don't even do it right anyway.

</rant>

6
Everything Else / An Nge Meeting. Again.
« on: August 24, 2003, 10:40:12 pm »
Yeah, Falco and I jammed today. All day. We learned The Legend Of Zelda theme, and Back in Black by AC/DC. The Legend of Zelda song and tab is on my site for you aspiring guitarists that want to pwn like me. swellfeller was absent today, and he missed out on the Ninja Pizza. Oh, and the Junior Senior video rules. A lot.

7
Everything Else / POLL: Spiderman, Or Thingy?
« on: August 24, 2003, 05:29:48 pm »
I just can't decide. They are both equally awesome.

8
Everything Else / The Picture Topic.
« on: August 20, 2003, 06:37:10 pm »
Yeah. Well, I uploaded a pic of myself for you curious SZ'ers out there, but unfortunately, I can't get it to host right. So, you'll have to IM me to see it. If you can handle the awesome. Also, if you've got pics, post 'em here.  

9
The Pineapple / Well Guys, I'm Leaving For Myrtle Beach Tomorrow
« on: August 09, 2003, 08:50:06 pm »
Yep, leaving at noon tomorrow (Sunday) and won't be back until Saturday. It's gonna be a blast, but I know you will miss my awesome at the boards.

10
Computers & Video Games / Favorite Rpg?
« on: August 02, 2003, 10:45:25 pm »
Final Fantasy Tactics pwnz j00. Best. Storyline. Ever. I love it. Breath of Fire 3 and Morrowind get honorable mentions.

11
Easter Island Head / Does Anyone Ever Do Any Fanart?
« on: July 12, 2003, 09:11:50 pm »
I'd like to see some.

12
Computers & Video Games / The Legend Of Zelda
« on: July 12, 2003, 09:06:25 pm »
Just wanted to let you know,

The Legend of Zelda for NES > j00.

That is all.

13
Computers & Video Games / Video Game Rock Band!
« on: June 30, 2003, 10:15:25 pm »
Anyone who has played old school Contra and other NES games needs to hear these guys. They rule. Do a google search for NESkimos.

14
The Pineapple / Hey Everyone.
« on: June 30, 2003, 09:54:57 pm »
Hi. Forums rule.

15
Computers & Video Games / Console Wars
« on: June 30, 2003, 09:35:11 pm »
Now, I know this hasn't really happened yet, but usually on a general game board it can happen. The inevitable Console Wars. Fanboys will claim that one system is superior to another, and then a fanboy of a different console disagrees, and what usually ensues is a flame war. I don't have a problem about you guys just arguing over which one you think is better as long as flames don't start flying. If you do want to argue about consoles, please do it in a nicer, friendlier way. With this in mind, we can make the board a HAPPY PLACE! Yay.

Pages: [1] 2