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

#101 2011-05-21 23:22:38

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

Re: Xenon Inc. Developers' Thread

like my new sig?

Edit: Yay, 5 pages!  big_smile

Last edited by applejack (2011-05-21 23:39:19)


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

 

#102 2011-05-22 00:45:04

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

Re: Xenon Inc. Developers' Thread

Cool new pic, Joeman592! I added it to my signature and to the advertisement gallery! Thanks!


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

Offline

 

#103 2011-05-22 01:30:51

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

Re: Xenon Inc. Developers' Thread

[/offtopic]

So, while we're waiting on ssss and hpotter134 to finish off the interpreter, I say we start working on the code for the evaluator.  First of all, I think we should have a list of operators, and a parallel list of operator precedence.  This part of the program should kick in to simplify the innermost bracket.  This is what I have so far:

Code:

Operator:   ^ * / + - mod() % sqrt() log() sin() cos() tan()
Precedence: 4 2 2 1 1 2     3 2      2     2     2     2

Basically, all multi-letter operators will have a precedence of 3, because their arguments are contained within brackets.  Of course, %, synonymous to mod(), will evaluate before multiplication (precedence 2), because it's arguments are not contained within brackets.  That means that 4 * 3 % 2 will evaluate 4 * ( 3 % 2 ), not ( 4 * 3 ) % 2.  Also, since it has a lower precedence than exponentiation, 3 % 4 ^ 2 will remain 3 % ( 4 ^ 2 ).

I don't have time right now to post the evaluation process, but basically it would:
     Scan the expression list first for operators of precedence 4, and store their locations. 
     Scan the list for operators of precedence 3, and store their locations. 
etc. 
After this is done, we evaluate from the top of the "location" list, finding the correct operator, and performing an operation relative to its previous and following neighbors.

Last edited by amcerbu (2011-05-22 01:31:15)

Offline

 

#104 2011-05-22 03:22:39

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

Re: Xenon Inc. Developers' Thread

amcerbu wrote:

[/offtopic]

So, while we're waiting on ssss and hpotter134 to finish off the interpreter, I say we start working on the code for the evaluator.  First of all, I think we should have a list of operators, and a parallel list of operator precedence.  This part of the program should kick in to simplify the innermost bracket.  This is what I have so far:

Code:

Operator:   ^ * / + - mod() % sqrt() log() sin() cos() tan()
Precedence: 4 2 2 1 1 2     3 2      2     2     2     2

Basically, all multi-letter operators will have a precedence of 3, because their arguments are contained within brackets.  Of course, %, synonymous to mod(), will evaluate before multiplication (precedence 2), because it's arguments are not contained within brackets.  That means that 4 * 3 % 2 will evaluate 4 * ( 3 % 2 ), not ( 4 * 3 ) % 2.  Also, since it has a lower precedence than exponentiation, 3 % 4 ^ 2 will remain 3 % ( 4 ^ 2 ).

I don't have time right now to post the evaluation process, but basically it would:
     Scan the expression list first for operators of precedence 4, and store their locations. 
     Scan the list for operators of precedence 3, and store their locations. 
etc. 
After this is done, we evaluate from the top of the "location" list, finding the correct operator, and performing an operation relative to its previous and following neighbors.

Hmmm, I had a different idea altogether.


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

Offline

 

#105 2011-05-22 03:42:30

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

Re: Xenon Inc. Developers' Thread

Hardmath123 wrote:

Hmmm, I had a different idea altogether.

I'd like to hear as many ideas as possible, so we can optimize the system before someone starts converting it into blocks.

Offline

 

#106 2011-05-22 06:54:33

scratcher7_13
Scratcher
Registered: 2011-02-09
Posts: 1000+

Re: Xenon Inc. Developers' Thread

amcerbu wrote:

Just reposting the old jobs.  scratcher7_13, you should probably just wait until something needs to be done.  Things marked in green have already been completed.   

Progress report:

Hardmath123: I'm going to build the string-list setup engine

scimonster: Once I'm done, remove commas (like in 1,000) and replace constant's names with values.

applejack: Make specific error backgrounds


ssss: 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)

hpotter134: Once ssss is done, add something to report the innermost nested bracket set. So 1+(2+3) would report 2+3.

