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] <

To: MicroWorlds Forum <mwforum@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>
Subject: Re: Help!!!!!
From: Alan Bartram <at.bartram@xxxxxxxxxxx>
Date: Mon, 18 Jun 2012 14:19:41 +1000

Hi Daniel,
Here is the program for the Number Challenge I sent you. It's not modulus but integer basically if half the number is equal to half its integer value the number is even if not its odd. This is a test you could use for establishing prime numbers searches.

to sortout :a
insert :a insert char 32 settc "9 wait 10
if :a = 1 [print [finish] systematic :b + 1]
if :a / 2 = int :a / 2 [sortout :a / 2]
sortout :a * 3 + 1
end

to systematic :b
settc "red sortout :b
end

to quest
ct
Print [Look at any number and keep applying the following rules]
Print [if the number is even halve it]
Print [if the number is odd multiply by three and add one]
print [Unless the number is one keep repeating the rules above!]
Print [QUESTION Do all the counting numbers go to ONE?]
print[ ]
Print [To try a particular number type - sortout <number> eg sortout 54 will do 54 for you.] Print [To watch the counting numbers click on the - Systematic 1 button] stopall
end

On the graphics page you need a large text box and two buttons.
Quest - Provides the rules
Systematic - Works through the numbers



  • Previous by thread: Re: Help!!!!!

  • 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