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

#301 2011-06-28 11:45:59

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

Re: Xenon Inc. Developers' Thread

Temp must stand for temporary then  smile

Edit: 13 pages... uh oh  tongue

Last edited by applejack (2011-06-28 11:46:44)


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

 

#302 2011-06-28 11:51:10

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

Re: Xenon Inc. Developers' Thread

applejack wrote:

Temp must stand for temporary then  smile

Edit: 13 pages... uh oh  tongue

Yep.  tongue

I'm not superstitious. XD

hpotter134 did his job: http://scratch.mit.edu/projects/hpotter134/1887714
Start calculation!  big_smile

Offline

 

#303 2011-06-28 15:18:46

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

Re: Xenon Inc. Developers' Thread

Yes!  big_smile

scimonster wrote:

applejack wrote:

Temp must stand for temporary then  smile

Edit: 13 pages... uh oh  tongue

hpotter134 did his job: http://scratch.mit.edu/projects/hpotter134/1887714
Start calculation!  big_smile


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

 

#304 2011-06-28 15:28:58

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

Re: Xenon Inc. Developers' Thread

So... Who's doing the calculation?


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

 

#305 2011-06-29 05:00:06

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

Re: Xenon Inc. Developers' Thread

I will still be gone for about a week (managed to get access to a computer), but you may remember this post from awhile ago. 

Most of the discussion of this stuff was on page 7.

Here is my original proposal for the evaluation code.  Obviously, it could be cleaned up quite a bit, but it's here. 

For this example, I will not include modulo (%). 

Code:

Inpt: 3 + 4 * 2 / 4 ^ 2 ^ 3
//"Inpt" is set to the innermost "sub-expression" by hpotter134"''s code.

Pseudo Code:

Set t1 to (length of Inpt) //t1 is our input scanner.  
Repeat until t1 = 0
     If item t1 of list Inpt = (^) //scanning for ^, right to left (see page 7)
          Set t2 to item (t1-1) of Inpt //t2 is our "left value"
          Set t3 to item (t1+1) of Inpt //t3 is our "right value"
          Replace item (t1-1) of Inpt with (10^(t2*log(t1)))
          Delete item (t1) of Inpt
          Delete item (t1) of Inpt
     Change t1 by -1
Set t1 to 0
Repeat until t1 = (length of Inpt)
     If item t1 of list Inpt = (*) //scanning for *
          Set t2 to item (t1-1) of Inpt
          Set t3 to item (t1+1) of Inpt
          Replace item (t1-1) of Inpt with t2*t3
          Delete item (t1) of Inpt
          Delete item (t1) of Inpt
     If item t1 of list Inpt = (/) //or also, /
          Set t2 to item (t1-1) of Inpt
          Set t3 to item (t1+1) of Inpt
          Replace item (t1-1) of Inpt with t2/t3
          Delete item (t1) of Inpt
          Delete item (t1) of Inpt
     Change t1 by 1
Set t1 to 0
Repeat until t1 = (length of Inpt)
     If item t1 of list Inpt = (+) //scanning for +
          Set t2 to item (t1-1) of Inpt
          Set t3 to item (t1+1) of Inpt
          Replace item (t1-1) of Inpt with t2+t3
          Delete item (t1) of Inpt
          Delete item (t1) of Inpt
     If item t1 of list Inpt = (-) //or -
          Set t2 to item (t1-1) of Inpt
          Set t3 to item (t1+1) of Inpt
          Replace item (t1-1) of Inpt with t2-t3
          Delete item (t1) of Inpt
          Delete item (t1) of Inpt
     Change t1 by 1
Proceed to next bracket set.

Last edited by amcerbu (2011-06-29 05:06:35)

Offline

 

#306 2011-06-29 05:04:01

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

Re: Xenon Inc. Developers' Thread

Something like that might work, but what about all the multi-ops?

Offline

 

#307 2011-06-29 05:09:06

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

Re: Xenon Inc. Developers' Thread

scimonster wrote:

Something like that might work, but what about all the multi-ops?

As I said earlier, multi-letter ops will evaluate as if they were bracket sets; the syntax for a multi-op is

op(parameter)

We can set up a pretty simple evaluation loop to look for multi-ops and evaluate them before the rest of the expression.

EDIT: Wait!  Better idea!  What if multi-ops are given a different token value ('m' for example)?  We could write a pretty simple evaluation script to deal with that!

Last edited by amcerbu (2011-06-29 05:16:19)

Offline

 

#308 2011-06-29 06:36:22

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

Re: Xenon Inc. Developers' Thread

amcerbu wrote:

EDIT: Wait!  Better idea!  What if multi-ops are given a different token value ('m' for example)?  We could write a pretty simple evaluation script to deal with that!

I was planning on that, but I changed my mind. Maybe we should though.

Offline

 

#309 2011-06-29 09:03:40

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

Re: Xenon Inc. Developers' Thread

I would do the calc, but I don't have Scratch (My computer crashed).  sad
Scimonster OR amcerbu can do it  wink .


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

Offline

 

#310 2011-06-29 09:09:43

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

Re: Xenon Inc. Developers' Thread

Hardmath123 wrote:

I would do the calc, but I don't have Scratch (My computer crashed).  sad
Scimonster OR amcerbu can do it  wink .

You're practically telling me to do the whole "collab" XD
amcerbu.

Offline

 

#311 2011-06-29 09:43:59

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

Re: Xenon Inc. Developers' Thread

