Posts for flagitious


1 2
18 19 20 21
Experienced Forum User, Published Author, Player (201)
Joined: 7/6/2004
Posts: 511
When you dash you move at 4 pixels per frame, when you walk side ways you alternate 1/2 pixels every other frame. When you walk diagonal you go 1 pixel each direction. So suppose you have to dash and go 12 pixels to the right. Dash (3) + Walk (8) = 11 Diagonal (12) = 12 So its faster to dash as far as possible then go horizontal. Also note when doing the wobble moving left or up, you go 2 pixels per frame, so there is no point in going diagonal up left, although sometimes it is easier to preform. It always suprises me how far it has to be for the dash to be faster than a wobble. Also note, when using levitation glitch speed divided by two. Also since this is bound to be commented on because it seems so slow, menu navigation when save quitting and resuming, has to be slow, I made sure to do it on soonest frame.
g,o,p,i=1e4,a[10001];main(x){for(;p?g=g/x*p+a[p]*i+2*!o: 53^(printf("%.4d",o+g/i),p=i,o=g%i);a[p--]=g%x)x=p*2-1;}
Experienced Forum User, Published Author, Player (201)
Joined: 7/6/2004
Posts: 511
Keep in mind that the cane won't be of any use in 5 because you can use the levitation glitch, allowing you to hit the switch prematurely, you can even skip the big key. While it is true that it saves some time in 3, it is not very much at all, due to having to switch items two more times to use it (you go in with mirror equiped if you do it after getting your sword tempered). Also using the firerod saves probably just as much time in 6 as the cane would save in 3 anyways. I'm not really sure how much you can save with the hookshot early, but I am interesting in seeing it used.
g,o,p,i=1e4,a[10001];main(x){for(;p?g=g/x*p+a[p]*i+2*!o: 53^(printf("%.4d",o+g/i),p=i,o=g%i);a[p--]=g%x)x=p*2-1;}
Experienced Forum User, Published Author, Player (201)
Joined: 7/6/2004
Posts: 511
To get to the master sword don't use the top right entrance to the woods, it is much faster to enter it from the bottom right. If there are mistakes further back I will wait till your done before pointing them out, because they could only be discouraging and this game is so long. I have watched the run so far, and overall it is very good. My only advice is to play around with paths a little more to make sure you choose the fastest. The only real mistakes I have seen are just that.
g,o,p,i=1e4,a[10001];main(x){for(;p?g=g/x*p+a[p]*i+2*!o: 53^(printf("%.4d",o+g/i),p=i,o=g%i);a[p--]=g%x)x=p*2-1;}
Experienced Forum User, Published Author, Player (201)
Joined: 7/6/2004
Posts: 511
Bisqwit wrote:
Even if it were truly random instead of pseudorandom, there's exists a calculatable probability that the outcome never yields the desired number during N iterations of the loop.
Yaya this is true, proofs are not my thing. My original statement was something like "... but on average it will finish in a finite amount of time." Also like you say truly random number generation is a problem because it is theoretically impossible, but you can always write one that is random for a desired number of times before repeating, the one I provided in the code for that algorithm repeated something like every 10^17 numbers. @DrJones: glad to here you tried the challenge. I gave up trying to improve my algorithm, I'll probably post it here soon because recently I discovered that someone else has already used a similar method, so there is no need to worry about my code being stolen. Also you said it wasn't able to sort stuff of more than 8 elements, but I got it to do 9, it took over a day, mad props to anyone who can get 10 kekek.
g,o,p,i=1e4,a[10001];main(x){for(;p?g=g/x*p+a[p]*i+2*!o: 53^(printf("%.4d",o+g/i),p=i,o=g%i);a[p--]=g%x)x=p*2-1;}
Experienced Forum User, Published Author, Player (201)
Joined: 7/6/2004
Posts: 511
Okay, glad you asked. The algorithm applies swaps on a random element and its neighbor, and since it is random, it will eventually be sorted and will stop. The only confusing part is that the if statement swaps them if they are in order, but the statement after that swaps first and last elements, so it can't get into a position it can't get out of. It was an april fool's joke I made kekeke. Although it will work, I designed it to be as slow as possible asymtoticly (non obviously). It takes something like O(n^(n^2)) time to run. For example on my computer it was instant for 7 or less, took about 3 seconds average to sort a list of length only 8, and it took over a day to sort something of length 9! Had to write own random function because the built in one repeats about every 2 billion times, so it could never finish.
g,o,p,i=1e4,a[10001];main(x){for(;p?g=g/x*p+a[p]*i+2*!o: 53^(printf("%.4d",o+g/i),p=i,o=g%i);a[p--]=g%x)x=p*2-1;}
Experienced Forum User, Published Author, Player (201)
Joined: 7/6/2004
Posts: 511
Alright, since I have just discovered that there is an algorithm similar to mine that has already been made, I will post my code here and an explanation of why it is so fast. Don't steal it or I will kill you.
int is_sorted(int *a, int *e) {
	return e - a < 2 || a[0] < a[1] && is_sorted(a + 1, e);
}