From here, we move to computation.  Once hpotter134 has finished, we simply run a script that repeatedly simplifies the innermost bracket set.  This is where scratcher7_13 might get involved.

EDIT: I would be willing to work on the actual evaluation engine.  I have a plan for dealing with order of operations within a set of brackets.

I thought that ssss was leaving.


♫ 90% of teens can't do math. If you are one of the 40% of teens who can, copy and paste this into your signature. ♫♪
http://dl.dropbox.com/u/6273449/BlockLibraryTitle.pnghttp://i.imgur.com/mr9Hf.gif

Offline

 

#107 2011-05-22 06:58:48

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

Re: Xenon Inc. Developers' Thread

scratcher7_13 wrote:

amcerbu wrote:

Just reposting the old jobs.  scratcher7_13, you should probably just wait until something needs to be done.  Things marked in green have already been completed.   

Progress report:

Hardmath123: I'm going to build the string-list setup engine

scimonster: Once I'm done, remove commas (like in 1,000) and replace constant's names with values.

applejack: Make specific error backgrounds


ssss: 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)

hpotter134: Once ssss is done, add something to report the innermost nested bracket set. So 1+(2+3) would report 2+3.

From here, we move to computation.  Once hpotter134 has finished, we simply run a script that repeatedly simplifies the innermost bracket set.  This is where scratcher7_13 might get involved.

EDIT: I would be willing to work on the actual evaluation engine.  I have a plan for dealing with order of operations within a set of brackets.

I thought that ssss was leaving.

Yeah, he quit. :'(

@amcerbu: Is "1" the first thing? According to OOO, it goes "PEMDAS" - Parentheses, exponents, multiplication/division, addition/subtraction. I want to put our multi-letter ops with ^s.

Offline

 

#108 2011-05-22 07:40:38

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

Re: Xenon Inc. Developers' Thread

