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

#326 2011-05-01 00:38:44

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

Re: Calling all math lovers and good programmers

Happy Birthday!  big_smile

Offline

 

#327 2011-05-01 00:50:17

ssss
Scratcher
Registered: 2007-07-29
Posts: 1000+

Re: Calling all math lovers and good programmers

amcerbu wrote:

Sorry, today's my 15th birthday.  I'll work on it (and hopefully finish) today or tomorrow.  I got caught up in a lot of stuff.

Happy birthday


Hey.  It's me SSSS, back from the dead!  smile

Offline

 

#328 2011-05-01 03:13:36

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

Re: Calling all math lovers and good programmers

Happy Birthday!

Take your time  wink


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

Offline

 

#329 2011-05-01 08:44:29

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

Re: Calling all math lovers and good programmers

https://lh6.googleusercontent.com/_MRv2zxg8oVs/TNFecqJy35I/AAAAAAAAAVo/WpwuFD3OWkI/s400/bump.png

Offline

 

#330 2011-05-01 10:38:32

NeilWest
Scratcher
Registered: 2010-01-06
Posts: 1000+

Re: Calling all math lovers and good programmers

Can I be an advertiser?

I'm very skilled at BBCode and I'd like to take the chance to be part of a group which (might be) quite sucsessful. So can I?

Offline

 

#331 2011-05-01 10:53:29

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

Re: Calling all math lovers and good programmers

NeilWest wrote:

Can I be an advertiser?

I'm very skilled at BBCode and I'd like to take the chance to be part of a group which (might be) quite sucsessful. So can I?

Just advertize in your sig.  smile

Offline

 

#332 2011-05-01 21:38:56

amcerbu
Scratcher
Registered: 2009-07-21
Posts: 500+

Re: Calling all math lovers and good programmers

Hardmath123 wrote:

amcerbu: Once sci's done, add something to test for mismatched brackets and when you have something like 5√2 or (1)(2) replace them with 5*√2 or (1)*(2)

Okay, here's what I'm gonna do:

Complete the setup engine, which will "tokenize" the input into a list.  There are some revisions I would like to make to Scimonster's engine (sorry). 

Insert * for implied multiplication. 

