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

#1 2011-09-28 23:40:30

josh111111
New Scratcher
Registered: 2011-09-08
Posts: 4

Hi

Can some help me write this scratch program in pseudocode !


i have done my project and its saved as "count"

I am new to pseudocode so please explain with steps if possible thanks !

Offline

 

#2 2011-09-29 10:37:31

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

Re: Hi

Could you please explain what PseudoCode is? And if it isn't related to scratch, this topic is probably better in Misc.  smile

Offline

 

#3 2011-09-29 12:19:27

ImagineIt
Scratcher
Registered: 2011-02-28
Posts: 1000+

Re: Hi

ProgrammingFreak wrote:

Could you please explain what PseudoCode is? And if it isn't related to scratch, this topic is probably better in Misc.  smile

He can't post in misc.

Offline

 

#4 2011-09-29 13:57:29

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

Re: Hi

ImagineIt wrote:

ProgrammingFreak wrote:

Could you please explain what PseudoCode is? And if it isn't related to scratch, this topic is probably better in Misc.  smile

He can't post in misc.

True...  hmm

Offline

 

#5 2011-09-29 16:59:07

Paddle2See
Scratch Team
Registered: 2007-10-27
Posts: 1000+

Re: Hi

Psuedocode just means to write it out kind of like it was in a computer language - only focusing more on the ideas behind the program rather than making sure it would actually run with proper syntax.  Here's one interpretation:

Initialize variables
Look at each list item
    if it's smaller than the smallest we've seen yet
         remember it as the smallest
    end if
next list item
output results

Here's a version that's closer to actual computer code:

Set the min_index variable to one
Set the count variable to zero
for each item in the list
     increment count
     compare that item at index count to the item at index min_index
     if it is smaller
           set min_index to count
     end if
next item
output count


http://i39.tinypic.com/2nav6o7.gif

Offline

 

Board footer