This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#51 2011-03-31 10:14:41

Hardmath123
Scratcher
Registered: 2010-02-19
Posts: 1000+

Re: Calling all math lovers and good programmers

50th post.

Hmm, my solution:

OPEN the brackets!

So, do:

repeat until (problem) doesn't contain [ ) ]
scan for first instance of [ ) ] in (problem)
find first instance of [ ( ] before first instance of [ ) ] in (problem)
if (symbol before it) = +
delete brackets
if (symbol before) = -
replace all + with -
replace all - with +
remove brackets

etc.

Get it?

Last edited by Hardmath123 (2011-03-31 10:16:31)


Hardmaths-MacBook-Pro:~ Hardmath$ sudo make $(whoami) a sandwich

Offline

 

#52 2011-03-31 10:22:02

scimonster
Community Moderator
Registered: 2010-06-13
Posts: 1000+

Re: Calling all math lovers and good programmers

Hardmath123 wrote:

50th reply.

Hmm, my solution:

OPEN the brackets!

So, do:

repeat until (problem) doesn't contain [ ) ]
scan for first instance of [ ) ] in (problem)
find first instance of [ ( ] before first instance of [ ) ] in (problem)
if (symbol before it) = +
delete brackets
if (symbol before) = -
replace all + with -
replace all - with +
remove brackets

etc.

Get it?

Not exactly...  hmm
Which member will do this?

Offline

 

#53 2011-03-31 10:29:17

Hardmath123
Scratcher
Registered: 2010-02-19
Posts: 1000+

Re: Calling all math lovers and good programmers

I guess I will...

Basically,

1 + (2 - (3 + 4)) becomes:
1 + (2 - 3 - 4)
1 + 2 - 3 - 4
3 - 3 - 4
0 - 4
-4

The idea is to not solve anything until all brackets are out of the way.

Last edited by Hardmath123 (2011-03-31 10:30:04)


Hardmaths-MacBook-Pro:~ Hardmath$ sudo make $(whoami) a sandwich

Offline

 

#54 2011-03-31 10:33:31

scimonster
Community Moderator
Registered: 2010-06-13
Posts: 1000+

Re: Calling all math lovers and good programmers

Ah. I get it now.  smile

Offline

 

#55 2011-03-31 10:34:05

Hardmath123
Scratcher
Registered: 2010-02-19
Posts: 1000+

Re: Calling all math lovers and good programmers

You're one of the few active people...


Hardmaths-MacBook-Pro:~ Hardmath$ sudo make $(whoami) a sandwich

Offline

 

#56 2011-03-31 10:41:09

scimonster
Community Moderator
Registered: 2010-06-13
Posts: 1000+

Re: Calling all math lovers and good programmers

I know...
EDIT: "Few?" I haven't seen anyone but me and you.  tongue   sad

Last edited by scimonster (2011-03-31 10:41:36)

Offline

 

#57 2011-03-31 11:24:42

applejack
Scratcher
Registered: 2010-03-23
Posts: 100+

Re: Calling all math lovers and good programmers

Oh my, I'll have to make backgrounds that say Xenon now! D:

Hardmath123 wrote:

1. What's 'OOO'?
2. TheSuccessor, my mistake. I thought I included you when I said You cna help to applejack. So, YEAH, you can help.
3. I like scimonster's engine. Thanks!
4. How 'bout we call this Xenon?


http://i.imgur.com/zKzps.png
http://blocks.scratchr.org/API.php?action=onlineStatus&type=square&user=applejack -I'm http://blocks.scratchr.org/API.php?action=onlineStatus&type=text&user=applejack

Offline

 

#58 2011-03-31 11:27:42

applejack
Scratcher
Registered: 2010-03-23
Posts: 100+

Re: Calling all math lovers and good programmers

Few??? I'm active everyday, when you're sleeping. You're active when I'm sleeping, usually. I'm guessing you're on the east coast. they have more educated people there.

scimonster wrote:

I know...
EDIT: "Few?" I haven't seen anyone but me and you.  tongue   sad


http://i.imgur.com/zKzps.png
http://blocks.scratchr.org/API.php?action=onlineStatus&type=square&user=applejack -I'm http://blocks.scratchr.org/API.php?action=onlineStatus&type=text&user=applejack

Offline

 

#59 2011-03-31 15:39:41

bbbeb
Scratcher
Registered: 2009-06-11
Posts: 1000+

Re: Calling all math lovers and good programmers

scimonster wrote:

I know...
EDIT: "Few?" I haven't seen anyone but me and you.  tongue   sad

yikes   yikes   yikes   yikes


Back in my day.... there were no laws that censored the internet... now, there are.... nah.

Offline

 

#60 2011-03-31 16:40:01

Necromaster
Scratcher
Registered: 2010-04-07
Posts: 1000+

Re: Calling all math lovers and good programmers

Hardmath123 wrote:

You're one of the few active people...

I'd be active if you told me what to do

Offline

 

#61 2011-03-31 17:51:22

hpotter134
Scratcher
Registered: 2010-02-21
Posts: 100+

Re: Calling all math lovers and good programmers

scimonster wrote:

I know...
EDIT: "Few?" I haven't seen anyone but me and you.  tongue   sad

Sorry I haven't been active...it's a rather annoying thing called school   smile

How do we plan to allow for functions that are not single character, but a short string, a.k.a. sin (x), sqrt(x), etc ?

Also, instead of distributing the operator to the contents of a parenthesis, why don't we just evaluate the contents of the parenthesis, and then use the operator on the result? I feel like distributing the operator is needless hassle. Correct me if I'm wrong, please.


http://i45.tinypic.com/fxgtvc.png

Offline

 

#62 2011-03-31 19:09:02

lemonpretzel
Scratcher
Registered: 2008-10-23
Posts: 100+

Re: Calling all math lovers and good programmers

Hardmath123 wrote:

I guess I will...

Basically,

1 + (2 - (3 + 4)) becomes:
1 + (2 - 3 - 4)
1 + 2 - 3 - 4
3 - 3 - 4
0 - 4
-4

The idea is to not solve anything until all brackets are out of the way.

Wouldn't that be harder? Instead make a program that splits it into a list with different characters, and search for "(" and ")". Then make it evaluate the expression between those( tell me if you want me to do it.)

Offline

 

#63 2011-03-31 23:19:15

hpotter134
Scratcher
Registered: 2010-02-21
Posts: 100+

Re: Calling all math lovers and good programmers

This is what I did so far

Tell me what you think. It's still rather slow though. And very primitive and clunky. But it works (I think).


http://i45.tinypic.com/fxgtvc.png

Offline

 

#64 2011-04-01 03:36:36

scimonster
Community Moderator
Registered: 2010-06-13
Posts: 1000+

Re: Calling all math lovers and good programmers

Um, it didn't solve anything.  hmm
Maybe we need to invent some special characters to mean multiple character things.

Offline

 

#65 2011-04-01 07:33:41

bbbeb
Scratcher
Registered: 2009-06-11
Posts: 1000+

Re: Calling all math lovers and good programmers

lemonpretzel wrote:

Hardmath123 wrote:

I guess I will...

Basically,

1 + (2 - (3 + 4)) becomes:
1 + (2 - 3 - 4)
1 + 2 - 3 - 4
3 - 3 - 4
0 - 4
-4

The idea is to not solve anything until all brackets are out of the way.

Wouldn't that be harder? Instead make a program that splits it into a list with different characters, and search for "(" and ")". Then make it evaluate the expression between those( tell me if you want me to do it.)

You would WANT it to go like this:

1 + (2 - (3 + 4))
1 + (2 - 7)
1 + -5
-4


Back in my day.... there were no laws that censored the internet... now, there are.... nah.

Offline

 

#66 2011-04-01 07:41:13

scimonster
Community Moderator
Registered: 2010-06-13
Posts: 1000+

Re: Calling all math lovers and good programmers

bbbeb wrote:

lemonpretzel wrote:

Hardmath123 wrote:

I guess I will...

Basically,

1 + (2 - (3 + 4)) becomes:
1 + (2 - 3 - 4)
1 + 2 - 3 - 4
3 - 3 - 4
0 - 4
-4

The idea is to not solve anything until all brackets are out of the way.

Wouldn't that be harder? Instead make a program that splits it into a list with different characters, and search for "(" and ")". Then make it evaluate the expression between those( tell me if you want me to do it.)

You would WANT it to go like this:

1 + (2 - (3 + 4) )
1 + (2 - 7)
1 + -5
-4

Yeah, pikachu would.  tongue  (That is you in April Fools change.  tongue )

Offline

 

#67 2011-04-01 09:26:07

Hardmath123
Scratcher
Registered: 2010-02-19
Posts: 1000+

Re: Calling all math lovers and good programmers

Hardmath123 wrote:

You're one of the few active people...

