Hmm...

I found http://jsoftware.com/pipermail/programming/2014-March/036154.htmlwhich
contains console.html (it's not attached at
http://www.jsoftware.com/jwiki/BrianSchott/code/turtleGraphics/tgsjhspresumably
because you would need to rename it to use a different extension
- perhaps .txt instead of .html - to upload it there).

And, with that, I was able to get it running.

In a fresh session, hitting enter on your line that says fd 20 results in a
visit to the url http://127.0.0.1:65001/tgsj with a POST method and a body
of:

jdo=jev_tgsj_%200&jtype=enter&jmid=command&jsid=&command=fd%2020&jdata=&jwid=ijs

I imagine that at least some of this is controlled by Eric's jhs code -
I've not attempted to study it (lack of time, so far).

The response body looks like:

[[0,0,0,1],[0,0,0,1]] [[1,0,0,1,0.4,0],[-1,0,0,-1,0.4,0]]
[[0,0,1,1],[0,0,1,1]] [[1,0,1,1],[1,0,1,1]] [[1,0,0,1],[1,0,0,1]]
[[1,0.4,0,1.16667,0.15,0,0.833333,0.15,0],[-1,0.4,0,-0.833333,0.15,0,-1.16667,0.15,0]]
[[0.833333,0.15,0,1,0.15,0.1,1,0.4,0],[-1.16667,0.15,0,-1,0.15,0.1,-1,0.4,0]]
[[1,0.4,0,1,0.15,0.1,1.16667,0.15,0],[-1,0.4,0,-1,0.15,0.1,-0.833333,0.15,0]]
[[1.16667,0.15,0,1,0.15,0.1,0.833333,0.15,0],[-0.833333,0.15,0,-1,0.15,0.1,-1.16667,0.15,0]]
[[1,0.4,0.75],[-1,0.4,0.75]] [[1.225,0.25,-0.375],[-0.775,0.25,-0.375]]
[[0.775,0.25,-0.375],[-1.225,0.25,-0.375]] [[1,0.7,0],[-1,0.7,0]]

If I then replace fd 20 with (5 repeats fd) 10 and hit enter, I see a
single POST request to http://127.0.0.1:65001/tgsj

with the request body

jdo=jev_tgsj_%200&jtype=enter&jmid=command&jsid=&command=(5%20repeats%20fd)%2010&jdata=&jwid=ijs

and a response body of

[[0,0,0,1],[0,0,0,1]] [[1,0.4,0,1,0.6,0],[-1,0.4,0,-1,0.6,0]]
[[0,0,1,1],[0,0,1,1]] [[1,0,1,1],[1,0,1,1]] [[1,0,0,1],[1,0,0,1]]
[[1,0.6,0,1.16667,0.35,0,0.833333,0.35,0],[-1,0.6,0,-0.833333,0.35,0,-1.16667,0.35,0]]
[[0.833333,0.35,0,1,0.35,0.1,1,0.6,0],[-1.16667,0.35,0,-1,0.35,0.1,-1,0.6,0]]
[[1,0.6,0,1,0.35,0.1,1.16667,0.35,0],[-1,0.6,0,-1,0.35,0.1,-0.833333,0.35,0]]
[[1.16667,0.35,0,1,0.35,0.1,0.833333,0.35,0],[-0.833333,0.35,0,-1,0.35,0.1,-1.16667,0.35,0]]
[[1,0.6,0.75],[-1,0.6,0.75]] [[1.225,0.45,-0.375],[-0.775,0.45,-0.375]]
[[0.775,0.45,-0.375],[-1.225,0.45,-0.375]] [[1,0.9,0],[-1,0.9,0]]

For contrast, if I go to the jijx window and enter i.3 3, I see a POST
request to http://127.0.0.1:65001/jijx with a request body of

jdo=%20%20%20i.3%203&jtype=enter&jmid=log&jsid=&jdata=&jwid=ijx

and I get a response body of

<div
class="fm">┌────────┬────────┐<br>│Position│&nbsp;50&nbsp;20&nbsp;0│<br>│&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;│_50&nbsp;20&nbsp;0│<br>│&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;│&nbsp;&nbsp;0&nbsp;&nbsp;0&nbsp;6│<br>└────────┴────────┘</div><div
class="fm">┌────────┬────────┐<br>│Position│&nbsp;50&nbsp;70&nbsp;0│<br>│&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;│_50&nbsp;70&nbsp;0│<br>│&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;│&nbsp;&nbsp;0&nbsp;&nbsp;0&nbsp;6│<br>└────────┴────────┘</div><div
class="log">&nbsp;&nbsp;&nbsp;i.3&nbsp;3</div><div
class="fm">0&nbsp;1&nbsp;2<br>3&nbsp;4&nbsp;5<br>6&nbsp;7&nbsp;8</div><div
id="prompt" class="log">&nbsp;&nbsp;&nbsp;</div>

Note that this contains also the responses which were generated in response
to my two earlier attempts with the turtle. It looks like this:

┌────────┬────────┐
│Position│ 50 20 0│
│        │_50 20 0│
│        │  0  0 6│
└────────┴────────┘
┌────────┬────────┐
│Position│ 50 70 0│
│        │_50 70 0│
│        │  0  0 6│
└────────┴────────┘
   i.3 3
0 1 2
3 4 5
6 7 8

If I repeat the command, the request looks the same but this time the
response body is just:

<div class="log">&nbsp;&nbsp;&nbsp;i.3&nbsp;3</div><div
class="fm">0&nbsp;1&nbsp;2<br>3&nbsp;4&nbsp;5<br>6&nbsp;7&nbsp;8</div><div
id="prompt" class="log">&nbsp;&nbsp;&nbsp;</div>