I'll be gone until next week, but when I can get ahold of a computer, I'll do it.

Until then, we should work out bugs in the existing project and start dealing with error checking.

Offline

 

#312 2011-06-29 09:53:10

sci_test
Scratcher
Registered: 2011-06-22
Posts: 100+

Re: Xenon Inc. Developers' Thread

amcerbu wrote:

I'll be gone until next week, but when I can get ahold of a computer, I'll do it.

Until then, we should work out bugs in the existing project and start dealing with error checking.

We'll need a list of errors for that.


[signature removed - please be respectful]
Last edited by scimonster (1970-01-01 00:00:00)

Offline

 

#313 2011-06-29 10:25:08

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

Re: Xenon Inc. Developers' Thread

Get us a Beta-Tester!


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

Offline

 

#314 2011-06-29 12:41:59

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

Re: Xenon Inc. Developers' Thread

Tell me what to check for in what projects and what each project is supposed to do and I'll probably be able to do it.  smile

Hardmath123 wrote:

Get us a Beta-Tester!


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

 

#315 2011-06-29 14:10:22

LiquidMetal
Scratcher
Registered: 2011-06-15
Posts: 500+

Re: Xenon Inc. Developers' Thread

I'll beta test if you would like.

Offline

 

#316 2011-06-29 18:47:38

LiquidMetal
Scratcher
Registered: 2011-06-15
Posts: 500+

Re: Xenon Inc. Developers' Thread

My gift to all of you working on this: some scripts for simplification.  It is not as good as I would have liked it to be, but it is something. I spent a long time on it, and you can put it to good use.

I've always though I could make this type of thing pretty easily, but now I see I was wrong.  It would take me at least 168 hours of scratch time during which I would have to be wide awake to make one as good as this looks like it will be.  This completed will be an amazing achievment.  Please let me know when that happens

-LiquidMetal

Offline

 

#317 2011-07-01 11:08:58

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

Re: Xenon Inc. Developers' Thread

LiquidMetal wrote:

I've always though I could make this type of thing pretty easily, but now I see I was wrong.  It would take me at least 168 hours of scratch time during which I would have to be wide awake to make one as good as this looks like it will be.  This completed will be an amazing achievment.  Please let me know when that happens

-LiquidMetal

Glad to hear that.
Yes, you can beta-test  wink .


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

Offline

 

#318 2011-07-03 06:00:05

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

Re: Xenon Inc. Developers' Thread

Since the forum topic has died, here's what I understand to be the plan:

Someone (me) writes the evaluation code. 

Someone else (no clue yet - maybe LiquidMetal could get in here) writes the code for dealing with multi-letter ops: identifying multi-ops in the token list, and writing an evaluation loop. 

Loads of beta-testing. 

First stable release (possibly on a new account named Xenon).

Offline

 

#319 2011-07-03 06:37:40

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

Re: Xenon Inc. Developers' Thread

amcerbu wrote:

Since the forum topic has died, here's what I understand to be the plan:

Someone (me) writes the evaluation code. 

Someone else (no clue yet - maybe LiquidMetal could get in here) writes the code for dealing with multi-letter ops: identifying multi-ops in the token list, and writing an evaluation loop. 

Loads of beta-testing. 

First stable release (possibly on a new account named Xenon).

I don't think we need another account...

Offline

 

#320 2011-07-03 09:09:36

LiquidMetal
Scratcher
Registered: 2011-06-15
Posts: 500+

Re: Xenon Inc. Developers' Thread

amcerbu wrote:

Someone else (no clue yet - maybe LiquidMetal could get in here) writes the code for dealing with multi-letter ops: identifying multi-ops in the token list, and writing an evaluation loop.

What are multi-ops?

Offline

 

#321 2011-07-03 10:23:25

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

Re: Xenon Inc. Developers' Thread

LiquidMetal wrote:

amcerbu wrote:

Someone else (no clue yet - maybe LiquidMetal could get in here) writes the code for dealing with multi-letter ops: identifying multi-ops in the token list, and writing an evaluation loop.

What are multi-ops?

Ops that use multiple letters, like abs, sin, e^, etc...

I forgot to include "!" in parentheses needed, and in the checker.

Offline

 

#322 2011-07-03 12:35:10

LiquidMetal
Scratcher
Registered: 2011-06-15
Posts: 500+

Re: Xenon Inc. Developers' Thread

Code for that is in my "gift to devs of Xenon," It just needs to be compiled into one script.  Whoever is doing simplification should use that as a base.  I'll help you understand it if you want, its supposed to help you to do this in less time.

Offline

 

#323 2011-07-04 10:57:49

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

Re: Xenon Inc. Developers' Thread

Here is the revision I promised a while ago, but I haven't been in a place with internet for a few days now.

It handles multiletter ops pretty well, calling them "str" for string, and then converting that to "f1" for single argument functions, "f2" for two arguments, etc, or just replacing them with the value, if it's a multiletter constant like "pi"

I have a question though: Do we have any hopes of making this work online?


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

Offline

 

#324 2011-07-04 13:42:50

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

Re: Xenon Inc. Developers' Thread

We need error checking for divide by zero and imaginary numbers too!!


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

 

#325 2011-07-04 22:25:05

LiquidMetal
Scratcher
Registered: 2011-06-15
Posts: 500+

Re: Xenon Inc. Developers' Thread

Why are multi-letter ops so hard to process?

Offline

 

Board footer