Yep, who wants the 'implied multiplication' job? You just need to check for consecutive )(, )√, [number](, )[number], and [number][constant], )[constant], ([constant]


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

Offline

 

#109 2011-05-22 07:43:30

scratcher7_13
Scratcher
Registered: 2011-02-09
Posts: 1000+

Re: Xenon Inc. Developers' Thread

Hardmath123 wrote:

Yep, who wants the 'implied multiplication' job? You just need to check for consecutive )(, )√, [number](, )[number], and [number][constant], )[constant], ([constant]

That could be my first job. Could I take it?


♫ 90% of teens can't do math. If you are one of the 40% of teens who can, copy and paste this into your signature. ♫♪
http://dl.dropbox.com/u/6273449/BlockLibraryTitle.pnghttp://i.imgur.com/mr9Hf.gif

Offline

 

#110 2011-05-22 08:00:25

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

Re: Xenon Inc. Developers' Thread

scratcher7_13 wrote:

Hardmath123 wrote:

Yep, who wants the 'implied multiplication' job? You just need to check for consecutive )(, )√, [number](, )[number], and [number][constant], )[constant], ([constant]

That could be my first job. Could I take it?

Sure! You must: inset * for implied multiplication (like 4(5+3) ) and check for mismatched brackets.

Last edited by Hardmath123 (2011-05-22 08:01:08)


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

Offline

 

#111 2011-05-22 10:20:01

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

Re: Xenon Inc. Developers' Thread

applejack wrote:

Code:

abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890!@#$%^&*()`-=[]\;',./~_+{}|:"<>?

Please don't spam. What is the relevance of that?

Offline

 

#112 2011-05-22 10:33:13

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

Re: Xenon Inc. Developers' Thread

scimonster wrote:

applejack wrote:

Code:

abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890!@#$%^&*()`-=[]\;',./~_+{}|:"<>?

Please don't spam. What is the relevance of that?

They're all the letters, numbers, and shift chars. Significance?  hmm \

EDIT: Outposted  tongue

Last edited by Hardmath123 (2011-05-22 10:33:48)


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

Offline

 

#113 2011-05-22 10:37:21

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

Re: Xenon Inc. Developers' Thread

Yeah, you can delete it.

Offline

 

#114 2011-05-22 10:52:19

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

Re: Xenon Inc. Developers' Thread

http://i.imgur.com/zKzps.png

I fixed the blackness problem and rounded the edges.


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

 

#115 2011-05-22 11:04:00

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

Re: Xenon Inc. Developers' Thread

applejack wrote:

http://i.imgur.com/zKzps.png

I fixed the blackness problem and rounded the edges.

Kool.


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

Offline

 

#116 2011-05-22 11:12:35

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

Re: Xenon Inc. Developers' Thread

Do you want me to smooth the edges of the large banner?

Hardmath123 wrote:

applejack wrote:

http://i.imgur.com/zKzps.png

I fixed the blackness problem and rounded the edges.

Kool.


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

 

#117 2011-05-22 11:28:14

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

Re: Xenon Inc. Developers' Thread

Sure!


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

Offline

 

#118 2011-05-22 11:49:58

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

Re: Xenon Inc. Developers' Thread

http://i.imgur.com/AJoXe.png

I fixed someproblems too.


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

 

#119 2011-05-22 16:15:56

scratcher7_13
Scratcher
Registered: 2011-02-09
Posts: 1000+

Re: Xenon Inc. Developers' Thread

Hardmath123 wrote:

scratcher7_13 wrote:

Hardmath123 wrote:

Yep, who wants the 'implied multiplication' job? You just need to check for consecutive )(, )√, [number](, )[number], and [number][constant], )[constant], ([constant]

That could be my first job. Could I take it?

Sure! You must: inset * for implied multiplication (like 4(5+3) ) and check for mismatched brackets.

Should I add it to anything?


♫ 90% of teens can't do math. If you are one of the 40% of teens who can, copy and paste this into your signature. ♫♪
http://dl.dropbox.com/u/6273449/BlockLibraryTitle.pnghttp://i.imgur.com/mr9Hf.gif

Offline

 

#120 2011-05-22 17:32:23

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

Re: Xenon Inc. Developers' Thread

scimonster wrote:

@amcerbu: Is "1" the first thing? According to OOO, it goes "PEMDAS" - Parentheses, exponents, multiplication/division, addition/subtraction. I want to put our multi-letter ops with ^s.

Sorry for being unclear.  The system I described ranks operations of higher precedence (things that happen first) with higher numbers. 

amcerbu wrote:

Code:

Operator:   ^ * / + - mod() % sqrt() log() sin() cos() tan()
Precedence: 4 2 2 1 1 2     3 2      2     2     2     2

The operation with highest precedence is exponentiation ( ^ ).  I would like to say again that the user must format multi-letter operations like this: sqrt(x), sin(x).  That way, the value of the multi-letter operation is taken care of before moving on.  Think about this:

Code:

//In this representation, position up or down indicates bracket hierarchy.  
//The highest line is the innermost bracket set.  
//In our project, the program will evaluate the diagram "top to bottom."  
                                    3      
               4 + 5           log(   )    
      2 / sin(       ) + sqrt(          )
4 + (                                     )

Together, this makes:
4 + ( 2 / sin( 4 + 5 ) + sqrt( log( 3 ) ) )

I listed multi-letter operations with a precedence of 2 because, in fact, they will execute before the rest of the "line" on which the appear.  Consider 2 / sin( 4 + 5 ).  sin( 4 + 5 ) will be calculated before performing the 2 / ___ part. 

Hope that clears up what I said earlier.

Last edited by amcerbu (2011-05-22 17:42:12)

Offline

 

#121 2011-05-22 22:29:10

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

Re: Xenon Inc. Developers' Thread

[ ][ ]    [ ]   [ ]  [ ]   [ ]  [ ][ ]    [ ]    [ ]  [ ][ ]
[ ]  [ ]  [ ]   [ ]  [ ][ ][ ]  [ ]  [ ]  [ ]         [ ]  [ ]
[ ][ ]    [ ]   [ ]  [ ]   [ ]  [ ][ ]    [ ]         [ ]  [ ]
[ ]  [ ]  [ ]   [ ]  [ ]   [ ]  [ ]                    [ ]  [ ]
[ ][ ]    [ ][ ][ ]  [ ]   [ ]  [ ]       [ ]    [ ]  [ ][ ]


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

 

#122 2011-05-22 22:38:28

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

Re: Xenon Inc. Developers' Thread

Code:

                    ___           ___           ___   
     _____         /__/\         /__/\         /  /\  
    /  /::\        \  \:\       |  |::\       /  /::\ 
   /  /:/\:\        \  \:\      |  |:|:\     /  /:/\:\
  /  /:/~/::\   ___  \  \:\   __|__|:|\:\   /  /:/~/:/
 /__/:/ /:/\:| /__/\  \__\:\ /__/::::| \:\ /__/:/ /:/ 
 \  \:\/:/~/:/ \  \:\ /  /:/ \  \:\~~\__\/ \  \:\/:/  
  \  \::/ /:/   \  \:\  /:/   \  \:\        \  \::/   
   \  \:\/:/     \  \:\/:/     \  \:\        \  \:\   
    \  \::/       \  \::/       \  \:\        \  \:\  
     \__\/         \__\/         \__\/         \__\/

Offline

 

#123 2011-05-22 23:10:55

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

Re: Xenon Inc. Developers' Thread

amcerbu wrote:

Code:

                    ___           ___           ___   
     _____         /__/\         /__/\         /  /\  
    /  /::\        \  \:\       |  |::\       /  /::\ 
   /  /:/\:\        \  \:\      |  |:|:\     /  /:/\:\
  /  /:/~/::\   ___  \  \:\   __|__|:|\:\   /  /:/~/:/
 /__/:/ /:/\:| /__/\  \__\:\ /__/::::| \:\ /__/:/ /:/ 
 \  \:\/:/~/:/ \  \:\ /  /:/ \  \:\~~\__\/ \  \:\/:/  
  \  \::/ /:/   \  \:\  /:/   \  \:\        \  \::/   
   \  \:\/:/     \  \:\/:/     \  \:\        \  \:\   
    \  \::/       \  \::/       \  \:\        \  \:\  
     \__\/         \__\/         \__\/         \__\/

Cool, but is it necessary?


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

Offline

 

#124 2011-05-22 23:40:16

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

Re: Xenon Inc. Developers' Thread

Of coure it is. Please update the banners/codes on the first page for my improved ones!  big_smile

Hardmath123 wrote:

amcerbu wrote:

Code:

                    ___           ___           ___   
     _____         /__/\         /__/\         /  /\  
    /  /::\        \  \:\       |  |::\       /  /::\ 
   /  /:/\:\        \  \:\      |  |:|:\     /  /:/\:\
  /  /:/~/::\   ___  \  \:\   __|__|:|\:\   /  /:/~/:/
 /__/:/ /:/\:| /__/\  \__\:\ /__/::::| \:\ /__/:/ /:/ 
 \  \:\/:/~/:/ \  \:\ /  /:/ \  \:\~~\__\/ \  \:\/:/  
  \  \::/ /:/   \  \:\  /:/   \  \:\        \  \::/   
   \  \:\/:/     \  \:\/:/     \  \:\        \  \:\   
    \  \::/       \  \::/       \  \:\        \  \:\  
     \__\/         \__\/         \__\/         \__\/

Cool, but is it necessary?


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

 

#125 2011-05-22 23:48:54

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

Re: Xenon Inc. Developers' Thread

how did you do that?

amcerbu wrote:

Code:

                    ___           ___           ___   
     _____         /__/\         /__/\         /  /\  
    /  /::\        \  \:\       |  |::\       /  /::\ 
   /  /:/\:\        \  \:\      |  |:|:\     /  /:/\:\
  /  /:/~/::\   ___  \  \:\   __|__|:|\:\   /  /:/~/:/
 /__/:/ /:/\:| /__/\  \__\:\ /__/::::| \:\ /__/:/ /:/ 
 \  \:\/:/~/:/ \  \:\ /  /:/ \  \:\~~\__\/ \  \:\/:/  
  \  \::/ /:/   \  \:\  /:/   \  \:\        \  \::/   
   \  \:\/:/     \  \:\/:/     \  \:\        \  \:\   
    \  \::/       \  \::/       \  \:\        \  \:\  
     \__\/         \__\/         \__\/         \__\/

Edit: I'm the first to post on two of the pages now!

Last edited by applejack (2011-05-22 23:50:14)


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