some ncurses functions are implemented as macro. C compliers can expand
them into real function call during compilation but J can't. I'll look if
this is the reason why window functions failed.

On Fri, May 18, 2018, 6:48 AM james faure <[email protected]> wrote:

> Hello,
> Just wrote a classic snake game in ncurses, however I came across
> something inexplicable - The code below hangs for a sec, then exits.
> The problem is presumably with the mvwaddch function. mvwaddstr also fails.
> I was able to circumvent this by simply using the default screen returned
> by initscr, but that isn't ideal!
>
> require 'api/ncurses'
> cocurrent 'ncurses'
>
> init =. monad define
>   stdscr_ncurses_ =: initscr''
>   w =. newwin 20;60;0;0
>
>   NB. Works fine:
>   NB. getch'' [ mvaddch 10 ; 10 ; '*'
>
>   NB. hangs for a second then exits, why ?
>   mvwaddch w ; 10 ; 10 ; '*'
>   wgetch < w
> )
>
> init''
>
> Thanks for any help,
> J4
>
> ----------------------------------------------------------------------
> 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