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

#476 2011-09-25 08:19:46

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

Re: Xenon Inc. Developers' Thread

applejack wrote:

Bump?

I don't know whom we're waiting for (scimonster's bug fixes?)  hmm .
PS: It doesn't matter if we're off the front page for a couple of days...


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

Offline

 

#477 2011-09-29 01:56:47

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

Re: Xenon Inc. Developers' Thread

applejack wrote:

  wrote:

  wrote:

  wrote:

  wrote:

  wrote:

  wrote:

  wrote:

  wrote:

  wrote:

  wrote:

  wrote:

  wrote:


hmm ?

How's the debugging going, scimonster?


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

Offline

 

#478 2011-09-29 10:31:15

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

Re: Xenon Inc. Developers' Thread

applejack wrote:

It's kind of like a fractal.

And kind of like spam.


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

Offline

 

#479 2011-10-05 22:04:07

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

Re: Xenon Inc. Developers' Thread

Sci?


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

 

#480 2011-10-06 09:05:25

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

Re: Xenon Inc. Developers' Thread

applejack wrote:

Sci?

What?

Offline

 

#481 2011-10-07 00:30:07

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

Re: Xenon Inc. Developers' Thread

Is there any progress?  neutral

scimonster wrote:

applejack wrote:

Sci?

What?


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

 

#482 2011-10-12 00:19:10

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

Re: Xenon Inc. Developers' Thread

Scimonster's having trouble trouble shooting. I'm sorry for being impatient.  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

 

#483 2011-10-12 09:29:48

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

Re: Xenon Inc. Developers' Thread

Well, I could help with a screenshot of the code.


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

Offline

 

#484 2011-10-16 11:49:28

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

Re: Xenon Inc. Developers' Thread

Guys, I always have to log in when I go into the forums. Can you help? The website logs me out when I go here, but if I log in here and go to the other part of the scratch website, it doesn't log me out. also, it doesn't log me back in when I go back if I don't log in 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

 

#485 2011-10-16 23:07:42

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

Re: Xenon Inc. Developers' Thread

Nevermind, It works now!  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

 

#486 2011-10-23 13:18:05

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

Re: Xenon Inc. Developers' Thread

Okay, we need to get back on track. 
I'm going to try to write out exactly what we want our program to do. 

So far, I've got what we've decided to do for tokenizing the input and matching parentheses, but not evaluation.  Let's write out all the code in pseudocode first and then just port it to Scratch. 

Note that this code is not yet tested.  I'm just putting it out there. 

The following code is written in something like C++/C# syntax. 

Input parsing:

Code:

// Prompt the user for an expression
Ask("Please input expression");
string Expression = Ask.Response;

// Parallel lists of values and tokens
list Values;
list Tokens;

// j represents position in lists of values/tokens. 
// Note that Values[0] is equivalent to "item (1) of (Values)"
int j = 0;

for(int i = 0; i < Expression.Length; ++i)
{
    if(Expression[i].isDigit)
    {
        Tokens[j] = "num";
        // Important: +=, combine digits into one spot in list
        Values[j] += Expression[i];
        
        // Only increment j if finished reading a number Token
        if(!(Expression[i + 1].isDigit))
            ++j;
    }
    
    else if(Expression[i].isOperator)
    {
        // No consecutive operators
        if(Tokens[j] != "")
        {
            Error("Consecutive operators");
            Stop;
        }

        Tokens[j] = "oper";
        Values[j] = Expression[i];
        ++j;
    }

    else if(Expression[i].isParenthesis)
    {
        Tokens[j] = "par";
        Values[j] = Expression[i];
    }
}

Parentheses:

Code:

// Consecutive elements represent indexes of paired parentheses in list Values
// Example: parPairs = {3,10,5,7}. Values[3] and Values[10] are paired
list parPairs;

// Match sets of parentheses
for(int i = 0; i < Tokens.Length; ++i)
{
    if(Values[i] == "(")
    {
        // Will equal 0 when two parentheses match
        int parCount = 1;
        int j = i;
        while(parCount != 0)
        {
            ++j
            if(Values[j] == ")")
                --parCount;
            if(Values[j] == "(")
                ++parCount;
            if(parCount == 0)
            {
                parPairs.Add(i);
                parPairs.Add(j);
            }
        }
    }
}

Offline

 

#487 2011-10-23 13:23:49

samtwheels
Scratcher
Registered: 2011-03-20
Posts: 1000+

Re: Xenon Inc. Developers' Thread

Would you like to develop a Xenon app for my collab OS, Quantum?

Offline

 

#488 2011-10-23 21:58:34

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

Re: Xenon Inc. Developers' Thread

Please explain the "Blah[1].Bleh," or whatever. I THIRST FOR KNOWLEDGE!


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

 

#489 2011-10-23 22:06:06

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

Re: Xenon Inc. Developers' Thread

What's that?

samtwheels wrote:

Would you like to develop a Xenon app for my collab OS, Quantum?


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

 

#490 2011-10-23 22:32:22

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

Re: Xenon Inc. Developers' Thread

applejack wrote:

Please explain the "Blah[1].Bleh," or whatever. I THIRST FOR KNOWLEDGE!

In C-style languages, you can create an array of a specified data type.  When I was using "list" in the code above, I was referring to the equivalent of a Scratch list (a dynamic array of a string/number type).  You access a member of an array in the format arrayName[index], where arrayName is the name of the array and index is an integer. 

IMPORTANT: The code I posted above is in C# syntax, where Array[0] refers to the first element of the array.  That means that the last element of Array is Array[Array.Length - 1]. 

As for "Blah[1].Bleh," that's shorthand for: "Bleh of the 2nd element of Blah."

In other words, Expression[i] means "item (i + 1) of Expression."  Expression is a string, so it's more like "letter (i + 1) of Expression."

I used Expression[i].isDigit as a way of saying "Is the letter (i + 1) of Expression a digit?"

Last edited by amcerbu (2011-10-23 22:34:29)

Offline

 

#491 2011-10-24 00:05:02

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

Re: Xenon Inc. Developers' Thread

So like this?

Code:

// Prompt the user for an expression
Ask("Please input expression");
set answer to expression

// Parallel lists of values and tokens
list Values; (huh?)
list Tokens;

// j represents position in lists of values/tokens. 

for(int i = 0; i < length of expression; ++i) (I don't understand the ++i)
{
    if letter i+1 of expression is a digit
    {
        set item j+1 of Tokens to "num";
        // Important: +=, combine digits into one spot in list (I don't understand the +=)
        Values[j] += Expression[i];
        
        // Only increment j if finished reading a number Token
        if(!(Expression[i + 1].isDigit))
            ++j; (I don't understand this either)
    }
    
    else if letter i+1 of Expression is an operator
    {
        // No consecutive operators
        if(Tokens[j] != "")(what is the "!"?)
        {
            Error("Consecutive operators");
            Stop;
        }

        set item j+1 of Tokens to "oper";
        set item j+1 of Values to letter i+1 of Expression; (huh?)
        ++j; (what does this mean?)
    }

    else if item i+1 of Expression is a parenthesis
    {
        set item j+1 ofTokens to "par";
        set item j+1 of Values to letter i+1 of Expression; (huh?)
    }
}

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

 

#492 2011-10-24 00:24:24

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

Re: Xenon Inc. Developers' Thread

applejack wrote:

So like this?

Code:

// Prompt the user for an expression
Ask("Please input expression");
set answer to expression

// Parallel lists of values and tokens
list Values; (huh?)
list Tokens;

// j represents position in lists of values/tokens. 

for(int i = 0; i < length of expression; ++i) (I don't understand the ++i)
{
    if letter i+1 of expression is a digit
    {
        set item j+1 of Tokens to "num";
        // Important: +=, combine digits into one spot in list (I don't understand the +=)
        Values[j] += Expression[i];
        
        // Only increment j if finished reading a number Token
        if(!(Expression[i + 1].isDigit))
            ++j; (I don't understand this either)
    }
    
    else if letter i+1 of Expression is an operator
    {
        // No consecutive operators
        if(Tokens[j] != "")(what is the "!"?)
        {
            Error("Consecutive operators");
            Stop;
        }

        set item j+1 of Tokens to "oper";
        set item j+1 of Values to letter i+1 of Expression; (huh?)
        ++j; (what does this mean?)
    }

    else if item i+1 of Expression is a parenthesis
    {
        set item j+1 ofTokens to "par";
        set item j+1 of Values to letter i+1 of Expression; (huh?)
    }
}

First of all, "!" is the "not" of C syntax.  !(condition) means not(condition).  != is not(equals). 

+= is shorthand for "add by value"  a += b literally means "set a to (a + b)."  We need this operation because if the program reads "3" from Expression and then reads "4" from Expression, we want it to know that it should combine them into one space (34).  Basically, the program continues reading numbers into the same slot in the Values list until it sees that the next token is not going to be a number. 

Likewise, ++ is shorthand for "increment."  a++ or ++a is the same as a += 1 is the same as "set a to (a + 1)."  That's why it's called "C++"

As for the "list Values;" you have to declare a variable before you can use it in C languages.  In Scratch, the user defines the variables outside of the code, and they are all created at the beginning of the program.  Those lines were meant to indicate that we would need those two lists. 

As a side note, you should know that in C languages, variables only exist as long as they are "in scope."  That means that in the following code:

if(condition)
{
   int i = 0;
}
if(other condition)
{
   print(i);
}

The variable i would not exist by the time you exited the first "if" clause.  That's why in the for(int i = 0; i < Length; ++i;) statement, I declare i every time, because it disappears after each "for" loop ends.

Offline

 

#493 2011-10-26 00:51:05

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

Re: Xenon Inc. Developers' Thread

I made the code! I was just about to tell everyone but my computer froze  sad  So I'm borrowing my sister's now!  big_smile  HAHA! Teh mighty applejack is not just a graphic designer! I had to make a few minor changes to the code above, but the program works!


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

 

#494 2011-10-26 23:04:36

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

Re: Xenon Inc. Developers' Thread

I HAVE FIXED THE BUGS! I'm too lazy to post a link, please just check my latest project. Sorry.  sad


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

 

#495 2011-10-27 00:39:50

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

Re: Xenon Inc. Developers' Thread

When I go to the forums I am still occasionally logged out.


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

 

#496 2011-10-27 18:36:34

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

Re: Xenon Inc. Developers' Thread

Where is the rest of the team?

Offline

 

#497 2011-10-27 22:04:08

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

Re: Xenon Inc. Developers' Thread

amcerbu wrote:

Where is the rest of the team?

I'm still here...reading along...but not having any time between school and whatnot to post anything...  sad


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

Offline

 

#498 2011-10-27 22:10:00

imaperson123
Scratcher
Registered: 2011-07-20
Posts: 100+

Re: Xenon Inc. Developers' Thread

I'll be a beta tester.  smile


http://gstheadquarters.weebly.com/uploads/9/3/8/8/9388597/7786047.gif [img][/img] http://internetometer.com/image/31593.png http://blocks.scratchr.org/API.php?user=imaperson123&amp;action=onlineStatus

Offline

 

#499 2011-10-28 01:41:09

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

Re: Xenon Inc. Developers' Thread

I'm always here, but I respond faster if given a comment.

amcerbu wrote:

Where is the rest of the team?


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

 

#500 2012-02-10 14:47:40

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

Re: Xenon Inc. Developers' Thread

Is xenon totally dead now?


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

Offline

 

Board footer