alice-teacher s Digest, Vol 78, Issue 1

robert durtschi robert.durtschi at gcsu.edu
Wed Mar 1 21:51:48 EST 2017


The only screenshot I saw was the black queen at the end. I don't know if it is a "feature" of the digest, or a "feature" of the Outlook version they let us use at Georgia College, but I seldom get screen shots.
Thanks for the "text" explanation

I played around with what you sent me: changing the "When the World starts" to "While the World runs" then dragging "world.my first method" into each of "begin", "During" and "end"
The null pointer error only occurs in the "end" and only after the "Play" window is closed, or "stop" is clicked on that window which also closes it.
I tried dragging a non-world object primitive action into "end" ("ground.say"goodbye") and did not get the null pointer exception. (didn't see the message either, but that makes sense that I wouldn't)

I created a new method (ground.test) and dragged it into "end" and got the null-pointer exception only after I closed the "play" window.

Don;
>> Disabling the ability to change the ?when the world starts?
Very bad idea.  It would break existing code including 7 years of my student's efforts, and at least 3 chapters (6, 8, 10) of the book I and the rest of those who are teaching CSCI-1000 here at Georgia College are using plus the corresponding CIS-110 class I'm teaching at Georgia Military College. Frankly I've never ran into this situation before because hooking something to the end condition of "while the world is running" is not something we thought made sense to do.

Since the error only occurs when the "play" window is closed. I Think (not actually looking at the "play" window close handler) that it could be captured there with an exception handler that would catch the null handle exception and kill it before it got high enough to be visible.

Or you could take a suggestion from "Are Your Lights On?: How to determine what the problem really is" (a really good book. I highly recommend) and warn everyone to not to mess with the end statement when changing from "When the world starts" to "While the world is running"

Best
Bob Durtschi
________________________________
-------------------------------

Sorry, I guess you couldn?t see my screenshot. Below is my code that demonstrates the problem. It seems like the world itself is already gone when the End code is executed. You don?t even need any code in the method that is called.
Events
While the world is running
Begin:  <None>

During: <None>

End:
world.my first method



Methods
  world.my first method ( )
    No variables
        Do Nothing

?
James Vanderhyde
Assistant Professor, Computer Science
Program Director, Master of Applied Computer Science
Saint Xavier University
3700 W. 103rd St.
Chicago, IL 60655
773-298-3454

------------------------------

Message: 3
Date: Tue, 28 Feb 2017 14:33:16 -0500
From: Donald Slater <djslater107 at mac.com>
To: Alice Teachers <alice-teachers at lists.andrew.cmu.edu>
Subject: Re: alice-teacher s Digest, Vol 77, Issue 20
Message-ID: <41F449AC-66CE-4C3A-A1F4-DDCBFC4F1BC3 at mac.com>
Content-Type: text/plain; charset="utf-8"

If I have been following this thread correctly...

Definitely a problem. Trying to execute something when Alice has quit running the program does not, make sense, on the face of it. Possible options:

        1) Disabling the ability to change the ?when the world starts? event to ?while the world is running?. The Begin: and During: options have utility while the world is running. But this could be handled (clumsily, perhaps) by creating a method with the "while something is true?? event inside of it.

        2) Removing the End: option, so that you can execute something when the world Begins: or During: program execution.

        3) Alice could check to see if there is something called in the End: option before completely terminating the thread. I think that this would provide the behavior that Jim was looking for.

Other thoughts / suggestions?

Don Slater

Alice Project
Carnegie Mellon University
Entertainment Technology Center
700 Technology Drive
Pittsburgh, PA 15219

Email: dslater at cmu.edu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.andrew.cmu.edu/pipermail/alice-teachers/attachments/20170302/d7cf50f9/attachment.html>


More information about the alice-teachers mailing list