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

#176 2011-04-13 00:36:38

jji7skyline
Scratcher
Registered: 2010-03-08
Posts: 1000+

Re: Calling all math lovers and good programmers

Yeah i like math, can i join?


I don't know why you say goodbye, I say hello!  big_smile

Offline

 

#177 2011-04-13 06:08:21

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

Re: Calling all math lovers and good programmers

scimonster wrote:

Hardmath123 wrote:

Here are the features we need in the setup engine:

•Converts the input to a list
  ~Keeps numbers and operation names like sin and sqrt as 1 item.
  ~Ex: Converts sqrt 1 + 2 into:
      ·sqrt
      ·1
      ·+
      ·2
•Ignores anything that isn't a number or an operator's symbol
•Replaces (a+b)(a-b) with (a+b)*(a-b)
•Ignores commas in numbers: 1,000 converts to 1000
•Checks for mismatched brackets

Let's add to this list, then start on the setup engine—we ought to finish it by next week.

OK, I'm a bit busy but I'll try to start that soon.  smile

Don't start yet—let's first complete this list.


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

Offline

 

#178 2011-04-13 06:15:06

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

Re: Calling all math lovers and good programmers

Hardmath123 wrote:

scimonster wrote:

Hardmath123 wrote:

Here are the features we need in the setup engine:

•Converts the input to a list
  ~Keeps numbers and operation names like sin and sqrt as 1 item.
  ~Ex: Converts sqrt 1 + 2 into:
      ·sqrt
      ·1
      ·+
      ·2
•Ignores anything that isn't a number or an operator's symbol
•Replaces (a+b)(a-b) with (a+b)*(a-b)
•Ignores commas in numbers: 1,000 converts to 1000
•Checks for mismatched brackets

Let's add to this list, then start on the setup engine—we ought to finish it by next week.

OK, I'm a bit busy but I'll try to start that soon.  smile

Don't start yet—let's first complete this list.

I didn't. What else is there to add?

Offline

 

#179 2011-04-14 08:38:36

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

Re: Calling all math lovers and good programmers

That's what I'm asking in that post  tongue


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

Offline

 

#180 2011-04-15 14:54:34

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

Re: Calling all math lovers and good programmers

We need it to change "x" to *, so if a user types 6 x 1 it can convert to 6*1.

Offline

 

#181 2011-04-15 17:00:10

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

Re: Calling all math lovers and good programmers

Hey guys! I decided to try and go through with the postfix and see how far that took me. Here is the result of that. But since the general public is against that approach, you need only to take a look at the "tokenisation" aspect. It separates the problem into numbers, decimals, operators and IBFs (in-built functions) It also tells apart strings and gives NUL for unrecognized symbols.

I think this is what you guys were talking about.  tongue  Correct me if I'm wrong.


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

Offline

 

#182 2011-04-15 23:49:14

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

Re: Calling all math lovers and good programmers

hpotter134 wrote:

Hey guys! I decided to try and go through with the postfix and see how far that took me. Here is the result of that. But since the general public is against that approach, you need only to take a look at the "tokenisation" aspect. It separates the problem into numbers, decimals, operators and IBFs (in-built functions) It also tells apart strings and gives NUL for unrecognized symbols.

I think this is what you guys were talking about.  tongue  Correct me if I'm wrong.

At this point it looks like the project is done.  Now we call on applejack to make some awesome graphics, and we're set?  I still think it would look nicest 0s1s..

Offline

 

#183 2011-04-16 11:39:14

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

Re: Calling all math lovers and good programmers

here's the startup.


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

 

#184 2011-04-17 02:42:58

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

Re: Calling all math lovers and good programmers

amcerbu wrote:

hpotter134 wrote:

Hey guys! I decided to try and go through with the postfix and see how far that took me. Here is the result of that. But since the general public is against that approach, you need only to take a look at the "tokenisation" aspect. It separates the problem into numbers, decimals, operators and IBFs (in-built functions) It also tells apart strings and gives NUL for unrecognized symbols.

I think this is what you guys were talking about.  tongue  Correct me if I'm wrong.

At this point it looks like the project is done.  Now we call on applejack to make some awesome graphics, and we're set?  I still think it would look nicest 0s1s..

No way. We're a team. It's not a collaboration if one person makes the whole thing.


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

Offline

 

#185 2011-04-17 02:55:35

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

Re: Calling all math lovers and good programmers

