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

#326 2011-07-05 04:09:57

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

Re: Xenon Inc. Developers' Thread

LiquidMetal wrote:

Why are multi-letter ops so hard to process?

I think it's because they evaluate only the stuff in parentheses in front, not behind and in front.

Offline

 

#327 2011-07-05 11:48:59

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

Re: Xenon Inc. Developers' Thread

I still don't see how that is so complicated.  Make a list of ^ * / + - and say if in that list check for f1 and f2, if not, just f1.

Offline

 

#328 2011-07-05 22:40:48

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

Re: Xenon Inc. Developers' Thread

Multi-letter ops should be handled by 2 lists. One with all the digits and one with everything as numbers.

I.E.

List 1:
1
2
+
4
8

List 2
12
+
48

See? List one makes list 2 happen, and you process list 2!


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

Offline

 

#329 2011-07-05 23:45:45

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

Re: Xenon Inc. Developers' Thread

*ahem*

applejack wrote:

We need error checking for divide by zero, imaginary numbers and other stuff!


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

 

#330 2011-07-06 10:32:35

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

Re: Xenon Inc. Developers' Thread

applejack wrote:

*ahem*

applejack wrote:

We need error checking for divide by zero, imaginary numbers and other stuff!

look here:

Code:

http://i.imgur.com/nh6rn.gif

-LiquidMetal

Offline

 

#331 2011-07-06 11:47:35

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

Re: Xenon Inc. Developers' Thread

smile

LiquidMetal wrote:

applejack wrote:

*ahem*

applejack wrote:

We need error checking for divide by zero, imaginary numbers and other stuff!

look here:

Code:

http://i.imgur.com/nh6rn.gif

-LiquidMetal


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

 

#332 2011-07-07 10:08:11

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

Re: Xenon Inc. Developers' Thread

applejack wrote:

smile

LiquidMetal wrote:

applejack wrote:

*ahem*

look here:

Code:

http://i.imgur.com/nh6rn.gif

-LiquidMetal

But you're allowed to have negative exponents. x^(-y) = 1/(x^y), so it's valid unless x = 0, right?

Also, the commonly asked and never properly explained question: does 0^0 return zero or one?

Lastly, Liquid, it's faster to use this

Code:

n^m = 10^(m*log(n))

for exponents.  smile

Last edited by hpotter134 (2011-07-07 10:09:20)


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

Offline

 

#333 2011-07-07 11:53:57

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

Re: Xenon Inc. Developers' Thread

Could be; Idk what log is.  You can have negative exponents.  Are you going to put ^ in parentheses needed to allow for this more easily?

I had an idea: allow for negative exponents just don't solve them.  That way you can still flip them over the division thingy.

Offline

 

#334 2011-07-07 11:59:04

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

Re: Xenon Inc. Developers' Thread

0^0 = 1.  Why is that so hard to understand?

Offline

 

#335 2011-07-07 16:17:37

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

Re: Xenon Inc. Developers' Thread

n^m = 10^(m*log(n)) does not support negative numbers, my way does.

Offline

 

#336 2011-07-07 16:29:28

Taneb
Scratcher
Registered: 2009-07-07
Posts: 100+

Re: Xenon Inc. Developers' Thread

LiquidMetal wrote:

0^0 = 1.  Why is that so hard to understand?

Because 0^ anything else = 0.

Offline

 

#337 2011-07-07 21:37:29

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

Re: Xenon Inc. Developers' Thread

Yes, but anything ^0 = 1.

I'm back in a place with Scratch, so I'll get started on the evaluation tomorrow.

Offline

 

#338 2011-07-08 08:25:36

roijac
Scratcher
Registered: 2010-01-19
Posts: 1000+

Re: Xenon Inc. Developers' Thread

if you need help:

0^0=1
0^not 0=0
something^0=1
positive^something=e^(m*log(n)) (faster than 10^ and log, tested)
negative^integer=e^(m*log(abs(n))), add minus if m is odd
negative^not integer=imaginary

