• entries
570
2427
• views
215654

# Untitled

40 views

I think I'm done with this parser nonsense. Variables were pie to fix. Then I started adding in the stuff for unary operaters (basically, trig functions, inverse trig functions and log).

So I do a test.

INPUT: cos0
OUTPUT: 1

And I suddenly feel really really happy because omg it was working!

And how wrong I was. If we illustrate this with a picture of a tree...

This isn't what we want - the value of cos is being calculated based on the default value (0), not on the actual input. ARRGH! This took me some brain bashing to fix. For reference, we want it too look like this -

The actual solution doesn't look like that though, but it almost does. Almost. Its a little messier [headshake]

Well, I guess it doesn't make that much of a difference. It looks pretty messy in code though:
void apply( unsigned int op, IEvalable< T, V >* expr ) {	if ( op == OP_SIN ||		 op == OP_COS ||		 op == OP_TAN ||		 op == OP_LOG ||		 op == OP_ASIN ||		 op == OP_ACOS ||		 op == OP_ATAN ) {				splice< OP_ADD >( expr );		append( op );	}	else {		splice( op, expr );	}}

But yeah. Hopefully there are no big oversights. There are still some bugs, like OP_LOG doesn't work for shit. But I don't care at this point.

Tommorrow I'm going to write some rendering functions and we can start rendering single-variable graphs. Then after that I'll implement an OGL renderer and we can play with MULTIVARIABLE GRAPHS :D :D

And then I'm throwing this project into the fucking portfolio. Because that's the only reason I chose to do it... grr. Bad idea.

HAHAHAHAHAHAHAHA

oh man that is like a mirror image of parts of our old scripting engine, the bugs were rampant, better test well, eesh. =)

Thanks. I think I'm going to go cry right now :(

## Create an account

Register a new account