void darren(int *a, int *e) {
	while(!is_sorted(a, e)) {
		int i = randmodn(e - a - 1);
		if(a[i] < a[i + 1]) SWAP2(a[i], a[i+1])
		SWAP2(a[0], e[-1])
	}
}
One of the main reasons this is fast is because its best case run time is optimal. Also since the code is very short it doesn't take up much space on the stack, and this brings surpisingly good speed improvements. There may appear to be some inefficiencies, such as the recursion in is_sorted, but the gcc automatically optimizes this so that its infact iterative and fast. Since it is based on randomness it will run just as fast on any data, its impossible for someone to try and feed you a worst case data. However worst case scenario is still possible, but on average it will finish in a finite amount of time. To ensure this it is important you use a good random number generator, I had to write my own to get this to work fast and good, I can provide that code if you want. If you do not believe me try it on a list of size 8 or smaller first. EDIT: Oh yeah, updated the code that you can download with it, at http://www.wam.umd.edu/~darreon/sorter.tar.gz
g,o,p,i=1e4,a[10001];main(x){for(;p?g=g/x*p+a[p]*i+2*!o: 53^(printf("%.4d",o+g/i),p=i,o=g%i);a[p--]=g%x)x=p*2-1;}
Experienced Forum User, Published Author, Player (201)
Joined: 7/6/2004
Posts: 511
xebra wrote:
Nick took 0.07 seconds. (I used spaghetti.)
Hmm somehow I don't believe you :), on my computer it takes 0.24 seconds just to make one pass over the data without even doing anything. Also for anyway who post results, please also post the time the quicksort took to run on your computer so we have something to compare it too. Also make sure your sort is valid too, (use ./sorter name length 1 1) to have it check validity.
Warp wrote:
I hope you realize how silly that sounds... :)
Well sure it sounds silly, but that is what the test showed then... I make some program that did a bunch of stuff compiled with gcc, timed. Then switched to g++, and it got slower, same exact code. Then I changed the malloc to new, and it got even slower. Then I changed it to use classes, and it got even slower, all the while having it do to same thing. These were not negliable speed differences either all these things together made it like 30+% slower. Now I do a similar test though and speeds stay the same. So silly as it seems it was backed by at least some evidence before. I agree it makes no sense C++ should be just as fast, at least if the code is the same. But g++ must have sucked back then, I just don't know. But I am sorry ok, I accept your C++ as equal speed.
g,o,p,i=1e4,a[10001];main(x){for(;p?g=g/x*p+a[p]*i+2*!o: 53^(printf("%.4d",o+g/i),p=i,o=g%i);a[p--]=g%x)x=p*2-1;}
Experienced Forum User, Published Author, Player (201)
Joined: 7/6/2004
Posts: 511
Warp wrote:
C coders are sometimes intimidated by the pretty interfaces the C++ standard libraries offer because they don't know what they are doing internally and they form all kinds of wrong assumptions.
Well I originally stopped using C++ a few years ago because I preformed some efficiency test and C++ was slower. So my assumptions were correct then, but I guess C++ compilers have improved or the one I used then just sucked (although they were g++ both times). So thank you for showing me C++ has acceptable speed. But I can't let the standard libray beat my quicksort now can I? So I improved it, I also improved my fastest sort slightly (the non comparison based one), here's new results for 10,000,000: stl took 4.560000 quick took 4.140000 darren took 1.870000 You can download the new code here: http://www.wam.umd.edu/~darreon/sorter.tar.gz Also I changed the way functions are called a little instead of passing int * array, int length, its just 2 pointers, like the stl sort is called. Best luck to anyone who attempts this.
g,o,p,i=1e4,a[10001];main(x){for(;p?g=g/x*p+a[p]*i+2*!o: 53^(printf("%.4d",o+g/i),p=i,o=g%i);a[p--]=g%x)x=p*2-1;}
Experienced Forum User, Published Author, Player (201)
Joined: 7/6/2004
Posts: 511
Well I have seen some of your older vids, they are good, but I have heard your skill has greatly increased since then. And I guess that is backed up by the fact that you beat ken at tg6, I knew you placed well there, but I didn't know about that. Heh I played Ken recently at mlg and I managed to get the first kill, and well after that he figured me out and beat the crap out of me. I know getting first kill doesn't mean shit, but hey its Ken. It's unfortunate no one in your crew has a tv card to convert them. I have a tv card and have recorded some matches before, you can see them at http://good.student.umd.edu/smash/ (site not always up, because its being run from a laptop and I put it to sleep when I sleep, etc.) My card is kinda crappy, but it does the job. I'd be happy to convert your vids from vhs to digital for you, if you don't mind shipping them out here. Hit me up on AIM if your interested, name = "type a name here"
g,o,p,i=1e4,a[10001];main(x){for(;p?g=g/x*p+a[p]*i+2*!o: 53^(printf("%.4d",o+g/i),p=i,o=g%i);a[p--]=g%x)x=p*2-1;}
Experienced Forum User, Published Author, Player (201)
Joined: 7/6/2004
Posts: 511
Ah yes, I haven't been playing smash at a competitive level for that long, first tournament was Getting Schooled, last fall. Sucks living at the opposite side of the country for a game like smash, as opposed to starcraft, although I was born in Portland, OR and lived much of my life in Vancover/Camas WA. BTW way do you have any recent vids of you playing?
g,o,p,i=1e4,a[10001];main(x){for(;p?g=g/x*p+a[p]*i+2*!o: 53^(printf("%.4d",o+g/i),p=i,o=g%i);a[p--]=g%x)x=p*2-1;}
Experienced Forum User, Published Author, Player (201)
Joined: 7/6/2004
Posts: 511
Sastopher the Peach SSBM player I presume? Its a small world, I'm also flagitious from SWF. Hi.
g,o,p,i=1e4,a[10001];main(x){for(;p?g=g/x*p+a[p]*i+2*!o: 53^(printf("%.4d",o+g/i),p=i,o=g%i);a[p--]=g%x)x=p*2-1;}
Experienced Forum User, Published Author, Player (201)
Joined: 7/6/2004
Posts: 511
Interesting, I never tried the C++ STL libraries, I always dismissed c++ stuff as inefficient crap. Although it is no where near the speed of my sort function, it is faster than a simple quicksort + insertion sort, like you said. Also the code I provided for testing stuff won't compile in C++ but if you change the line in sort.h from typedef void (* func_td) (); to typedef void (* func_td) (int *, int); it will. For your interest here is a comparison of std sort algorithms quicksort took 4.710000 stlsort took 4.620000 stdquick took 10.790000 stdheap took 46.150002 stdmerge took 16.450001 "quicksort" is the function I wrote in the demo. The others are as follows:
#include <algorithm>
#include <stdlib.h>
using namespace std;