that's probably all.

Offline

 

#339 2011-07-09 00:11:46

mysoul3435
Scratcher
Registered: 2011-06-16
Posts: 2

Re: Xenon Inc. Developers' Thread

can i join the team? i could use a job. i am not forcing you. i know there is a 1 in 100000 chance you will say yes. but... please?

Offline

 

#340 2011-07-09 08:02:04

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

Re: Xenon Inc. Developers' Thread

Anyone there?  I need to know the status of the current project- have we fixed all the bugs in the sub-expression finder?  Have we already built in the multi-ops evaluation, or should I do that? 

Anyway, glad to finally get started on this project- it's been awhile.

Offline

 

#341 2011-07-09 19:02:42

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

Re: Xenon Inc. Developers' Thread

I'm here.


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

 

#342 2011-07-10 04:21:55

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

Re: Xenon Inc. Developers' Thread

No, I think I have a couple bugs I was working on, and we still need the multi-ops. LiquidMetal made something for us to do those.

Offline

 

#343 2011-07-10 09:35:59

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

Re: Xenon Inc. Developers' Thread

I don't think that we should move on until what we have already works flawlessly.  Otherwise, it will be harder finding the bugs.

Offline

 

#344 2011-07-11 13:46:47

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

Re: Xenon Inc. Developers' Thread

-i^2

amcerbu wrote:

I don't think that we should move on until what we have already works flawlessly.  Otherwise, it will be harder finding the bugs.


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

 

#345 2011-07-11 14:05:22

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

Re: Xenon Inc. Developers' Thread

applejack wrote:

-i^2

amcerbu wrote:

I don't think that we should move on until what we have already works flawlessly.  Otherwise, it will be harder finding the bugs.

Nice one applejack  smile

My idea for multi ops is to make a list of all "string" characters, aka:

Code:

ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz

and then:

Code:

if a letter of the input is contained in the Alphabet list,
     if the last item of tokens is "str"
          replace last of engine with join : with new letter
     else
          add it to the engine and add "str" to the token list.
     [end if]
     if the next letter of the input is NOT contained in the Alphabet list
         [run test to see if it's a function or constant or something else]
         replace last of tokens with [something else]
     [end if]

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

Offline

 

#346 2011-07-11 14:10:50

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

Re: Xenon Inc. Developers' Thread

hpotter134 wrote:

applejack wrote:

-i^2

amcerbu wrote:

I don't think that we should move on until what we have already works flawlessly.  Otherwise, it will be harder finding the bugs.

Nice one applejack  smile

My idea for multi ops is to make a list of all "string" characters, aka:

Code:

ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz

and then:

Code:

if a letter of the input is contained in the Alphabet list,
     if the last item of tokens is "str"
          replace last of engine with join : with new letter
     else
          add it to the engine and add "str" to the token list.
     [end if]
     if the next letter of the input is NOT contained in the Alphabet list
         [run test to see if it's a function or constant or something else]
         replace last of tokens with [something else]
     [end if]

That looks familiar... I know: it's from your project!  tongue

Offline

 

#347 2011-07-11 14:24:00

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

Re: Xenon Inc. Developers' Thread

Wait is this for detecting multi-ops in a string or evaluation?

Offline

 

#348 2011-07-11 15:26:35

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

Re: Xenon Inc. Developers' Thread

LiquidMetal wrote:

Wait is this for detecting multi-ops in a string or evaluation?

The code I posted recently was for multi ops.

@sci, yeah, it's from my project  smile


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

Offline

 

#349 2011-07-11 17:01:16

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

Re: Xenon Inc. Developers' Thread

You didn't answer the question:

LiquidMetal wrote:

Wait is this for detecting multi-ops in a string or evaluation?

Offline

 

#350 2011-07-11 18:28:23

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

Re: Xenon Inc. Developers' Thread

It's for detecting.  The actual evaluation process is simple- after having determined what each multi-op is, simply run the appropriate equation.

Offline

 

Board footer