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

#1 2011-09-08 13:12:18

mathlov
New Scratcher
Registered: 2011-09-08
Posts: 1

Can someone help me implementing this in scratch ?

I am new to programming and I want to try and implement this pseudocode code in scratch
1. Intialize sum <- 0
2. do
3. num <- Take Value from user
4. if num = 0
5. goto 8
6. else
7.     sum <- sum + num
8. Print "The Sum is : " + sum
9. while(num !=0)

Offline

 

#2 2011-09-08 13:23:13

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

Re: Can someone help me implementing this in scratch ?

Code:

set [sum] to [0]
ask [What number?] and wait
if <(answer) = [0]>
  ???
else
  change [sum] by (num)
say (join [The Sum is : ](sum))

Does that help at all?

Offline

 

#3 2011-09-08 14:02:23

TRocket
Scratcher
Registered: 2009-08-18
Posts: 1000+

Re: Can someone help me implementing this in scratch ?

does this, help i think it's what you want
http://scratch.mit.edu/projects/TRocket/2019574
download to see the scripts
doesn't say the number online


http://i.imgur.com/1QqnHxQ.png

Offline

 

#4 2011-09-08 16:35:28

MoreGamesNow
Scratcher
Registered: 2009-10-12
Posts: 1000+

Re: Can someone help me implementing this in scratch ?

I've seen this three times now and if this is related to other posts this is an assignment.  Maybe you want to mention that so people don't just give you the code.  What it sounds like you want are pointers rather than a direct answer (assuming this is for school).


http://images2.layoutsparks.com/1/218929/rubiks-cube-animated-rotating.gif
"Cogito ergo sum" --  I think, therefore I am

Offline

 

Board footer