Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
n00b Help
#1
Hi
i'm nkk

i am making a program called "mathemagic" in pure Qbasic
and i wanted to know how to make a console...

what i mean it this..

if user types "1+1" then it should give 2
i wanted to know different possibilities for this....


nkk
\__/)
(='.'=) Copy bunny into your signature to
(")_(") help him gain world domination.
Reply
#2
jeez dude, don't go into to much detail, each character is one byte and they add up you know. i don't think sumo wants to go over his bandwidth because you decided to type up the encylopaedia.

ok, sorry, i just woke up.
what are you talking about? please use details. unless i'm missing something here.
quote="whitetiger0990"]whitetiger is.. WHITE POWER!!! [/quote]
Here
Reply
#3
well, you need to learn how to "parse expressions".

Deleter posted a nice recursive descent expression parser a while ago... maybe he will show you when he sees this topic. =)
Reply
#4
Basically you need to convert the string into individual numbers: Use MID$() and ASC() to get the ASCII value of each character and then create IF statements that figure out what to do. I agree, Deleter's parser is an awesome example.
Peace cannot be obtained without war. Why? If there is already peace, it is unnecessary for war. If there is no peace, there is already war."

Visit www.neobasic.net to see rubbish in all its finest.
Reply
#5
red_Marvin's Equator program is my preference (although I've never tried Deleter's).
http://fileanchor.com/17037-d
f only life let you press CTRL-Z.
--------------------------------------
Freebasic is like QB, except it doesn't suck.
Reply
#6
http://forum.qbasicnews.com/viewtopic.php?t=11145

though recursive stuff can be hard for a newbie to learn...

edit: just realized that uses string indexing, which is not supported in qb, if you want me to rewrite it quick so it works for qb then say so.
[Image: freebasic.png]
Reply
#7
well yeah.. if you could spare anytime i would like you to translate it in qb
but i think this will help and even save u from trouble..
i could understand the parser by going through it.....
so thanx for the prompt help =P
i think i will make convert it in qb

keep rocking!

nkk
\__/)
(='.'=) Copy bunny into your signature to
(")_(") help him gain world domination.
Reply
#8
well and sorry to post this here
i should have posted it in Qbasic general Help..


nkk
\__/)
(='.'=) Copy bunny into your signature to
(")_(") help him gain world domination.
Reply
#9
Don't worry about it, after all it was your first post...


btw, welcome :^_^:
Reply
#10
thank you chaos..
i used qbasic 4.5 for about 1 year
and i learned lot of it..
but what i lacked was a hard disk..Sad(i don't have one..blownup mine)
\__/)
(='.'=) Copy bunny into your signature to
(")_(") help him gain world domination.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)