In other words, just the part for the i.3 3 result and no stacked result
from previous commands.

This is probably more detail than you really need, but maybe the
perspective on the low-level mechanics of the browser requests and
responses will help you reason about what you are trying to work on.

(I am starting to suspect that you want some kind of animation to happen,
which is probably easiest done in javascript? That's not all that hard to
do, once someone shows you the basic pattern. Or, patterns, actually, since
there's a variety of ways of animating, depending on how you want the
result to feel and look.)

Thanks,

-- 
Raul


On Sat, Mar 22, 2014 at 3:39 PM, Brian Schott <[email protected]>wrote:

> I have found the problem, but cannot fix it in console.ijs because my mind
> is frozen.
>
> It can be fixed manually by entering the following in the jijx window. At
> one time I new how to add this to the console.ijs, but not now.
>
> load'~Projects/tgsjhs/tgsjhs.ijs'
>
> I apologize. I have been using console.html, not console.ijs .
>
>
>
>
> On Sat, Mar 22, 2014 at 2:51 PM, Raul Miller <[email protected]>
> wrote:
>
> > $ ls j64-801-user/projects/tgsjhs/
> > console.ijs  tgsjhs.ijs  tgsjhsutil.ijs
> >
> > Here's what I did to reproduce this problem:
> >
> > (1) stop and restart jhs (so I have a clean session).
> > (2) reload my ijx window
> > (3) in my now clean ijx window, enter the command:
> >    load'~Projects/tgsjhs/console.ijs'
> > (4) reload my console window.
> > (5) click on fd 20
> > (6) hit enter
> >
> > At this point, I get a popup about an error, and if I click OK, I get
> sent
> > to http://127.0.0.1:65001/tgsj and the window displays:
> >
> > get/post request failed
> > response code 409
> > application did not produce result
> > try browsing to url again
> > additional info in jijx
> >
> > Also, if I hit enter in my ijx window I get an error display mentions the
> > value error on State while executing this line: y=.0 Eye}    yxs&State y
> >
> > Looking back at your code:
> >
> > $ fgrep -n 'yxs&State y' j64-801-user/projects/tgsjhs/* | fgrep 'Eye}'
> > j64-801-user/projects/tgsjhs/tgsjhsutil.ijs:337:    y =. 0 Eye}yxs&State
> y
> > j64-801-user/projects/tgsjhs/tgsjhsutil.ijs:493:    y =. 0 Eye}yxs&State
> y
> > j64-801-user/projects/tgsjhs/tgsjhsutil.ijs:944:  y =. (,Bkgrd)
> > Eye}yxs&State y
> >
> > So it's apparently hitting an error on line 337 or 493 of tgsjhsutil.ijs
> >
> > Does this help?
> >
> > Thanks,
> >
> > --
> > Raul
> >
> >
> >
> > On Sat, Mar 22, 2014 at 2:23 PM, Brian Schott <[email protected]
> > >wrote:
> >
> > > Raul,
> > >
> > > I just diff'ed the wjiki files with the one I am using and do not get
> > such
> > > an error.
> > > Did you download both tgsjhs.ijs and tgsjhsutil.ijs? They are both
> > required
> > > and must be in the same projects directory. I suspect you did not
> > download
> > > the tgsjhsutil.ijs file.
> > >
> > > I am using both Safari and Chrome successfully.
> > >
> > >
> > > On Sat, Mar 22, 2014 at 1:50 PM, Raul Miller <[email protected]>
> > > wrote:
> > >
> > > > I have your code up and running, and am able to change the background
> > > > color.
> > > >
> > > > I get an error, though, when I select the text field containing 'fd
> 20'
> > > and
> > > > hit enter. That error looks like this in the ijx window:
> > > >
> > > > *** event handler error
> > > > ev_command_enter 0
> > > > |value error: State
> > > > |   y=.0 Eye}    yxs&State y
> > > > jdo     jev_tgsj_ 0
> > > > jtype   enter
> > > > jmid    command
> > > > jsid
> > > > command fd 20
> > > > jdata
> > > > jwid
> > > > ┌───────┬───────────┐
> > > > │jdo    │jev_tgsj_ 0│
> > > > ├───────┼───────────┤
> > > > │jtype  │enter      │
> > > > ├───────┼───────────┤
> > > > │jmid   │command    │
> > > > ├───────┼───────────┤
> > > > │jsid   │           │
> > > > ├───────┼───────────┤
> > > > │command│fd 20      │
> > > > ├───────┼───────────┤
> > > > │jdata  │           │
> > > > ├───────┼───────────┤
> > > > │jwid   │           │
> > > > └───────┴───────────┘
> > > > *** response not sent for tgsj
> > > > *** html409 Conflict
> > > >
> > > > It looks like I need something which defines 'State', and I might
> also
> > > need
> > > > more step-by-step instructions, so I can get to the point where `(5
> > > repeats
> > > > fd) 10` is doing part of what you want it to be doing.
> > > >
> > > > (It should also be possible to define an "eye" turtle, I imagine?)
> > > >
> > > > Thanks,
> > > >
> > > > --
> > > > Raul
> > > >
> > > >
> > > > --
> > > (B=)
> > > ----------------------------------------------------------------------
> > > For information about J forums see http://www.jsoftware.com/forums.htm
> > >
> > ----------------------------------------------------------------------
> > For information about J forums see http://www.jsoftware.com/forums.htm
> >
>
>
>
> --
> (B=) <-----my sig
> Brian Schott
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to