Hardmath123 wrote:

Here are the features we need in the setup engine:

•Converts the input to a list
  ~Keeps numbers and operation names like sin and sqrt as 1 item.
  ~Ex: Converts sqrt 1 + 2 into:
      ·sqrt
      ·1
      ·+
      ·2
•Ignores anything that isn't a number or an operator's symbol
•Replaces (a+b)(a-b) with (a+b)*(a-b)
•Ignores commas in numbers: 1,000 converts to 1000
•Checks for mismatched brackets
•Replaces constants' names or symbols wiht values:
pi => 3.141592653
π => 3.141592653

Let's add to this list, then start on the setup engine—we ought to finish it by next week.

Somebody make an engine to do the only the above, please.


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

Offline

 

#186 2011-04-17 09:12:55

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

Re: Calling all math lovers and good programmers

Hardmath123 wrote:

Hardmath123 wrote:

Here are the features we need in the setup engine:

•Converts the input to a list
  ~Keeps numbers and operation names like sin and sqrt as 1 item.
  ~Ex: Converts sqrt 1 + 2 into:
      ·sqrt
      ·1
      ·+
      ·2
•Ignores anything that isn't a number or an operator's symbol
•Replaces (a+b)(a-b) with (a+b)*(a-b)
•Ignores commas in numbers: 1,000 converts to 1000
•Checks for mismatched brackets
•Replaces constants' names or symbols with values:
pi => 3.141592653
π => 3.141592653

Let's add to this list, then start on the setup engine—we ought to finish it by next week.

Somebody make an engine to do only the above, please.

I'm sorry. I'm new to this whole collaboration thing. Here is an engine that I think does what you want, and only what you want. Please download it or view it in Flash player, for I don't think it works in the Java player.


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

Offline

 

#187 2011-04-17 10:04:15

shadow_7283
Scratcher
Registered: 2007-11-07
Posts: 1000+

Re: Calling all math lovers and good programmers

Interesting.... Xenon is also the name of one of Intel's processors.

Offline

 

#188 2011-04-17 10:20:16

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

Re: Calling all math lovers and good programmers

Ha! I knew it sounded familiar.

shadow_7283 wrote:

Interesting.... Xenon is also the name of one of Intel's processors.


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

 

#189 2011-04-17 11:14:16

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

Re: Calling all math lovers and good programmers

hpotter134 wrote:

Hardmath123 wrote:

Hardmath123 wrote:

Here are the features we need in the setup engine:

•Converts the input to a list
  ~Keeps numbers and operation names like sin and sqrt as 1 item.
  ~Ex: Converts sqrt 1 + 2 into:
      ·sqrt
      ·1
      ·+
      ·2
•Ignores anything that isn't a number or an operator's symbol
•Replaces (a+b)(a-b) with (a+b)*(a-b)
•Ignores commas in numbers: 1,000 converts to 1000
•Checks for mismatched brackets
•Replaces constants' names or symbols with values:
pi => 3.141592653
π => 3.141592653

Let's add to this list, then start on the setup engine—we ought to finish it by next week.

Somebody make an engine to do only the above, please.

I'm sorry. I'm new to this whole collaboration thing. Here is an engine that I think does what you want, and only what you want. Please download it or view it in Flash player, for I don't think it works in the Java player.

Ok, but it needs work. And it doesn't need tokenization (can we delete that bit?).


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

Offline

 

#190 2011-04-17 13:21:36

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

Re: Calling all math lovers and good programmers

What about fractional exponents? radicals can have more than one solution,  should it support all?

Hardmath123 wrote:

Here are the features we need in the setup engine:

•Converts the input to a list
  ~Keeps numbers and operation names like sin and sqrt as 1 item.
  ~Ex: Converts sqrt 1 + 2 into:
      ·sqrt
      ·1
      ·+
      ·2
•Ignores anything that isn't a number or an operator's symbol
•Replaces (a+b)(a-b) with (a+b)*(a-b)
•Ignores commas in numbers: 1,000 converts to 1000
•Checks for mismatched brackets
•Replaces constants' names or symbols wiht values:
pi => 3.141592653
π => 3.141592653

Let's add to this list, then start on the setup engine—we ought to finish it by next week.


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

 

#191 2011-04-17 14:36:30

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

Re: Calling all math lovers and good programmers

There's more backgronds now!  big_smile

applejack wrote:

