Re: [NTG-context] Sudoku module

2022-07-18 Thread Otared Kavian via ntg-context
Hi Wolfgang,

Thank you for your reply and the explanations about the function « 
interfaces.implement ».

Regarding the examples given by Jairo, you are correct: those examples can be 
typeset with LMTX. I did a mistake when in TeXShop I saved the file « 
t-sudoku.mkvi » under the name « t-sudoku.tex »: indeed this creates an error 
in LMTX as well in earlier versions of ConTeXt… (maybe a colateral consequence 
of the heat wave in France :-)

I apologize to you and Jairo for having caused any trouble.

Best regards: Otared

> On 18 Jul 2022, at 22:10, Wolfgang Schuster via ntg-context 
>  wrote:
> 
> Otared Kavian via ntg-context schrieb am 18.07.2022 um 18:53:
>> Hi Wolfgang,
>> 
>> Thank you for your attention and the explanation regarding the « hash option 
>> » and why the sudoku module written by Jairo does not work. However I was 
>> reporting the issue when I tried to typeset the example file with LMTX 
>> (version 2022.07.06 21:42).
> 
> I have no problems with the examples at the end of the module and LMTX, only 
> when I use LuaTeX a error appears.
> 
>> As a matter of fact I am far from understanding what the « arguments = { « 
>> hash » } » is supposed to do in interfaces.implement in the code you sent…
> 
> The 'interfaces.implement' functions creates the command \test and 
> 'arguments={"hash"}' creates the argument which accepts key-val lists 
> ([text=Hello]).
> 
> Wolfgang
> 
> ___
> If your question is of interest to others as well, please add an entry to the 
> Wiki!
> 
> maillist : ntg-context@ntg.nl / 
> https://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : https://contextgarden.net
> ___

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] Sudoku module

2022-07-18 Thread Wolfgang Schuster via ntg-context

Otared Kavian via ntg-context schrieb am 18.07.2022 um 18:53:

Hi Wolfgang,

Thank you for your attention and the explanation regarding the « hash option » 
and why the sudoku module written by Jairo does not work. However I was 
reporting the issue when I tried to typeset the example file with LMTX (version 
2022.07.06 21:42).


I have no problems with the examples at the end of the module and LMTX, 
only when I use LuaTeX a error appears.



As a matter of fact I am far from understanding what the « arguments = { « hash 
» } » is supposed to do in interfaces.implement in the code you sent…


The 'interfaces.implement' functions creates the command \test and 
'arguments={"hash"}' creates the argument which accepts key-val lists 
([text=Hello]).


Wolfgang

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] Sudoku module

2022-07-18 Thread Otared Kavian via ntg-context
Hi Wolfgang,

Thank you for your attention and the explanation regarding the « hash option » 
and why the sudoku module written by Jairo does not work. However I was 
reporting the issue when I tried to typeset the example file with LMTX (version 
2022.07.06 21:42). 
As a matter of fact I am far from understanding what the « arguments = { « hash 
» } » is supposed to do in interfaces.implement in the code you sent…

Best regards: Otared

> On 18 Jul 2022, at 17:39, Wolfgang Schuster via ntg-context 
>  wrote:
> 
> Otared Kavian via ntg-context schrieb am 18.07.2022 um 17:00:
>> Hi Jairo,
>> 
>> You sent a message last year about your Sudoku module, and today, out of 
>> curiosity, I wanted to test it. Unfortunately it stops with an error message 
>> at line 76 of the file t-sudoku.mkiv, where you have:
>> 
>> \def\sudokufunction_direct[#name][#parameters]#content
>> 
>> I would appreciate if you could tell me whether you have a working version 
>> of you module, or what one has to change in order to typeset your examples.
> 
> The error is unrelated to the sudoku module and when you use LMTX the error 
> disappears.
> 
> The real problem can be seen in the following minimal example and is related 
> to the "hash" option for the argument key.
> 
>  begin example
> \starttext
> 
> \startluacode
> interfaces.implement {
> name  = "test",
> public= true,
> arguments = { "hash" },
> actions   = function(t)
> print(table.serialize(t))
> end,
> }
> \stopluacode
> 
> \test[text=Hello]
> 
> \stoptext
>  end example
> 
> Wolfgang
> 
> ___
> If your question is of interest to others as well, please add an entry to the 
> Wiki!
> 
> maillist : ntg-context@ntg.nl / 
> https://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki : https://contextgarden.net
> ___

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] Sudoku module

2022-07-18 Thread Jairo A. del Rio via ntg-context
Hi. Sorry. I didn't see your message and I had forgotten the very existence
of the module. I'll check it later (final exam weeks for me) so that it
works with MkIV and LMTX properly again. By the way, thanks for the
interest.

Best regards

Jairo

El lun., 18 de jul. de 2022 10:00 a. m., Otared Kavian 
escribió:

> Hi Jairo,
>
> You sent a message last year about your Sudoku module, and today, out of
> curiosity, I wanted to test it. Unfortunately it stops with an error
> message at line 76 of the file t-sudoku.mkiv, where you have:
>
> \def\sudokufunction_direct[#name][#parameters]#content
>
> I would appreciate if you could tell me whether you have a working version
> of you module, or what one has to change in order to typeset your examples.
>
> Best regards: Otared
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


Re: [NTG-context] Sudoku module

2022-07-18 Thread Wolfgang Schuster via ntg-context

Otared Kavian via ntg-context schrieb am 18.07.2022 um 17:00:

Hi Jairo,

You sent a message last year about your Sudoku module, and today, out of 
curiosity, I wanted to test it. Unfortunately it stops with an error message at 
line 76 of the file t-sudoku.mkiv, where you have:

\def\sudokufunction_direct[#name][#parameters]#content

I would appreciate if you could tell me whether you have a working version of 
you module, or what one has to change in order to typeset your examples.


The error is unrelated to the sudoku module and when you use LMTX the 
error disappears.


The real problem can be seen in the following minimal example and is 
related to the "hash" option for the argument key.


 begin example
\starttext

\startluacode
interfaces.implement {
    name  = "test",
    public    = true,
    arguments = { "hash" },
    actions   = function(t)
    print(table.serialize(t))
    end,
}
\stopluacode

\test[text=Hello]

\stoptext
 end example

Wolfgang

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


[NTG-context] Sudoku module

2022-07-18 Thread Otared Kavian via ntg-context
Hi Jairo,

You sent a message last year about your Sudoku module, and today, out of 
curiosity, I wanted to test it. Unfortunately it stops with an error message at 
line 76 of the file t-sudoku.mkiv, where you have:

\def\sudokufunction_direct[#name][#parameters]#content

I would appreciate if you could tell me whether you have a working version of 
you module, or what one has to change in order to typeset your examples.

Best regards: Otared
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / https://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : https://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : https://contextgarden.net
___


[NTG-context] Sudoku module

2021-04-12 Thread Jairo A. del Rio
Hi, list! I've just finished a minimal module for sudoku puzzles based on
Peter Norvig's algorithm. The module and examples are in the link below:

https://github.com/JairoAdelRio/context-sudoku

My port is a sorta literal translation of Python's version, so improvements
are to be done. As always, I'm having trouble passing color data from TeX
to Lua so that sudokus have more customizable aesthetics. I'll gladly
accept any feedback and recommendations before I submit the module to the
Garden. Thank you very much. Stay safe.

Jairo
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___