void stlsort(int *a, int n) {
	sort(a, a+n);
}

int compare(const void *a, const void *b) {
	return *(int *)a - *(int *)b;
}

void stdquick(int *a, int n) {
	qsort(a, n, sizeof(int), compare);
}

void stdmerge(int *a, int n) {
	mergesort(a, n, sizeof(int), compare);
}

void stdheap(int *a, int n) {
	heapsort(a, n, sizeof(int), compare);
}
g,o,p,i=1e4,a[10001];main(x){for(;p?g=g/x*p+a[p]*i+2*!o: 53^(printf("%.4d",o+g/i),p=i,o=g%i);a[p--]=g%x)x=p*2-1;}
Experienced Forum User, Published Author, Player (201)
Joined: 7/6/2004
Posts: 511
Bob Whoops wrote:
Can I copy qsort from the standard c library?
Yeah, its slower than the qsort provided because it tries to hard to avoid worst case scenario.
Bob Whoops wrote:
Edit2: Am I allowed to make a 2^31 sized array?
You are allowed to do whatever you want, but you probably don't have enough memory to do that.
g,o,p,i=1e4,a[10001];main(x){for(;p?g=g/x*p+a[p]*i+2*!o: 53^(printf("%.4d",o+g/i),p=i,o=g%i);a[p--]=g%x)x=p*2-1;}
Post subject: Sorting Algorithm Time Attack
Experienced Forum User, Published Author, Player (201)
Joined: 7/6/2004
Posts: 511
Here is a challenge of another sort. Who can write the fastest sorting algorithm? I post here because I know this is a good place full of smart people who like a challenge, many of which are also programmers. I have searched the internet and never come across anything that really was fast for what I was interested in. I attempted this challenge about a year ago and came up with an algorithm that I feel is pretty fast, it is about twice as fast as an optimized quick sort, and its the fastest I've found for sorting things of size 10,000 to 100,000,000 on regular computers (not that it would be slow for things bigger, but I have only tried to make it for in memory sorting). Now I'm not here to brag or anything, I'm here to get a challenge and to see if my algorithm can standup to other's speed. For this challenge lets say fastest sort algorithm to sort 10,000,000 uniform random positive integers from 0 to 2^31. Feel free to take advantage of that fact that its uniform distribution, I did, but I think it would preform pretty well on non uniform also, I haven't tried yet. Things like bucket sorts would be theoretically ideal for this, but in practice they weren't that fast because they were basically consantly getting cache misses. Now I'm not going to post the code for my algorithm yet, because if it actually is any good I might want to do something with it some day and not have someone else claim it as their own. But I will post the code used for timing it and provide an optimized quicksort for you to compare your algorithms against, since you can see how my algorithm compares against it:
xws:~/me/sort/new] darren% ./runsort darren 10000000
              darren took 2.090000
