alice-teacher A students problem

Don Slater dslater at andrew.cmu.edu
Mon Mar 9 13:53:45 EDT 2015


Susan,
Thank you for pointing out the issue with the point of view… We will look into it…

In the meantime, I have an alternative solution in the attached world, which you may want to help your student with (I am not recommending that you just give this to your student, that depends on the age of the student and the goals of your course), but it may be a worthwhile exploration for him.

It involves the use of variables, and taking advantage of a sometimes overlooked result in Alice when you use an Alice move,, turn, or roll with negative values…

I am making the assumption that the student would like the dial of the lock to roll either to the left or to the right...

Here is the algorithm for my solution… Others in the community may provide even better ideas…

 - create two number variables - in the attached example world they are: 
	- “value” for the result of the random number generation, 
	- “CurrentLocation” to keep track of the current setting of the lock
- set “value" to a random number between -40 and +40
- add “value” to the “CurrentLocation”
- if “CurrentLocation” < 40 		(The lock dial only displays positive values 0 - 39)
	- add 40 to the “CurrentLocation”
  else if the “CurrentLocation” >= 40
	- subtract 40 from the “CurrentLocation”

(I am then printing the “value" variable and the “CurrentLocation” variable for debugging purposes)

- roll the comboLock.dial object to the right (0.02 times the “value”)		
	NOTE: 0.02 is 1/40 of a full rotation of the dial
	NOTE: if “value” is negative rolling (or moving or turning) anything a negative distance, will result in a move, turn, or roll in the opposite direction
			comboLock.dial roll RIGHT (0.02 times -10) will result in a roll to the left of 0.2.

If the student wishes to create an animation in which the user inputs where the lock dial should turn, the student can take these ideas and modify them appropriately.

Please feel free to et me know if you have any questions, or would like more of an explanation.

Congratulate your student. This is a terrific problem to work on.



All the best,

Don Slater
Alice Team
Carnegie Mellon University
5000 Forbes Avenue
Pittsburgh, PA 15213

Email: don at alice.org

I have learned this at least by my experiment: that if one advances confidently in the direction of his dreams, and endeavors to live the life he has imagined, he will meet with a success unexpected in common hours.
--- Henry David Thoreau

The true object of all human life is play. -- G.K. Chesterton








> On Mar 6, 2015, at 4:52 PM, Susan Todd <mbhstodd at gmail.com> wrote:
> 
> I have a student who is using a combination lock in a game he is creating. He programmed it to make the arrow keys roll the dial to every 5th number on the dial. When he tried to randomize the combination lock he realized he was going to have to use the point of view property for the dial. If he adds a point of view method into the code and saves it then whenever he tries to open it Alice tells him "unable to load world" if he tries to open the game  through backups of the file it will only allow him to open a version of the world before any point of views were added to the code. How should he go about using the point of view property as a method without receiving this error.
> 
> Any and all suggestion welcome.
> 
> Thanks, Sue
> 
> -- 
> Susan Todd
> Career, Technical Ed. Dept
> Mission Bay High School
> 858.273.1313 x333
> _______________________________________________
> alice-teachers mailing list
> alice-teachers at lists.andrew.cmu.edu
> https://lists.andrew.cmu.edu/mailman/listinfo/alice-teachers

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.andrew.cmu.edu/pipermail/alice-teachers/attachments/20150309/8c1e89be/attachment-0002.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: lockTurn.a2w
Type: application/octet-stream
Size: 224144 bytes
Desc: not available
Url : http://lists.andrew.cmu.edu/pipermail/alice-teachers/attachments/20150309/8c1e89be/attachment-0001.obj 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.andrew.cmu.edu/pipermail/alice-teachers/attachments/20150309/8c1e89be/attachment-0003.html 


More information about the alice-teachers mailing list