Locate pairs of corresponding parentheses, and store their locations (token #'s) to two separate lists.  This will be necessary to check for mismatched brackets and syntax errors. 

Am I doing someone else's job?

EDIT: By the way, this is how the parentheses locations will work: one temporary variable will increase from 0 until it reaches "(", and another variable will start at that location, and increase until it reaches ")" (and has passed an equal number of "(" and ")" already- we don't want it picking up the first one it stumbles across).  That means that innermost brackets will appear at the end of the parentheses location lists, and in order from left to right.  So...

Code:

a+(b(c+d))
1234567890
will report as
( list- 3 5 
) list- 0 9

Note- I used 0 instead of 10, didn't want to run out of digits. 

Notice that the innermost brackets - at locations 5 and 9 - are the last members of their respective lists.

Last edited by amcerbu (2011-05-01 21:50:38)

Offline

 

#333 2011-05-02 00:07:51

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

Re: Calling all math lovers and good programmers

amcerbu wrote:

Hardmath123 wrote:

amcerbu: Once sci's done, add something to test for mismatched brackets and when you have something like 5√2 or (1)(2) replace them with 5*√2 or (1)*(2)

Okay, here's what I'm gonna do:

Complete the setup engine, which will "tokenize" the input into a list.  There are some revisions I would like to make to Scimonster's engine (sorry). 

Insert * for implied multiplication. 

Locate pairs of corresponding parentheses, and store their locations (token #'s) to two separate lists.  This will be necessary to check for mismatched brackets and syntax errors. 

Am I doing someone else's job?

EDIT: By the way, this is how the parentheses locations will work: one temporary variable will increase from 0 until it reaches "(", and another variable will start at that location, and increase until it reaches ")" (and has passed an equal number of "(" and ")" already- we don't want it picking up the first one it stumbles across).  That means that innermost brackets will appear at the end of the parentheses location lists, and in order from left to right.  So...

Code:

a+(b(c+d))
1234567890
will report as
( list- 3 5 
) list- 0 9

Note- I used 0 instead of 10, didn't want to run out of digits. 

Notice that the innermost brackets - at locations 5 and 9 - are the last members of their respective lists.

Sounds good!

Offline

 

#334 2011-05-02 00:55:38

amcerbu
Scratcher
Registered: 2009-07-21
Posts: 500+

Re: Calling all math lovers and good programmers

@Hardmath123- Sorry to be picky, but you spelled my username wrong under the People who want to make a company heading.  I just don't want the name written wrong in project notes and things like that.  Thanks.

EDIT: I am now advertising.

Last edited by amcerbu (2011-05-02 02:06:50)

Offline

 

#335 2011-05-02 02:09:20

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

Re: Calling all math lovers and good programmers

amcerbu wrote:

@Hardmath123- Sorry to be picky, but you spelled my username wrong under the People who want to make a company heading.  I just don't want the name written wrong in project notes and things like that.  Thanks.

EDIT: I am now advertising.

You should have told me on my setup engine....

Offline

 

#336 2011-05-02 03:16:02

DarthPickley
Scratcher
Registered: 2008-06-13
Posts: 100+

Re: Calling all math lovers and good programmers

scimonster wrote:

amcerbu wrote:

sinh(x)- 0.5(e^x - e^-x)
cosh(x)- 0.5(e^x + e^-x)
tanh(x)- sinh(x)/cosh(x)

asinh(x)- ln (x + sqrt(x^2 + 1) )
acosh(x)- ln (x + sqrt(x^2 - 1) )
atanh(x)- 0.5(ln ( (1+x) / (1-x) ) )

I really don't think we need to include them, though.

Yeah...  tongue

amcerbu wrote:

"sinh" is 'sin hyperbolic".  Darthpickley suggested that we include the hyperbolic functions.  Here's the Wikipedia article.

EDIT: Time to get started on my job.

I don't think we need them either if you just posted workarounds.

I only suggested it because it is really useful for people who live on hyperbolic planes...
wait, that's not really anybody...
well, I still just feel like it isn't the most difficult thing to add in to anything.

Offline

 

#337 2011-05-02 04:42:37

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

Re: Calling all math lovers and good programmers

amcerbu wrote:

Locate pairs of corresponding parentheses, and store their locations (token #'s) to two separate lists.  This will be necessary to check for mismatched brackets and syntax errors. 

Am I doing someone else's job?

EDIT: By the way, this is how the parentheses locations will work: one temporary variable will increase from 0 until it reaches "(", and another variable will start at that location, and increase until it reaches ")" (and has passed an equal number of "(" and ")" already- we don't want it picking up the first one it stumbles across).  That means that innermost brackets will appear at the end of the parentheses location lists, and in order from left to right.  So...

Code:

a+(b(c+d))
1234567890
will report as
( list- 3 5 
) list- 0 9

Note- I used 0 instead of 10, didn't want to run out of digits. 

Notice that the innermost brackets - at locations 5 and 9 - are the last members of their respective lists.

NO!!!
It just needs to set a variable to
2+3
if the setup list is:
(
5
+
(
2
+
3
)

+
2
)

THAT's ALL

Last edited by Hardmath123 (2011-05-02 04:43:37)


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

Offline

 

#338 2011-05-02 06:03:05

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

Re: Calling all math lovers and good programmers

Hardmath123 wrote:

amcerbu wrote:

Locate pairs of corresponding parentheses, and store their locations (token #'s) to two separate lists.  This will be necessary to check for mismatched brackets and syntax errors. 

Am I doing someone else's job?

EDIT: By the way, this is how the parentheses locations will work: one temporary variable will increase from 0 until it reaches "(", and another variable will start at that location, and increase until it reaches ")" (and has passed an equal number of "(" and ")" already- we don't want it picking up the first one it stumbles across).  That means that innermost brackets will appear at the end of the parentheses location lists, and in order from left to right.  So...

Code:

a+(b(c+d))
1234567890
will report as
( list- 3 5 
) list- 0 9

Note- I used 0 instead of 10, didn't want to run out of digits. 

Notice that the innermost brackets - at locations 5 and 9 - are the last members of their respective lists.

NO!!!
It just needs to set a variable to
2+3
if the setup list is:
(
5
+
(
2
+
3
)

+
2
)

THAT's ALL

Wait.
Isn't that hpotter's job?

Offline

 

#339 2011-05-02 08:41:01

amcerbu
Scratcher
Registered: 2009-07-21
Posts: 500+

Re: Calling all math lovers and good programmers

Hardmath123 wrote:

NO!!!
It just needs to set a variable to
2+3
if the setup list is:
(
5
+
(
2
+
3
)

+
2
)

THAT's ALL

But how does it know that 2+3 are inside the parentheses?  Could I have some pseudocode?

You said I should make something that checks for misplaced brackets?  How will that work in the system you described?

Last edited by amcerbu (2011-05-02 08:46:08)

Offline

 

#340 2011-05-02 09:00:03

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

Re: Calling all math lovers and good programmers

amcerbu wrote:

Hardmath123 wrote:

NO!!!
It just needs to set a variable to
2+3
if the setup list is:
(
5
+
(
2
+
3
)

+
2
)

THAT's ALL

But how does it know that 2+3 are inside the parentheses?  Could I have some pseudocode?

You said I should make something that checks for misplaced brackets?  How will that work in the system you described?

You just make sure the number of "("s is the same as the number of ")"s.  smile

Perhaps like this:

Code:

delete (all) of [temps]
add (0) to [temps]
add (0) to [temps]
add (0) to [temps]
repeat (length of [Engine])
  replace item (1) of [temps] with ((item (1) of [temps]) + (1))
  if <(item (item (1) of [temps]) of [Engine]) = "(">
    replace item (2) of [temps] with ((item (2) of [temps]) + (1))
  if <(item (item (1) of [temps]) of [Engine]) = ")">
    replace item (3) of [temps] with ((item (3) of [temps]) + (1))

Item 2 is (s and item 3 is )s.

EDIT: Why don't I just do it, now that I told you the code?  tongue

Last edited by scimonster (2011-05-02 09:00:30)

Offline

 

#341 2011-05-02 09:13:30

amcerbu
Scratcher
Registered: 2009-07-21
Posts: 500+

Re: Calling all math lovers and good programmers

Sorry to make you do it... I wasn't sure what Hardmath123 was asking for.

Last edited by amcerbu (2011-05-02 09:17:16)

Offline

 

#342 2011-05-02 09:14:21

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

Re: Calling all math lovers and good programmers

amcerbu wrote:

Sorry to make you do it... I wasn't sure what Hardmath123 was asking for.

It's fine, just took a minute.  smile

Offline

 

#343 2011-05-02 09:17:00

amcerbu
Scratcher
Registered: 2009-07-21
Posts: 500+

Re: Calling all math lovers and good programmers

The reason I posted the idea above was that using two lists for parentheses hierarchy would help us later on in the evaluation process.  With two lists, the sequence of operations inside parentheses is already spelled out.  I don't think we need two separate systems for evaluating and checking for syntax errors.

Last edited by amcerbu (2011-05-02 23:59:15)

Offline

 

#344 2011-05-02 23:04:28

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

Re: Calling all math lovers and good programmers

I'm thinking that if we're going to stay together, a graphing calculator would be a great thing to make using Xenon.


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

Offline

 

#345 2011-05-02 23:57:57

amcerbu
Scratcher
Registered: 2009-07-21
Posts: 500+

Re: Calling all math lovers and good programmers

applejack wrote:

I'm thinking that if we're going to stay together, a graphing calculator would be a great thing to make using Xenon.

+1

Offline

 

#346 2011-05-03 04:05:10

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

Re: Calling all math lovers and good programmers

amcerbu wrote:

applejack wrote:

I'm thinking that if we're going to stay together, a graphing calculator would be a great thing to make using Xenon.

+1

That would be cool.  smile

Offline

 

#347 2011-05-03 18:04:34

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

Re: Calling all math lovers and good programmers

What's +1 mean?

amcerbu wrote:

applejack wrote:

I'm thinking that if we're going to stay together, a graphing calculator would be a great thing to make using Xenon.

+1


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

Offline

 

#348 2011-05-03 18:59:29

amcerbu
Scratcher
Registered: 2009-07-21
Posts: 500+

Re: Calling all math lovers and good programmers

Support, something like that.  It's kinda for voting.

Offline

 

#349 2011-05-03 23:10:14

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

Re: Calling all math lovers and good programmers

1. I'm back here!
2. I would love to stay
3. A graphing calculator? IS THIS SRS BIZNESS? if so, its going to be a problem...

(We'd need like y=mx+b, ax+bx=c, x^2+ax+b= 0; )
That would be an issue.


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

Offline

 

#350 2011-05-03 23:27:20

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

Re: Calling all math lovers and good programmers

We're still working on Xenon, and if we did a graphing calculator afterword, you'd just put in the the part that y (or f(x)) was equal to. it would just substitute x for a different number each time.

bbbeb wrote:

1. I'm back here!
2. I would love to eat lots of watermelon until I explode or turn into an epic kirby.
3. A graphing calculator? IS THIS SRS BIZNESS? if so, its going to be a problem...

(We'd need like y=mx+b, ax+bx=c, x^2+ax+b= 0; )
That would be an issue for my etreme hatred of fluffy white dogs.


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

Offline

 

Board footer