Be a Supporter!
Response to: Running Javascript on a server? Posted March 11th, 2012 in Programming

Hypocrites much? I suggested AJAX and then apparently after calling me an idiot, you turn around and suggest AJAX again.

Response to: Word probability Posted March 7th, 2012 in General

The irony is that the program could run forever, theoretically. Different runs of the program results in radically different timings (sometimes it does it quickly, sometimes it takes a while.) The alphabet used also affects the runtime. For example, mine is simply the lowercase alphabet with a space. If you lower the alphabet, the runtime would shrink tremendously because it has less choices to go through. However, because it's a computer program, there are certain factors that could be 'biased' (the random number generator used, the words/alphabet, the program itself, the computer hardware...)

Anyway the shit is still going.

Word probability Posted March 7th, 2012 in General

You've all heard the famous 'monkeys with typewriter' thought experiment where it is discussed whether or not a certain amount of monkeys bashing away at typewriters for all of time could recreate Hamlet. But it becomes more practical when talking about programs that generate random documents. I wrote a simple program that doesn't take any complex math or mechanics into account for fun.

So far, my program takes 1 second to get 'ash' right, and 22 seconds to get 'ashl' right (I want to spell ashlee.) However, for ashle, it's STILL running. I'm wondering how long it would take for the program to randomly generate someone's username?

Response to: Running Javascript on a server? Posted March 5th, 2012 in Programming

Lol never heard of AJAX? Most frameworks will have wrappers around AJAX making it very easy for you. And then integrating it with PHP or whatever is seamless.

Response to: Javascript: Firefox focus(); Posted March 3rd, 2012 in Programming

Obviously if you don't know what nothing does, chances are it was bugging up the code.

Response to: Javascript: Firefox focus(); Posted March 3rd, 2012 in Programming

Firefox allows you to configure what certain scripts can do (such as focusing.) That means it's firefox's setting.

Response to: anime your re-watch Posted February 26th, 2012 in General

Elfen Lied, Axis Powers Heltalia...Golden Boy...

Response to: Pi runner game help/idea Posted February 26th, 2012 in Game Development

Im confused? You said my idea is dumb and now want to collab with me? I dont know if you are being sarcastic or changed your mind. Either way thats a pretty cool polar graph. Is that representing digits of PI or the value of PI? Also I wont be able to run with this idea yet because Im finishing up my lastest game still.

See you don't really understand the concept, do you?

A graph plots all the points..correct? Well the formula used for the above graph is Math.cos(Math.PI * currentAngle). That's it, nothing complex. Basically every increment of the angle gets multiplied by pi. It would really look like:

R = Cos(PI * t)
X = r * Cos(t)
Y = r * Sin(t)

The reason why is because it's in polar form, not in rectangular form. in Rectangular form, there would be no R.

Response to: Pi runner game help/idea Posted February 24th, 2012 in Game Development

At 2 hours ago, swishcheese wrote:

If you let me become your collaborator, I'd be a happy man.

Pi runner game help/idea

Response to: Polar graphs in XNA Posted February 24th, 2012 in Programming

I just did it on a web page.

document.observe("dom:loaded", function() {
    for (var i = 0; i < 360; i += 0.01)
    {
        var t = i;
        var radius = 800;
        var baseOffset = 800;
        
        //var x = 16 * Math.pow(Math.sin(t), 3);
        //var y = 13 * Math.cos(t) - 5 * Math.cos(2 * t) - 2 * Math.cos(3 * t) - Math.cos(4 * t);
        
        var r = Math.cos(Math.PI * t);
        var x = r * Math.cos(t);
        var y = r * Math.sin(t);
        
        var s = new Element('span').update("3.14");
        s.setStyle({ top: baseOffset + x * radius  + "px",
        left: baseOffset + y * radius + "px"});
        $("content").insert(s);
    }
});

Polar graphs in XNA

Response to: Pi runner game help/idea Posted February 24th, 2012 in Game Development

Generating PI in runtime? Sounds completely dumb to me. For one, there are many facilities that already have a notion of PI without the need of the developer to generate it himself. What's it called..something like, oh I don't know, Math.PI?

I wrote a program that graphs different types of polar graphs, notably one that multiplies PI by the argument. But I didn't have to write out the digits of PI or calculate it. What you need to do is something similar. Modify PI so that your game will take advantage of the digits instead of manually calculating it like a dumbass.

An example would be dividing it, or using math to get different decimal places of PI (you can even just try rounding it...)

Even then, there's only 9 digits. So I don't get what's so interesting about PI, unless you're talking about a graph anyway (and the graph repeats itself.)

So really, your idea sounds dumb as hell.

Response to: Polar graphs in XNA Posted February 19th, 2012 in Programming

Here's another one.

Polar graphs in XNA

Response to: Polar graphs in XNA Posted February 19th, 2012 in Programming

At 9 hours ago, NinoGrounds wrote:
At 8 minutes ago, polym wrote: If anyone would like to see or know more, just ask!
Why not

Got a specific question?

Polar graphs in XNA Posted February 19th, 2012 in Programming

Hey guys, I've managed to do something really cool.

You know polar graphs, where you have an equation of the form r = some function (ie, r = sin(theta))? And how XNA uses cartesian coordinates? I spent a good chunk of my weekend trying to find out how to graph a rose curve, because the equations given are not so obvious to use. Then I found a small snippet of code that made me realize how easy it was. All I had to do was put the function in a variable R, and multiply it by the X and Y components (cos and sin) to get my graph.

For example, a rose curve is simply:
r = Cos(a * t)
x = r * Cos(t)
y = r * Sin(t)

This has enabled me to insert some complex equations to graph really awesome shit.

Here's a snippet of the code:

for (float i = 0; i < n; i++)
                {
                    radius = (n - i) * 1000;


                    for (double j = 0.0; j < 360.0; j += 0.001)
                    {
                        float r;
                        float x;
                        float y;

                        /*r = 1f * (
                             (float)Math.Pow(Math.E, Math.Cos(j)) 
                             - 2 * (float)Math.Cos(4.0 * j) 
                             + ((float)Math.Pow(Math.Sin(j / 12.0), 5))
                             );*/

                        r = (float)(Math.Cos(Math.PI * j));
                        x = r * (float)Math.Cos(j);
                        y = r * (float)Math.Sin(j);

                        //x = (8 + 5) * (float)Math.Cos(j) - 5 * (float)Math.Cos((8.0 / 5.0 + 1.0) * j);
                        //y = (8 + 5) * (float)Math.Sin(j) - 5 * (float)Math.Sin((8.0 / 5.0 + 1.0) * j);

                        //x = 11 * (float)Math.Cos(j) - 6 * (float)Math.Cos(11.0 / 6.0 * j);
                        //y = 11 * (float)Math.Sin(j) - 6 * (float)Math.Sin(11.0 / 6.0 * j);

                        //x = 16 * (float)Math.Pow(Math.Sin(j), 3.0);
                        //y = 13 * (float)Math.Cos(j) - 5 * (float)Math.Cos(2.0 * j) - 2 * (float)Math.Cos(3.0 * j) - (float)Math.Cos(4.0 * j);

                        if ((basePos + new Vector2(x, y) * radius).X > 0
                           && (basePos + new Vector2(x, y) * radius).X < GraphicsDevice.Viewport.Width
                           && (basePos + new Vector2(x, y) * radius).Y > 0
                           && (basePos + new Vector2(x, y) * radius).Y < GraphicsDevice.Viewport.Height)
                        {
                            pixels.Add(new Pixel(basePos + new Vector2(x, y) * radius));
                        }
                    }
                }

If anyone would like to see or know more, just ask!

Polar graphs in XNA

Response to: C - Pointer to an Array of Structs Posted February 13th, 2012 in Programming

Remove the astericks.

Response to: C++ Graphics Framework Posted February 13th, 2012 in Programming

At 4 days ago, incertia wrote:

I'm a C# and XNA programmer. That means I have experience in directX, but not much in directX with C++. Although I have done C++ programming for quite a long time. I dabbled in the windows API but I dropped it because I always thought that it was a waste of time doing everything manually. In fact the only 'game' I've ever made with C++ was in SDL and OpenGL. I've attempted to do a directX game in C++, but as per usual, I just stuck to XNA since most of the technical code is hidden from you.

Response to: Butts. Posted January 27th, 2012 in General

At 1/27/12 09:16 PM, RydiaLockheart wrote: I went to school with a girl unfortunate enough to have the last name Butts. I imagine she wanted to get married and change her name.

Clever move on the parents part. Also, convenient for any 20 year old college guy who likes knocking up high school girls.

Response to: Robotic Warfare Posted January 18th, 2012 in General

I love you Emma.

Response to: NetHeroes Posted January 10th, 2012 in Programming

Why do people always jump into multiplayer right away? It's the hardest thing you can do (because of how sloppy and hard to test it is) and if you don't already have a good game going, networking won't be easy to integrate.

Response to: My Sister's Boyfriend might be a- Posted January 7th, 2012 in General

At 1/7/12 03:33 AM, yurgenburgen wrote:
At 1/7/12 03:28 AM, HollowedPumkinz wrote:
also, not like I need to justify myself but, I refrain from calling him out once more because of my sister.
>can't think of excuse not to call sister's boyfriend out
>blame sister

What evidence does he have, amirite?

Response to: Most badass picture of you Posted January 5th, 2012 in General

ME!!!!!!!! 53535353

Most badass picture of you

Response to: No winter in California? Posted January 5th, 2012 in General

The only thing hot are girls on NG

Response to: insertfunnyuserna me = sexy chick Posted January 5th, 2012 in General

Katie > all

insertfunnyuserna me = sexy chick Posted January 5th, 2012 in General

Discuss.

Response to: I need friends Posted December 19th, 2011 in General

The females only post in threads that further their own social standing on newgrounds. You never see them one-off threads. Go figure.

Response to: I need friends Posted December 18th, 2011 in General

The word 'troll' and 'fail' are both what I call 'metafails'. Just using them is a fail.

Response to: I need friends Posted December 18th, 2011 in General

People who made serious answers = naive hippocrates.

I need friends Posted December 17th, 2011 in General

Any female NG'er want to be my friend?

Response to: Programming for beginners Posted December 14th, 2011 in Programming

At 12/14/11 08:36 PM, ZiggyZack99 wrote:

I think the irony is that attributing Python as a 'beginner's' language is by people who already have programming experience. Pascal is a 'beginner's' language used in many low level comp. sci. classes and then they jump straight to C++. You have your hipsters in college who learn Java, but many hobbyists who have done it for years will just do about every popular language there is. That's the nature of curiosity.

I think that if the attitude is to teach python first because it's a beginner's language, they will learn nothing. All the caveats and gotchas that are involved in programming (which is a lot more than just learning syntax) will not become clear. In C++, it will become clear as they struggle with the language. In Python, you are programming with a fixed mindset because many of the practical functions and libraries require a more strict mindset that is hard to enforce on a beginner programmer. On the other hand, in C++, a beginner can know to include a certain header file that does what he wants to do.

Response to: Help with a .htaccess mod_rewrite! Posted December 6th, 2011 in Programming

Why don't you set the directory root to /uploads? Or redirect it using a php script? And then the .htacess could be done from the root