Somebody messed with this post. I posted y o u ' r e, not pikachu're (I'm not that bad at grammar)

EDIT: I whenever I type y ou (without the space), it says pikachu! Quote this if you don't believe me!


you

Last edited by Hardmath123 (2011-04-01 09:27:58)


Hardmaths-MacBook-Pro:~ Hardmath$ sudo make $(whoami) a sandwich

Offline

 

#68 2011-04-01 09:43:04

Paddle2See
Scratch Team
Registered: 2007-10-27
Posts: 1000+

Re: Calling all math lovers and good programmers

Hardmath123 wrote:

Hardmath123 wrote:

You're one of the few active people...

Somebody messed with this post. I posted y o u ' r e, not pikachu're (I'm not that bad at grammar)

EDIT: I whenever I type y ou (without the space), it says pikachu! Quote this if you don't believe me!


you

Happy April Fools Day!  I suspect that everything will be back to normal by tomorrow  smile


http://i39.tinypic.com/2nav6o7.gif

Offline

 

#69 2011-04-01 09:49:24

scimonster
Community Moderator
Registered: 2010-06-13
Posts: 1000+

Re: Calling all math lovers and good programmers

Paddle2See wrote:

Hardmath123 wrote:

Hardmath123 wrote:

You're one of the few active people...

Somebody messed with this post. I posted y o u ' r e, not pikachu're (I'm not that bad at grammar)

EDIT: I whenever I type y ou (without the space), it says pikachu! Quote this if you don't believe me!


you

Happy April Fools Day!  I suspect that everything will be back to normal by tomorrow  smile

Yeah...
At first I was like "what are you doing here?" then I saw your post.  tongue  Why would a bunch of fluffy kittens be posting here?  tongue  tongue

Offline

 

#70 2011-04-01 10:20:35

Hardmath123
Scratcher
Registered: 2010-02-19
Posts: 1000+

Re: Calling all math lovers and good programmers

scimonster wrote:

bbbeb wrote:

lemonpretzel wrote:


Wouldn't that be harder? Instead make a program that splits it into a list with different characters, and search for "(" and ")". Then make it evaluate the expression between those( tell me if you want me to do it.)

You would WANT it to go like this:

1 + (2 - (3 + 4) )
1 + (2 - 7)
1 + -5
-4

Yeah, pikachu would.  tongue  (That is you in April Fools change.  tongue )

True. Actually, that's a good idea!

@hpotter134, that engine is a bit clunky. Did you mess with the setup engine?


Hardmaths-MacBook-Pro:~ Hardmath$ sudo make $(whoami) a sandwich

Offline

 

#71 2011-04-01 10:56:50

applejack
Scratcher
Registered: 2010-03-23
Posts: 100+

Re: Calling all math lovers and good programmers

See my epic new signature?


http://i.imgur.com/zKzps.png
http://blocks.scratchr.org/API.php?action=onlineStatus&type=square&user=applejack -I'm http://blocks.scratchr.org/API.php?action=onlineStatus&type=text&user=applejack

Offline

 

#72 2011-04-01 11:05:21

Necromaster
Scratcher
Registered: 2010-04-07
Posts: 1000+

Re: Calling all math lovers and good programmers

My submission, a very basic calculator.  big_smile
Here ya go for my submission
It's pretty basic but it works

Offline

 

#73 2011-04-01 11:07:56

scimonster
Community Moderator
Registered: 2010-06-13
Posts: 1000+

Re: Calling all math lovers and good programmers

Necromaster wrote:

My submission, a very basic calculator.  big_smile
Here ya go for my submission
It's pretty basic but it works

Hmm, I will have to improve on yours.

Offline

 

#74 2011-04-01 11:10:26

Necromaster
Scratcher
Registered: 2010-04-07
Posts: 1000+

Re: Calling all math lovers and good programmers

scimonster wrote:

Necromaster wrote:

My submission, a very basic calculator.  big_smile
Here ya go for my submission
It's pretty basic but it works

Hmm, I will have to improve on yours.

Yeah
Please do  tongue

Offline

 

#75 2011-04-01 11:15:50

scimonster
Community Moderator
Registered: 2010-06-13
Posts: 1000+

Re: Calling all math lovers and good programmers

Necromaster wrote:

scimonster wrote:

Necromaster wrote:

My submission, a very basic calculator.  big_smile
Here ya go for my submission
It's pretty basic but it works

Hmm, I will have to improve on yours.

Yeah
Please do  tongue

I will in a couple days, I'm going to be away.  hmm

Offline

 

Board footer