» Goto page Previous  1, 2, 3  Next
Elements in list code for different textures, etc, and when the program encounters an instance of X in the list it draws said texture.
Darn, I wish had seen this topic earlier. Very impressive, kirb!
jpez wrote:
Darn, I wish had seen this topic earlier. Very impressive, kirb!
Pretty 1337, no? Do you agree these should go in the guide?
I do. We should post an updated 2006 edition.
Definitely. I have a whole bunch of stuff I want to add.
...Like a section for real Noobs on what not to include (in games, descriptions, etc.).
Definitely, that would be a perfect addition.
A small routine that returns how many times k is in L:

sum(k=L

Simple, eh?
Huh, and that works? Awesome! I'll have to add that to the list of 1337 trix.
We were talking about something similiar to this at TIFW. If you want to see if a number is in a list, you can simply do max(K=L . You can also do max(K={24,25,26,34} and A=/={0,0,96,64 to check for multiple conditionals (ie If the user pressed left and A does not equal the left bounds of its movement).
Ooooh, this could be excellent for saving space. What it wouldn't be good for is speeding up the program; lists are notoriously slow to process.
Kerm, I use this to detect if the arrow keys are pressed, and barely notice any lag. Since I do the more complex A-(K=etc stuff, I use:

If max(K={24,25,26,34:CODE TO CLEAR CHARACTER

Maybe you should take a closer look at the 1337 section on my forums...
Perhaps I should do so; if you've got more stuff like this there, it could be quite the valuable resource. Come to think of it, I believe SC2 does that optimization...
you should, we have quite a few interesting discussions on there, using Max, gragh databases, and well, just a bunch of other odd things not many people know about.
Yep. There are also many skilled programmers over there so you get some nice discussions and great optimizations when a new routine is presented. I used to use sum( but found out at TIFW that max( is faster. If you check the code to the Mario platformer I made, it uses max( frequently as a short way of saying If A=1 and B=1 or A=2 and B=2 etc.
Indeed. Maybe I could steal some of them and bring them over here.
Uh, let's not and say we did, k?
tifreak8x wrote:
Uh, let's not and say we did, k?
Or we could do so and say we didn't, or even do so and say we did! Heh, I won't take you over for now.... or will I?!? 0x5.
0wn3d!
I see your IP... BWAHAHAHAHAHA You shall be... TERMINATED!!

» Goto page Previous  1, 2, 3  Next
» All times are UTC - 5 Hours

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum