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: MIA, Ask an Expert: dice counts
From: "Mike Sandy" <mjsandy@xxxxxxxxxxxxxx>
Date: Fri, 19 May 2006 18:40:45 +0100

A solution to the problem in a manual way might be as follows:
Throw the dice and write down the number shown. If that number
occurred again it would not be recorded. The process continues
until the last number is thrown, this is recorded and the count
of throws stopped.
A list can be used to record the numbers (starting with
an empty list), e.g. make "num.list fput :number :num.list.

member? :number :num.list,  determines if a number is already in
the list.

What can be used to determine when the throws are stopped?

Mike

----- Original Message ----- From: "Ask an Expert - Question" <askanexpert@xxxxxxxxxxxxxxxxxxxxx>
To: <mwforum@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>
Sent: Thursday, May 18, 2006 3:26 PM
Subject: MIA, Ask an Expert: dice counts



This is an automatic message sent from the web form at:
http://mia.openworldlearning.org/mwforum.htm

from: Damian <dnicetin@xxxxxxxxxxxx>
date: Thu May 18 01:03:37 2006

Hello

I have a question.. I have written the following program to simulate the results from a dice roll and it works fine..

to dice
make "roll random 6
if :roll = 0 [make "one :one + 1]
if :roll = 1 [make "two :two + 1]
if :roll = 2 [make "three :three + 1]
if :roll = 3 [make "four :four + 1]
if :roll = 4 [make "five :five + 1]
if :roll = 5 [make "six :six + 1]
end

to diceroll :n
make "one 0 make "two 0 make "three 0 make "four 0 make "five 0 make "six 0
repeat :n [dice]
print "one print :one
print "two print :two
print "three print :three
print "four print :four
print "five print :five
print "six print :six
end


My problem is, that I want to change this procedure so that it counts the number of rolls that it takes before I get the values 1, 2, 3, 4, 5 and 6 (i.e a complete set of numbers, but not necessarily in numerical order)

HELP!!!, Im stuck. are there any Logowriter Guru's out there that can help?





*****************************
OpenWorld Learning
http://www.openworldlearning.org








  • Previous by thread: Re: MIA, Ask an Expert: dice counts
  • Next by thread: Re: MIA, Ask an Expert: dice counts

  • 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