here's the startup.


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

 

#192 2011-04-17 17:47:40

ProgrammingFreak
Scratcher
Registered: 2010-09-04
Posts: 1000+

Re: Calling all math lovers and good programmers

Tell me what to do.

Offline

 

#193 2011-04-17 19:30:28

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

Re: Calling all math lovers and good programmers

ProgrammingFreak wrote:

Tell me what to do.

You can

a) Contribute ideas
b) Expand on other's ideas

Choice a would involve making suggestions here on the forum, and making projects to display your ideas.

Choice b would involve any of the following

- brainstorming here on the forum
- testing/debugging other's contributions
- building on other's contributions

Currently we have my not-perfect list engine, you can test that and improve on that. If you go back a few pages you'll also find scimonster's setup engine; use that if you want.

is that specific enough for instructions?


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

Offline

 

#194 2011-04-18 15:50:43

ProgrammingFreak
Scratcher
Registered: 2010-09-04
Posts: 1000+

Re: Calling all math lovers and good programmers

Okay, thanks.

How bout they choose a mode (+, -, *, /) and then pick numbers. each time a button is clicked it adds/subtracts/multiplies/divides a 'answer' variable.

Last edited by ProgrammingFreak (2011-04-18 16:07:21)

Offline

 

#195 2011-04-18 19:43:45

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

Re: Calling all math lovers and good programmers

That's a nice idea, but it wouldn't be helpful in many circumstances, like a programming language within scratch.

ProgrammingFreak wrote:

Okay, thanks.

How bout they choose a mode (+, -, *, /) and then pick numbers. each time a button is clicked it adds/subtracts/multiplies/divides a 'answer' variable.


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

 

#196 2011-04-18 20:34:44

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

Re: Calling all math lovers and good programmers

ProgrammingFreak wrote:

Okay, thanks.

How bout they choose a mode (+, -, *, /) and then pick numbers. each time a button is clicked it adds/subtracts/multiplies/divides a 'answer' variable.

Actually, the whole point of this project is in creating a program that evaluates an expression.  For example, the user puts in 3+4*2/(1−5)^2 and the program returns a value (in this case, 3.5), using order of operations, etc.  There are many projects on Scratch that use the "choose a mode" method, but this is easier for the user and can support more complex problems.

Last edited by amcerbu (2011-04-18 23:46:46)

Offline

 

#197 2011-04-19 08:44:38

recycle49
Scratcher
Registered: 2009-12-21
Posts: 1000+

Re: Calling all math lovers and good programmers

Necromaster wrote:

scimonster wrote:

Necromaster wrote:


Ok
It has so many more functions though  tongue

I know. I have it. If you want, we can make a prototype in Panther or BYOB (preferably BYOB) then make procedures in scratch.

I'm having trouble with Scratch, it keeps crashing.  sad

BYOB then.  smile

Some people might not understand the new concept of byob, iv done it befre but ill need to refresh on my skills in it


"Every challenge must be met, every battle must be won, and every story will end." -Me
Recycle49 December 09 - November 11 Goodbye

Offline

 

#198 2011-04-19 08:58:43

recycle49
Scratcher
Registered: 2009-12-21
Posts: 1000+

Re: Calling all math lovers and good programmers

scimonster wrote:

Hardmath123 wrote:

scimonster wrote:


OK, I'm a bit busy but I'll try to start that soon.  smile

Don't start yet—let's first complete this list.

I didn't. What else is there to add?

Well couldn't we add functions like negatives and things in the order of mean, median,mode


"Every challenge must be met, every battle must be won, and every story will end." -Me
Recycle49 December 09 - November 11 Goodbye

Offline

 

#199 2011-04-19 10:38:04

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

Re: Calling all math lovers and good programmers

Recycle, you're back!



Checkpoint
•Things we accomplished:
  ~Figured out what setup engine will do
•Things we decided:
  ~This'll be made in Scratch, not BYOB
•What we need do do:
  ~Program setup engine:

Last edited by Hardmath123 (2011-04-19 10:38:54)


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

Offline

 

#200 2011-04-20 05:13:12

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

Re: Calling all math lovers and good programmers

Okay, I'm going to assign a few jobs:

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

amercbu: 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 amercbu's done, add something to report the innermost nested bracket set. So 1+(2+3) would report 2+3

Last edited by Hardmath123 (2011-04-20 05:13:31)


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

Offline

 

Board footer