Author Topic: absolutely critical that you play with this small stand alone app  (Read 10679 times)

0 Members and 1 Guest are viewing this topic.

Offline WMCoolmon

  • Purveyor of space crack
  • 213
absolutely critical that you play with this small stand alone app
Quote
Originally posted by kasperl
Bobb: What about doing what the TI calculators do and use a different minus sign for the negative and the substraction? Use an underscore or something for one of them.


It'd be a real pain to do that since you'd have to open up charmap every time you wanted to use a negative.

Although I suppose tilde or something could be subbed in...it'd make the code less readable though.
-C

 
absolutely critical that you play with this small stand alone app
I know it isn't fun for readability, but it'd save a ****load of coding, and quite a few ambiguities.
just another newbie without any modding, FREDding or real programming experience

you haven't learned masochism until you've tried to read a Microsoft help file.  -- Goober5000
I've got 2 drug-addict syblings and one alcoholic whore. And I'm a ****ing sociopath --an0n
You cannot defeat Windows through strength alone. Only patience, a lot of good luck, and a sledgehammer will do the job. --StratComm

 

Offline Anaz

  • 210
absolutely critical that you play with this small stand alone app
or do something like using tilde or another character as your "negative" minus sign rather than subtraction operation.
Arrr. I'm a pirate.

AotD, DatDB, TVWP, LM. Ph34r.

You WILL go to warpstorm...

 

Offline Taristin

  • Snipes
  • 213
  • BlueScalie
    • Skelkwank Shipyards
absolutely critical that you play with this small stand alone app
screw readability, once you get it working once, don't touch it again :p
Freelance Modeler | Amateur Artist

 

Offline Bobboau

  • Just a MODern kinda guy
    Just MODerately cool
    And MODest too
  • 213
absolutely critical that you play with this small stand alone app
I think I'm going to have any time it finds a '-' without an operand on either side it'll replace it with '-1*', sence -# is working
Bobboau, bringing you products that work... in theory
learn to use PCS
creator of the ProXimus Procedural Texture and Effect Generator
My latest build of PCS2, get it while it's hot!
PCS 2.0.3


DEUTERONOMY 22:11
Thou shalt not wear a garment of diverse sorts, [as] of woollen and linen together

 

Offline StratComm

  • The POFressor
  • 212
  • Cameron Crazy
    • http://www.geocities.com/cek_83/index.html
absolutely critical that you play with this small stand alone app
what about (a)-(b)?
who needs a signature? ;)
It's not much of an excuse for a website, but my stuff can be found here

"Holding the last thread on a page comes with an inherent danger, especially when you are edit-happy with your posts.  For you can easily continue editing in points without ever noticing that someone else could have refuted them." ~Me, on my posting behavior

Last edited by StratComm on 08-23-2027 at 08:34 PM

 

Offline Bobboau

  • Just a MODern kinda guy
    Just MODerately cool
    And MODest too
  • 213
absolutely critical that you play with this small stand alone app
this change fixes it I think.

it actualy replaces any '-' that does not have a valid charicter before it with '(-1*' and finds the end of the block it's being multiplyed with and adds a ')'
so -x is replaced with (-1*x)
-(14*5+3) is replaced with (-1*(14*5+3))

Code: [Select]
void fix_implied_mult(string &str){
for(int i = 0; i< str.length(); i++){
if(i && str[i] == '('){
if(!get_value(str[i-1]))
str.insert(i,"*");
}
if(str[i] == '-'){
if((!i || (!is_value(str[i-1]) && str[i-1] != ')') )){
str.insert(i,"(");
int p = 0;
for(int k = i+2; get_value(str[k]) == -1 || p; k++){
if(str[k] == '(')p++;
if(str[k] == ')')p--;
}
str.insert(k,")");
str.insert(i+2,"1*");
i+=3;
}
}
}
}
« Last Edit: April 28, 2005, 05:36:16 pm by 57 »
Bobboau, bringing you products that work... in theory
learn to use PCS
creator of the ProXimus Procedural Texture and Effect Generator
My latest build of PCS2, get it while it's hot!
PCS 2.0.3


DEUTERONOMY 22:11
Thou shalt not wear a garment of diverse sorts, [as] of woollen and linen together

 

Offline Bobboau

  • Just a MODern kinda guy
    Just MODerately cool
    And MODest too
  • 213
absolutely critical that you play with this small stand alone app
test build!
Bobboau, bringing you products that work... in theory
learn to use PCS
creator of the ProXimus Procedural Texture and Effect Generator
My latest build of PCS2, get it while it's hot!
PCS 2.0.3


DEUTERONOMY 22:11
Thou shalt not wear a garment of diverse sorts, [as] of woollen and linen together

 

Offline Scuddie

  • gb2/b/
  • 28
  • I will never leave.
absolutely critical that you play with this small stand alone app
Code: [Select]
enter an expression or type exit to do so
-(9+11)

