Home
Project Folders
Teacher Resources
Student Resources
How Do I?
Literacy
MWForum
Site Map
Search
Our Team

MWForum Message [Date Index] [Threads] [Authors] [Attachments] [Subscribe]

[Thread Prev] [Thread Next]

To: mwforum@xxxxxxxxxxxxxxxxxxxxxxxxxxxx
Subject: Re: changing music
From: "Daniel Ajoy" <da.ajoy@xxxxxxxxx>
Date: Tue, 14 Nov 2006 09:15:24 -0500

On 14 Nov 2006 at 11:15, Mike Sandy wrote:

> Try:
>  
> to change_songs
>  make "song  :song + 1
>  show :song
>  if  :song = 1 
>    [set "beach  "on?  "false
>     set "happy "on? "true ]
>  if :song = 2
>      [set "happy "on?  "false
>       set "forest "on? "true]
>   if :song = 3
>      [set "forest  "on?  "false
>       set "beach "on? "true]
>  if :song > 3
>      [set "beach "on? "false
>        make "song 0]
> end
>  
> Mike

This one has only one variable: "song" and does not have numbers involved.
Why deal with numbers when you can deal with the name of the songs themselves.

to startup
 make "song "beach
end

to change_songs
 if :song = "beach [
  set :song "on? "false
  make "song "forest 
  set :song "on?  "true
  stop
 ]

 if :song = "forest [
  set :song "on? "false
  make "song "happy 
  set :song "on?  "true
  stop
 ]

 if :song = "happy [
  set :song "on? "false
  make "song "beach 
  set :song "on?  "true
  stop
 ]
end


Daniel
OpenWorld Learning




  • Previous by thread: Re: changing music
  • Next by thread: Re: changing music

  • To save an attachment to your computer, PC users should right-click (Mac users, click and hold the mouse button) on the link and then choose 'save target as' from the pop-up menu. A window will then pop up in which you can choose a location for the file.


    © copyright 2001 - 2008