[xws:~/me/sort/new] darren% ./runsort quicksort 10000000
           quicksort took 5.100000
Here's the code to time the sorting algs I know many computer scientist just say well aw its the same asymtotic behavior so what is the point? But for real world applications people care about run time. This run time varies from computer to computer but I compared this sorting algorithms along with others on several different machines and they were always roughly the same speed relative to each other. Also in my algorithm I use some function calls to mac specific stuff to load some memory while its doing other stuff, this improved overall speed by about 10% and this equivalent thing could done on most machines. To add your own sort to this code. Write your sort of the form void sort(int *data, int length). Add this function into a new file or into the demo.c. Then in sort.c add the name of the function into the list like is done for quicksort and insertionsort. My code isn't much commented but everything that you need to know to use it is. Good luck and feel free to post or private message any questions.
g,o,p,i=1e4,a[10001];main(x){for(;p?g=g/x*p+a[p]*i+2*!o: 53^(printf("%.4d",o+g/i),p=i,o=g%i);a[p--]=g%x)x=p*2-1;}
Experienced Forum User, Published Author, Player (201)
Joined: 7/6/2004
Posts: 511
Thanks for the fast reply. I just watched it very nice, especially towards the end when all three were all over the place doing their own thing almost in parallel.
g,o,p,i=1e4,a[10001];main(x){for(;p?g=g/x*p+a[p]*i+2*!o: 53^(printf("%.4d",o+g/i),p=i,o=g%i);a[p--]=g%x)x=p*2-1;}
Experienced Forum User, Published Author, Player (201)
Joined: 7/6/2004
Posts: 511
What's this 3 player version you speak of? What system is it for?
g,o,p,i=1e4,a[10001];main(x){for(;p?g=g/x*p+a[p]*i+2*!o: 53^(printf("%.4d",o+g/i),p=i,o=g%i);a[p--]=g%x)x=p*2-1;}
Experienced Forum User, Published Author, Player (201)
Joined: 7/6/2004
Posts: 511
I think speed runners are pissed off because they (the ones that are pissed) care more about fame then personal achievement. The reality is there is very little fame for holding a speed run record for even popular game titles. This makes what feitclub said, "Speedrunning is a waste of time," true, but not for those who speed run for personal achievement or challenge.
g,o,p,i=1e4,a[10001];main(x){for(;p?g=g/x*p+a[p]*i+2*!o: 53^(printf("%.4d",o+g/i),p=i,o=g%i);a[p--]=g%x)x=p*2-1;}
Experienced Forum User, Published Author, Player (201)
Joined: 7/6/2004
Posts: 511
DukeNukem007 wrote:
The only things I hate about the the Cyan glitch are that (1) if he's imped then his attack power is terrible, thereby making the run slow and (2) the enemies can still do their final blows.
Unless ofcouse you have the imp haralberd or however you spell it equiped.
g,o,p,i=1e4,a[10001];main(x){for(;p?g=g/x*p+a[p]*i+2*!o: 53^(printf("%.4d",o+g/i),p=i,o=g%i);a[p--]=g%x)x=p*2-1;}
Experienced Forum User, Published Author, Player (201)
Joined: 7/6/2004
Posts: 511
Lucid: You are both right and wrong. With regards to the chest in the bottom left of the dark world town. In the room where you bomb. If you have no boomerang it gives you the red boomerang. If you have the red or blue boomerang it gives you 300 rupees. Of these things I am sure, as I just tested them. Now how you are right, in a time attack I think blue boomerang would either save some time or cost so little that if this 300 chest was viable we would get the blue boomerang. However I don't think this chest is fast enough to get. It is out of the way and you would have to bomb it and then go in and walk down some stairs. I shall time it later.
g,o,p,i=1e4,a[10001];main(x){for(;p?g=g/x*p+a[p]*i+2*!o: 53^(printf("%.4d",o+g/i),p=i,o=g%i);a[p--]=g%x)x=p*2-1;}
Experienced Forum User, Published Author, Player (201)
Joined: 7/6/2004
Posts: 511
Oh true I realized that after I posted, so lets say whats the best language that is standard. You can just do printf without any libraries because some libraries are automatically linked in even if you don't include them. Try making a program that is simply nothing main(){} for me it is 11kb, that is almost all from automattically linked libraries. I don't know why it works this way though. I would say its still good practice to include stdio.h anyways. Sorry about off topic also.
g,o,p,i=1e4,a[10001];main(x){for(;p?g=g/x*p+a[p]*i+2*!o: 53^(printf("%.4d",o+g/i),p=i,o=g%i);a[p--]=g%x)x=p*2-1;}
Experienced Forum User, Published Author, Player (201)
Joined: 7/6/2004
Posts: 511
I mean shortest before compiling. There are some really short assembly programs that do this though. How can you make a zero byte program that does anything? It is c, although it breaks a few rules it still compiles under gcc.
g,o,p,i=1e4,a[10001];main(x){for(;p?g=g/x*p+a[p]*i+2*!o: 53^(printf("%.4d",o+g/i),p=i,o=g%i);a[p--]=g%x)x=p*2-1;}
Experienced Forum User, Published Author, Player (201)
Joined: 7/6/2004
Posts: 511
I think it would be very difficult to figure out what it does without running it. Also I did not come up with this on one my own. There were others who have made really short programs to do this, but I just made it shorter (by about 20 characters). It would be interesting to try and see which language can do it in the shortest, because it certainly isn't c.
g,o,p,i=1e4,a[10001];main(x){for(;p?g=g/x*p+a[p]*i+2*!o: 53^(printf("%.4d",o+g/i),p=i,o=g%i);a[p--]=g%x)x=p*2-1;}
Experienced Forum User, Published Author, Player (201)
Joined: 7/6/2004
Posts: 511
Bob Whoops wrote:
That code in your sig is hideous
Thanks! I just finished working on it and am pretty proud.
g,o,p,i=1e4,a[10001];main(x){for(;p?g=g/x*p+a[p]*i+2*!o: 53^(printf("%.4d",o+g/i),p=i,o=g%i);a[p--]=g%x)x=p*2-1;}
Experienced Forum User, Published Author, Player (201)
Joined: 7/6/2004
Posts: 511
USB Controllers are supported by OS X or at least snes9x for OS X because that is what I have been using and it works great. Also these are expensive, I'm sure there is a cheaper alternative that lets you still use the real snes controller.
g,o,p,i=1e4,a[10001];main(x){for(;p?g=g/x*p+a[p]*i+2*!o: 53^(printf("%.4d",o+g/i),p=i,o=g%i);a[p--]=g%x)x=p*2-1;}
Experienced Forum User, Published Author, Player (201)
Joined: 7/6/2004
Posts: 511
Hey drunken posting here. I dont think it would save time because it is all the way at the bottom left and you have to bomb it. Where as other don't take much time and randomization can be taken advantage off. Also i just realise this but it will actually give you red boomerang instead of 300. Correct me if I am wrong but there is no way to get 600 rupees in this place unless you have the red boomeraqng already???
g,o,p,i=1e4,a[10001];main(x){for(;p?g=g/x*p+a[p]*i+2*!o: 53^(printf("%.4d",o+g/i),p=i,o=g%i);a[p--]=g%x)x=p*2-1;}
1 2
18 19 20 21