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 - WhatevaGuy

Pages: [1] 2 3
1
Off Topic / WhatevaGuy is learning C++!
« on: June 05, 2011, 09:06:43 PM »
And he wants to show off a few select programs o:

Also I would like to invite you to show off your select few programs if you wish!  :D

Note - if you don't feel like reading all this, just skip down to the code or leave if you like, this is my excited rambling

Anyways, just for the record, I use CodeBlocks as a compiler and it is delightful and I would recommend it to everybody (never mind the fact that I've never used anything else).  I am learning through C++ For Dummies (I don't know if this is a quality book or not, but it's done a fairly good job of teaching me so far) and I have made a few programs on my own and a few programs that the book has told me to make.

I have included a WinRAR of every program I've made thus far, and the .exe is located in bin\debug I believe, so if you don't have a compiler to look at the code you can still see the results!

Also, if you do not have a compiler feel free to ask me for any source code, although I don't mean to flatter myself by saying y'all are indubitably enthralled by my delicious programming, I'm just saying the offer is there.

My favorite programs so far are the square number/cube number calculators.  I could easily have done a simple loop saying, "multiply n by itself, output that, add one to n, repeat" but I used a new algorithm that I made all by myself for both!
You'll see in the source code.

Also here's a list of the ones that I made because CppFD told me so:
  • booltest
  • breakdemo
  • loops

Just as a warning, there are a few very stupid ones that I made early on (especially 'template', I don't know why I made that) like 'death' and 'counter' but alas, I'm too lazy/packrattish to delete them.

Anyways here is the source to the cubenumbers, squarenumbers, and collatzConjectureTotal:

I actually have a set of hypotheses which I have created: "If x = y - 1, then x2 = y2 - (2y - 1)" and "If x = y + 1, then x2 = y2 + (2y + 1)"
Code: (squarenumbers) [Select]
//Lists square numbers up to a user-defined point.

#include <cstdio>
#include <cstdlib>
#include <iostream>

using namespace std;

int main(int nNumberofArgs, char* pszArgs)
{
    //Set up all necessary variables.
    int square;
    int root;
    int additive;
    int limitdecision;
    int limit;

    //Define a few variables.
    square = 0;
    root = 0;
    additive = 1;
    cout << "Would you like a (0) root- or (1) square- limit? ";
    cin >> limitdecision;
    switch (limitdecision)
    {
        case 0:
            break;
        case 1:
            break;
        default:
            return 0;
    }
    cout << "Please enter the limit for the square numbers: ";
    cin >> limit;
    limit += 1;

    //Loop time!
    if (limitdecision == 0)
    {
        while (root < limit)
        {
            cout << square << " - " << root << endl;
            square += additive;
            root += 1;
            additive += 2;
        }
        system("PAUSE");
        return 0;
    }
    if (limitdecision == 1)
    {
        while (square < limit)
        {
            cout << square << " - " << root << endl;
            square += additive;
            root += 1;
            additive +=2;
        }
        system("PAUSE");
        return 0;
    }
}

I'll provide my equation as soon as I re-figure it out :(
Code: (cubenumbers) [Select]
//Lists square numbers up to a user-defined point.

#include <cstdio>
#include <cstdlib>
#include <iostream>

using namespace std;

int main(int nNumberofArgs, char* pszArgs)
{
    //Set up all necessary variables.
    int cube;
    int root;
    int additive1;
    int additive2;
    int limitdecision;
    int limit;

    //Define a few variables.
    cube = 0;
    root = 0;
    additive1 = 1;
    additive2 = 6;
    cout << "Would you like a (0) root- or (1) cube- limit? ";
    cin >> limitdecision;
    switch (limitdecision)
    {
        case 0:
            break;
        case 1:
            break;
        default:
            return 0;
    }
    cout << "Please enter the limit for the cubed numbers: ";
    cin >> limit;
    limit += 1;

    //Loop time!
    if (limitdecision == 0)
    {
        while (root < limit)
        {
            cout << cube << " - " << root << endl;
            cube += additive1;
            additive1 += additive2;
            additive2 += 6;
            root += 1;
        }
        system("PAUSE");
        return 0;
    }
    if (limitdecision == 1)
    {
        while (cube < limit)
        {
            cout << cube << " - " << root << endl;
            cube += additive1;
            additive1 += additive2;
            additive2 += 6;
            root += 1;
        }
        system("PAUSE");
        return 0;
    }
}

http://en.wikipedia.org/wiki/Collatz_conjecture
Code: (collatzConjectureTotal) [Select]
//Collatz Conjecture - 1 can be derived from any integer if, while the integer is even,
//it is divided by two and, if it is odd, it is multiplied by three and increased by one.

#include <iostream>
#include <cstdlib>
#include <cstdio>
#include <windows.h>

using namespace std;

int collatzConjecture()
{
    int num;
    cout << "Please enter a number: ";
    cin >> num;
    system("CLS");

    //as long as the number is NOT one
    while(num != 1)
    {
        //output the number for client
        cout << num << endl;

        //check if the number is odd or even
        bool oddeven;
        oddeven = (num % 2 == 0);

        //take certain action, depending on whether num is odd or even
        switch(oddeven)
        {
            case 1:
                num = num/2;
                break;
            case 0:
                num = (num*3) + 1;
                break;
        }
    }

    cout << "1\n\n";
    cout << "Done!\n\n";
    system("PAUSE");
    return 0;
}

void collatzConjectureTwo()
{
    //setup...
    string oper;
    int delay;
    int num2;
    cout << "Starting number: "; //ask for starting number
    cin >> num2;
    cout << "Delay (millisecs): "; //ask for delaytime
    cin >> delay;

    //loop forever (unless user inputs 0 or less..)
    while (num2 > 0)
    {
        //clearscreen
        system("CLS");
        int num1 = num2; //set number1 to be number 2
        oper = "start"; //make sure this always reads 'start' on the first time
        while(num1 != 1) //as long as number1 is not 1..
        {
            cout << num1 << " - " << num2 << " - " << oper << endl; //output EVERYTHING
            Sleep(delay); //sleep for however long user wants
            bool oddeven; //test whether or not the number is even
            oddeven = (num1 % 2 == 0); //this is not the work of me, by the way, so don't go giving me credit for this line.  the rest is me though


            switch(oddeven)
            {
                case 1: //if even, divide by two
                    num1 = num1/2;
                    oper = "n/2";
                    break;
                case 0: //if odd, multiply by three and add 1
                    num1 = (num1*3) + 1;
                    oper = "3n+1";
                    break;
            }
        }
        cout << "1 - " << num2; //finish it up
        system("CLS");
        num2 += 1; //add one two num2 so we can do the same thing with the next number :D
    }
}

int main(int nNumberofArgs, char* pszArgs[])
{
    int collatzchoice;
    cout << "Collatz Conjecture 1 (1) or 2 (2)? ";
    cin >> collatzchoice;

    switch(collatzchoice)
    {
        case 1:
        system("CLS");
            collatzConjecture();
            return 0;
        case 2:
            system("CLS");
            collatzConjectureTwo();
    }
}

If explanation is needed for anything, go ahead and ask me.
By the way you can tell that I have gotten more wise with my use of functions.  It's very apparent in clock, less so in cct and nonexistant in mostly everywhere else

Anyways, please give me feedback and tips and perhaps ideas which are reasonable
And I would be happy to see some of your programs as well.

Archive of all my programs so far :D
http://foco.us/bpdO

2
Off Topic / Has anybody ever broken a hammer in their piano?
« on: May 09, 2011, 08:39:00 PM »
I happen to be extra expressive when I play - wide range, of course, not just loud - but when there is a part of a song that is meant to be loud (like, say, the very end of Philosophy) I tend to play it extremely loud because, I don't know, it feels wonderful.

Of course, I think my rugged manliness loud playing was just a bit too much for the piano, and one of the hammers broke.  Should I tone it down, or is this more common than I'd expect? :c

3


As you can see, the little sidebar bit has been acting up for me.  Is this a problem with chrome, or has it happened to all of the users?  It wasn't too long ago that it started.
Also, don't get the idea that I'm being picky or something.  It doesn't bother me, I'm just rather curious.
Also, I hope this hasn't been asked before or some such, but I did use the search and didn't find anything.
Thanks!

4
Off Topic / .bat file help
« on: January 16, 2011, 12:38:20 PM »
Okay, so what I want to do is make a batch file that will ask which site you want to visit, ping it, and automatically 'start' the IP address.  Is there any possible way to do this?  No legitimate reason, I've just been playing around with them lately and I wanted to see if this was possible.
Currently, the closest thing I have is:

Code: [Select]
@echo off
set /p ping1=Please enter the name of the website you wish to access (exclude 'http://www."  and the final "/"):
ping %ping1%
set /p ping2=Please type the IP address exactly as you see it:
start http://%ping2%/

This isn't really close at all, because it isn't automatic, so I wanted to know if this could be done.
Any help appreciated :D

5
Off Topic / More computer trouble yay
« on: December 25, 2010, 04:42:13 PM »
I'm trying to run Fallout 3 GotYE and after a few minutes of gameplay, everything but the sound will freeze up and it will stop responding.

I've tried:
  • Updating drivers,
  • Running Steam in compatibility mode with Vista,
  • Running Fallout3.exe in compatibility mode with Vista,
  • Running both at the same time in blah you get it,
  • Changing settings to lowest,
  • Using that "game booster" software,
  • Changing it to windowed mode (like that'd do anything).

Help?  :C

6
Games / Bioshock 2 Error
« on: November 04, 2010, 04:48:14 PM »
I think this is the right section.  Probably is.
Anyways, there is no way I can explain it except a movie (pictures don't work).
For once ImageShack /actually works/ for me.  Hooray.
Any ideas what could be wrong with it?  Here are my specs, in case you need them:

So, can anybody help?

7
Off Topic / Cruise, Freeport, and Nassau. :D
« on: July 22, 2010, 09:55:22 AM »
I just had the most amazing luck to be able to go on a four-day cruise to the Bahamas.  I <3 my family.
Basically, we drove down to Cape Canaveral (12 hours, but I can't complain) the day before, slept over and boarded the cruise on the 18th at like, 1:30.  There was a pool and slides and a gourmet dinner (complimentary.  Or complementary.  forget spelling) which was amazing.  We arrived a day later at the beautiful island of Freeport and walked around some markets and the beach.  Then, the next day we docked at an even prettier island: Nassau.  The waves were amazing, and taller than my brother (who's 6'7" or something).  I got knocked over a lot but it was fun anyways.
For dinner we went to The Green Parrot.  I had a philly cheese steak and my sister/brother got burgers.  I had a sip of rum coke.  Not terrible, but more than a few sips of alcohol makes me feel sick so I don't drink it much.
Also, there were rum cake samples on the ship, which were great.
I didn't take pictures, but my sister did.  I'll put them up when I can.
Discuse~
(Ever been on a cruise?  Or been in the Bahamas?  Etc.)

8
Off Topic / Garry's Mod Help
« on: June 18, 2010, 12:32:46 PM »
I was trying to play Garry's Mod today.  (Error: attached)
What am I doing wrong here?  Do I need a different source game or something?  I asked somebody on HLDM: S and they told me to reinstall it, but I'm a moron unsure of how to do this.
Can anybody help?
Thanks a bunch.

9
Off Topic / The Entertainer
« on: March 17, 2010, 07:59:00 PM »
Scott Joplin :D
Okay, so I recently discovered that we had a copy of The Entertainer:

(Sorry for crappy quality; it was a crappy camera and I'm no photographer.)
Needless to say, it is awesome.  I love playing it because I love jazz, and in social studies we're learning about the Roaring Twenties (which includes Scott Joplin), which makes it cool for me.

I have also played/can play:
Dark Blue
Klavierstueck fuer Elise

DB is the only one I have printed off (I had owned the other two for whatever reason) so here is the sheet music:
http://modernpianom...

Maybe someday I'll put a video up, or something, but for now that's all you get.
Discuss songs, piano, or music in general.

10
Off Topic / Stupid People Continue to Amaze Me
« on: February 22, 2010, 06:59:24 PM »
<rant>
My sister's 'friend' (if you can call her that; we both hate her very much) Alex, is a whiny, egotistical psychopath that lacks the part of her brain where you make decisions.

First off, lemme just say that she is sixteen.
Two nights ago Alex was drunk driving.  loving drunk driving.  Like, honestly?  What caliber stupid do you have to be to do something like that?  And here's the punch line--afterward she was playing it off.
Acting all cool and such.  As though she thought it was a positive thing to have done.

What's more, at about the time she was driving, another one of my sister's friends was driving to the hospital.
With her husband.
To have her baby delivered.  What if she was killed?  That would leave two little girls without a mother or father, and would kill an unborn baby.

And good lord, one of my friends could've been on the road.  Their parents, even!  I had a friend over that night.  What if the phone rang, telling him that they're parents were in a car crash.
"Hey, John, I gotta go.  Both of my parents are dead."
Hoo-loving-ray, you screwed up not only your life but his life too.

And I mean, Alex could have killed herself, but honestly?  I don't give a forget.
If she had ran into a tree, that's one less idiot putting our lives and our friends' lives in danger.
</rant>

Discuss stupid people.

11
Off Topic / SlenderMan
« on: February 10, 2010, 08:03:46 PM »
SLENDERMAN

VIDEOS:
Okay, so, if you haven't seen the videos, go for it.  Here is MarbleHornets.  In addition, here is Twitter and ToTheArk.  Basically, it is about a guy (Jay) who's friend has been acting weird.  He receives some tapes from said friend, and decides to upload them to YouTube for safekeeping.  Not soon after, a user by the name of ToTheArk begins to respond to his videos in a completely non-sensical manner, but yet disturbing nonetheless.  Keep in mind that Jay is acting like all this is real, which just enhances all of it.  Make sure to check out the Twitter page--I know some of you may be anti-Twitter (as am I) but it's worth it.
Video progress: he is at Entry #23.  I reccomend watching every single one of these videos.

HISTORY:
SlenderMan was created on June 10th, 2009 by a fellow of the name VictorSurge in the Something Awful forums.  Link provided.

PICTURES:
There have been a variety of pictures made.  Here are a few (click for larger version).

Please note that I do not take credit for any pictures, stories, or other media that involves SlenderMan.

STORIES:
There have been oh so many stories, too.  in fact, I feel I should share a few with you.

There are a few posted here.

There are a bunch more on the SAF topic (just go to the place I linked to).

THIS TOPIC IS A WORK IN PROGRESS.  If you feel I have left anything out, or if I made a mistake, do not hesitate to tell me.  In fact, why not try your hand at writing a story!  I will include it if it's good enough! (Credits will be given.)

CONSTRUCTIVE CRITICISM APPRECIATED, MINDLESS INSULTS DISCOURAGED.

12
Off Topic / Sherlock Holmes
« on: January 10, 2010, 10:09:32 AM »
I realize that there is already a topic; however, that is for the movie, not the series by Arthur Conan Doyle.

Anyways, I decided that I really wanted to read something classic, seeing as I haven't for a while, and so I got The Adventures of Sherlock Holmes.
And oh my God, these are amazing.  How have I been alive for twelve years and not read this until yesterday?

The first story I read: A Scandal in Bolivia.  It was great.  As of now I'm reading A Case of Identity.


Discuss.

13
Creativity / New Story: The Voices
« on: December 19, 2009, 02:50:22 PM »
I started today, and I am happy that I am back using Word--I love ya Google, but GDocs isn't my favorite thing in the world.

Anyways, this is what I have so far.  Notify me of typos 'n' schtuff.

Quote from: The Voices
   I have always been different.  Hearing things others don’t, seeing things others don’t, sometimes even feeling things others don’t—this is rare, but it has happened.
   They say that people like me are crazy; I know for a fact that this is not true, for if I were crazy how could I be here talking to you?  People have told me that I will never amount to anything, that I will be an outcast all my life; maybe they’re right and maybe not, but that does not concern me.  What I am here to tell you about is what happened the night of April 21st, 2007—and every night after that until January 1st, 2010.

   You see, I sometimes hear voices; a raspy, deep, and very quiet voice, almost a whisper, maybe less.  But they--these voices--have never said anything up until that day. It was a Saturday, I remember that, and it was sometime around ten o’clock at night.  So faint at first, but day after day they grew louder, and less tolerable.
   But it became worse, because you see: with every voice there must be a body to go with it.  And it was when I realized that it wasn’t just sounds I was hearing, but things I was seeing that I realized that this did not exist purely within my subconscious, but in the real world.
   I was one of the few people here that could see these things.
   And I was the only that could stop them.

I like it so far.  I might finish it--I haven't done that in a long time.

Constructive criticism encouraged!

News/Updates:
  • Posted snippet.
  • Fixed a past tense/present tense contradiction.
  • Changed title.
  • Poll added.
  • Wording changed

14
Suggestions & Requests / Total Loading Bar
« on: December 15, 2009, 04:12:11 PM »
I'm not quite sure if this is possible, but maybe a loading bar that shows how far you have progressed into fully loading everything on the server, as opposed to just having the bar show how far into the current add-on you've gone.

Picture attached--sorry if it's a little crappy.

15
Suggestions & Requests / Forum 'Anchors'
« on: November 25, 2009, 12:20:22 PM »
Sorry, but I couldn't think of another way to say it.

Alright, well, I have been playing around with HTML and I thought a great feature is the 'anchor' thing.

Like this:

<a name="anchor">This would be an anchor.</a>

Then you would add the other stuff, and then:

<a href="#anchor">Back to top.</a>

I don't know if this is possible, if not I apologize, but the reason this is a good idea to me is to help with clans (take The Craftsmen for example) that have an index.

That code is correct, right?

Pages: [1] 2 3