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.


Messages - Halifax

Pages: 1 ... 27 28 [29] 30 31 ... 90
421
Computer Projects and Ideas / Some sprite tests
« on: June 25, 2007, 05:25:00 pm »
I agree those seem very intricate and detailed. Same with those brick columns into the entrance. Where did you get these 1337 spriting skills necro. I want them.

422
Computer Projects and Ideas / Some sprite tests
« on: June 25, 2007, 01:55:00 pm »
Hmmm the attempted 3D effect does look a little akward. Maybe you should choose a different sprite for the tops of the wall instead of just a darker brick sprite. Maybe just solid black or something else because I think Super_Speler is right.

423
Computer Projects and Ideas / Some sprite tests
« on: June 25, 2007, 12:22:00 pm »
Yeah I agree with JincS and Liazon. With Liazon because that is great color coordination and with JincS because yes details will make this stand out and look much better although it looks pretty good as of now.

424
Pokémon Purple / [PP] Progress, Starting in '07
« on: June 23, 2007, 05:18:00 pm »

 THE POST 13245626
D*** tifreak that looks really fast and I am viewing this in IE7(which I have heard slows down GIFs). Oh well keep up the good work.

Any speculation on when this will be done because you are killing me with all these updates.  


425
News / Super Mario 68K
« on: June 23, 2007, 04:54:00 pm »
I felt as if this deserved to be in the news section. If someone feels different about it, then go ahead and move it back, but I think that Lachprog worked really hard on this and it turned out to be the greatest Super Mario game to this date.

426
Computer Programming / Searching Operator Precedence in C
« on: June 23, 2007, 03:41:00 am »
If I get code written down I will post it later. Anyways here are notes on parse trees that I wrote.

===== Parse tree Notes =====

Background:

   Basically with parse trees to setup the data you go through the equation one time and you tokenize it. After tokenizing it you are going to put it in the parse tree.

Note: I do parse tree in tree minor fashion instead of tree major. That is just saying basically that I am looking for the lowest element not the highest(you will see).

Ok now let's start off with a simple table of precedence.

+, - == 0
*, / == 1

So that is our simple table of precedence made for tokenizing. Now let's start with a simple expression.

5+4*5

Now let's tokenize this. In token form.

5+4*5 = 5(0)4(1)5 or simply 0,1. That was easy. Now based off of the table of precedence you should be able to figure out why that is so ;)wink.gif.

So now how do we get that stuff into a parse tree. The logical thing and what people are taught in life is to start with multiplication in an expression like that, but in a parse tree you find the lowest element.

So in our token list 0,1 is the lowest so we put that at the top of our tree. Then we look to the left to find what argument it takes. There is a number there and no other math operators to the left of it. Now to the right of it there is a number also, but there is an operator to that side because we haven't reached the end of our token list. So since there is an operator we search for the lowest token in the rest of the list which is 1 of course. So this would start us off with


  +
 / \
5   *

Now what are the two operands to * or 1. Well look to the left. There is a number and no other math operators that we haven't touched so use the number. Now look to the right and there is a number and no math operators so then we settle for the numbers. This gives us a parse tree of.

  +
 / \
5   *
   / \
  4   5

Great we have a parse tree but how do I solve it??? You solve by levels. Start at the lowest level and farthest to the left and start solving. So then it would be like this.

  +
 / \
5   *
   / \
  4   5  becomes ...

  +
 / \
5  20

ok now there are no more expression to solve on the last level we did so move a level up and solve that.

  +
 / \
5  20  becomes...

  25

so the answer to 5+4*5 = 25




Alright now it is time to get into a little bit of history I think? Either way look at this tree again.

  +
 / \
5   *
   / \
  4   5

Now let's imagine a real tree and break it down into two parts. There are branches and then leaves that come off of the branches. Now the leaves are always on the outside never the inside. Now applying that to parse trees the + and * are the branch nodes because they are not on the very tip of the outside. The 5,4, and 5 are the leaf nodes because they are on the very outside.

Ok so do you notice anything? The numbers always HAVE to be in the leaf nodes and operators always HAVE to be in the branch nodes. There are no exceptions.


Now let's get into some more complicated parse trees.


(5+4)*5

uhhhh wtf that f**** up our whole tokenize thing. We are going to tokenize that the same way and then solve it wrong. D***.

But wait! There is such a thing called weighting your expression. Now let's look at this expression as we would normally tokenize it.

ToP:
+,- = 0
*,/ = 1

(5+4)*5 would be 0,1 in token form. But wait isn't that plus inside parentheses. Well exactly how many is it inside? The + is inside 1 of them. So that means we weight the expression by 1. That would give us a token list of

1,1

Now look at this expression.