This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.
Bunny stole my signature :(.

Sorry boobies.

 

Offline Bobboau

  • Just a MODern kinda guy
    Just MODerately cool
    And MODest too
  • 213
absolutely critical that you play with this small stand alone app
Code: [Select]
void fix_implied_mult(string &str){
for(int i = 0; i< str.length(); i++){
if(i && str[i] == '('){
if(!get_value(str[i-1]))
str.insert(i,"*");
}
if(str[i] == '-'){
if((!i || (!is_value(str[i-1]) && str[i-1] != ')') )){
str.insert(i,"(");
int p = 0;
for(int k = i+2; (get_value(str[k]) == -1 || p) && str[k]; k++){
if(str[k] == '(')p++;
if(str[k] == ')')p--;
}
str.insert(k,")");
str.insert(i+2,"1*");
i+=3;
}
}
}
}


ok, try again
Bobboau, bringing you products that work... in theory
learn to use PCS
creator of the ProXimus Procedural Texture and Effect Generator
My latest build of PCS2, get it while it's hot!
PCS 2.0.3


DEUTERONOMY 22:11
Thou shalt not wear a garment of diverse sorts, [as] of woollen and linen together

 

Offline Drew

  • 29
    • http://www.galactic-quest.com
absolutely critical that you play with this small stand alone app
if i put in -1 by itself, the thing crashes
[(WWF - steroids + ties - spandex) / Atomic Piledrivers] - viewing audience = C-SPAN

My god.. He emptied the gasoline tank from the van onto your cat, lit him on fire, threw him in the house and dove for cover.  :wtf: Family indeed.  ~ KT

Happiness is belt fed.

 

Offline Drew

  • 29
    • http://www.galactic-quest.com
absolutely critical that you play with this small stand alone app
-x by itself crashes in general
[(WWF - steroids + ties - spandex) / Atomic Piledrivers] - viewing audience = C-SPAN

My god.. He emptied the gasoline tank from the van onto your cat, lit him on fire, threw him in the house and dove for cover.  :wtf: Family indeed.  ~ KT

Happiness is belt fed.

 

Offline Scuddie

  • gb2/b/
  • 28
  • I will never leave.
absolutely critical that you play with this small stand alone app
Code: [Select]
enter an expression or type exit to do so
-(9+11)

-(9+11) = -20
if this is not corect, please tell me and provide the expression you entered

enter another expression or type exit to do so:
2^-(1)

2^-(1) = 0.5
if this is not corect, please tell me and provide the expression you entered
I think you got that part down, bob :).
Bunny stole my signature :(.

Sorry boobies.

 

Offline Flipside

  • əp!sd!l£
  • 212
absolutely critical that you play with this small stand alone app
-((2/4)*3+(2^2)+6)-3 = -14.5

This seems wrong....

=   -((0.5)*3+(4)+6)-3
= -(1.5)+(10)-3
= -8.5

Though my maths brain cells haven't been used in years, so it could be down to my knowledge of BODMAS ;) It was the only calculation that seemed a bit off.

EDIT : This was prefix 5, I'll try 6 now :) Still -14.5. Someone check my maths, I'm still not certain ;)
« Last Edit: April 28, 2005, 06:29:54 pm by 394 »

 

Offline Bobboau

  • Just a MODern kinda guy
    Just MODerately cool
    And MODest too
  • 213
absolutely critical that you play with this small stand alone app
someone pointed out something screwed up, new version better implyed multiplication suport now.
Bobboau, bringing you products that work... in theory
learn to use PCS
creator of the ProXimus Procedural Texture and Effect Generator
My latest build of PCS2, get it while it's hot!
PCS 2.0.3


DEUTERONOMY 22:11
Thou shalt not wear a garment of diverse sorts, [as] of woollen and linen together

 

Offline Scuddie

  • gb2/b/
  • 28
  • I will never leave.
absolutely critical that you play with this small stand alone app
Sorry flip, your math is wrong :p.  You got the first line right, but you will notice how you made your mistake.

= -((0.5*3)+4+6)-3
= -((1.5)+10)-3
= -(11.5)-3
= -14.5

There was your problem.  As my old math teacher said, "the most important part of an equation is the attention to detail".
Bunny stole my signature :(.

Sorry boobies.

 

Offline Flipside

  • əp!sd!l£
  • 212
absolutely critical that you play with this small stand alone app
Ahhh... yes, the -3 is outside the brackets and so applies after the equation has been inversed :) I'd need another set of brackets to get the result I got ;)

Ah well, told ya it'd been a while ;)

 

Offline Bobboau

  • Just a MODern kinda guy
    Just MODerately cool
    And MODest too
  • 213
absolutely critical that you play with this small stand alone app
because I'm on a computer were I can't save, I'm uploading my code
Bobboau, bringing you products that work... in theory
learn to use PCS
creator of the ProXimus Procedural Texture and Effect Generator
My latest build of PCS2, get it while it's hot!
PCS 2.0.3


DEUTERONOMY 22:11
Thou shalt not wear a garment of diverse sorts, [as] of woollen and linen together

 

Offline WMCoolmon

  • Purveyor of space crack
  • 213
absolutely critical that you play with this small stand alone app
Compiled version (EXE):
-C

 

Offline Bobboau

  • Just a MODern kinda guy
    Just MODerately cool
    And MODest too
  • 213
absolutely critical that you play with this small stand alone app
I'm going to assume that the silence means no one has found any more errors...
Bobboau, bringing you products that work... in theory
learn to use PCS
creator of the ProXimus Procedural Texture and Effect Generator
My latest build of PCS2, get it while it's hot!
PCS 2.0.3


DEUTERONOMY 22:11
Thou shalt not wear a garment of diverse sorts, [as] of woollen and linen together