((5+4))*5

the + is inside 2 of them now so we weight it by 2 which would give us

2,1 for our token list. So you should understand by now that weighting will only add the number of OPEN parentheses to the operators.

So then what is this expression.

(((5+4))*5)

Tokenized it would be: 3,2

There are 3 open when we encounter the + and only 1 open when we encounter the *. Alright after going off into that spew let's get back to the first one.

(5+4)*5

Now the token list 1,1 means we have two of the same expressions does it not? Yes technically it does but that is why I mentioned before we are doing this tree minor which means we search for the lowest token in the list that is also the farthest to the right of it. That means we would take the 1 token on the right which is the *

Now let's solve this parse tree. Look to the left and you see that * is not operating on a number but a ) so take the next lowest token in the list to the left which is 1(+). Then we look to the right of the * and find a number 5 with no expressions to the right so we use the number. Now moving on to the + we look to the left and find a number and no more expressions to the left, then we look to the right and find a number with no more expressions that we HAVE NOT used already. So that would give us a tree setup of.

      *
     / \
    +   5
   / \
  5   4

now solve from the lowest level on the left up.

5+4 = 9, 9 * 5 = 45!!!!

Now we will do a pretty complicated expression that I will not explain next. I will just show the expression and the respective parse tree and you should be able to figure it out through the process we went through and weighting.


Expression:
   5+((4*5)+(2*5))-4
Token List:
   0,3,1,3,0
Parse Tree:

    -
   / \
  +   4
 / \
5   +
   / \
  *   *
 / \ / \
4  5 2  5
Answer:
   17










Conclusion and Overview:
   This maybe complicated, but aren't the good things in life complicated?? Anyways I will give you the overview of the algorithm for searching used.

Steps

1: Tokenize the list including weighting
2: Find the lowest token that is also the farthest to the right
(so in a list 1,1,1,1,1,1,1,0,1,0,2 the 0 all the way at the right before the 2 would be the first token.)
3: Find the tokens left operand
4: If there are any other UNUSED tokens to the left then
   5: Find the lowest token closet to the spot you are at
5: Else use the number as your operand
6: Repeat 4-5 on the right operand respectively
7: Insert the operator into the tree and its operand as branch/leaf nodes of it
8: Repeat the steps until you are done parsing the expression

427
News / Super Mario 68K
« on: June 22, 2007, 05:46:00 pm »
zomg this is the biggest freakin release of the year!!! Great accomplishment lachprog especially since you got the feature. :thumb:thumb.gif:thumb:thumb.gif:thumb:thumb.gif:thumb:thumb.gif

The sprites, sourcecode, game, and everything else about this game is just amazing. This seriously makes me want to go buy a 68K calculator. I am surprised Nintendo hasn't spoke to you about this lol.

428
News / Doors CS 6.0
« on: June 21, 2007, 05:21:00 pm »
Sorry if you are implementing/someone suggested it already, but are you going to add click-scrollable scrollbars. So that like I can scroll faster through big files in DocDE?

429
News / Doors CS 6.0
« on: June 20, 2007, 02:34:00 pm »
Oh ok my bad. Still cool!

430
News / Doors CS 6.0
« on: June 20, 2007, 06:18:00 am »
Oooo instantaneous gotos. I like this idea, but don't you think that is going promote goto abuse in n00b basic programmers and make the people using MOS have slow basic programmers. Unless Kerm did it in a hook then that is cool :thumb:thumb.gif

431
Art / Just something I did....
« on: June 19, 2007, 07:29:00 pm »
Maybe you should put some gaussin(however you spell it) blur on a shadow layer under the sword part to give it a glowing shiny look.

432
Miscellaneous / Screenshot of your desktop (Revived)
« on: June 17, 2007, 03:26:00 pm »
Oh lol you should look at the tutorials on blender.org. Those tutorials helped me immensely when using blender.

433
Pokémon Purple / [PP] Progress, Starting in '07
« on: June 17, 2007, 03:19:00 pm »

 THE POST 13231905
That's an awesome border drawer tifreak8x :thumb:thumb.gif. Did you just hard code the lines to go from the coordinates?? Or does it use something else?  


434
Miscellaneous / Screenshot of your desktop (Revived)
« on: June 17, 2007, 12:59:00 pm »
FMR did you make that desktop on your own. If so can you tell me how?

435
Miscellaneous / Screenshot of your desktop (Revived)
« on: June 17, 2007, 11:19:00 am »
Super_Speler you use blender once a week. What do you model and why haven't you ever told anybody?

@Delnar: You read my whole programs list in the start menu?? because GIMP wasn't on my desktop.

Pages: 1 ... 27 28 [29] 30 31 ... 90