Template talk:2-ary truth table
Appearance
(Redirected from Template talk:2-ary truth table/sandbox)
This template was considered for deletion on 1 March 2024. The result of the discussion was "keep". |
Extended
[edit]Watchduck, I have extended this template to cover the other three cases linked in the documentation (see the sandbox). what do you think? Frietjes (talk) 22:24, 8 March 2024 (UTC)
- I like to keep templates simple. This programming language must be among the worst in the world, so anything nontrivial written in it becomes almost unreadable. Apart from that, your extension makes sense. But the user must be able to choose, which borders will be thick. --Watchduck (quack) 10:02, 9 March 2024 (UTC)
- okay, I have updated the template to use the extended syntax. Frietjes (talk) 15:20, 11 March 2024 (UTC)
- @Frietjes: Could you add the possibility to choose the left border style? --Watchduck (quack) 19:37, 11 March 2024 (UTC)
- Watchduck, sure, this is for every column? so,
|split1=y
or|border1=thick
or what is the input syntax? Frietjes (talk) 20:19, 11 March 2024 (UTC)
- Watchduck, sure, this is for every column? so,
- @Frietjes: Could you add the possibility to choose the left border style? --Watchduck (quack) 19:37, 11 March 2024 (UTC)
- okay, I have updated the template to use the extended syntax. Frietjes (talk) 15:20, 11 March 2024 (UTC)
There is a choice for every column except the first. I think a reasonable syntax would be the following:
{{2-ary truth table
|1|0|0|0|this
|
|1|0|0|0|that
|thick
|0|1|1|1|other
}}
--Watchduck (quack) 20:38, 11 March 2024 (UTC)
- Watchduck, should these default to "thin" "thick" "thick" "thin"? if we want defaults, then named parameters are easier since omitting values gives you the default. if there are no defaults, then the positional parameters work fine. I put something in the sandbox that uses
|thick1=y
..., but that can be easily changed. Frietjes (talk) 21:15, 11 March 2024 (UTC)- The default is thin. It would be preferable to use no argument instead of "thin". Maybe with an if-not? --Watchduck (quack) 09:48, 12 March 2024 (UTC)
- Watchduck, sure, that works. I had originally thought you mean every border, but I think you just mean the two extended borders. I have updated the code in the sandbox, and you can see the extended syntax examples on that page. Frietjes (talk) 15:23, 12 March 2024 (UTC)
- That works as expected, thanks. I realized, that the number of non-argument columns is limited to three. That is enough for the current use, but I suggest increasing the maximum to six, just to be on the safe side. Watchduck (quack) 17:11, 12 March 2024 (UTC)
- Watchduck, I made a lua version in Module:2-ary truth table which allows for an arbitrary number of columns. you can see the result in the sandbox. the other advantage being that lua is more readable than other parser input (or at least I think so). Frietjes (talk) 16:11, 13 March 2024 (UTC)
- Thanks. I have replaced the three single-use templates now. I trust, that you will include the module into the template documentation. Greetings, Watchduck (quack) 18:19, 13 March 2024 (UTC)
- great, now updated. Frietjes (talk) 16:05, 14 March 2024 (UTC)
- Thanks. I have replaced the three single-use templates now. I trust, that you will include the module into the template documentation. Greetings, Watchduck (quack) 18:19, 13 March 2024 (UTC)
- Watchduck, I made a lua version in Module:2-ary truth table which allows for an arbitrary number of columns. you can see the result in the sandbox. the other advantage being that lua is more readable than other parser input (or at least I think so). Frietjes (talk) 16:11, 13 March 2024 (UTC)
- That works as expected, thanks. I realized, that the number of non-argument columns is limited to three. That is enough for the current use, but I suggest increasing the maximum to six, just to be on the safe side. Watchduck (quack) 17:11, 12 March 2024 (UTC)
- Watchduck, sure, that works. I had originally thought you mean every border, but I think you just mean the two extended borders. I have updated the code in the sandbox, and you can see the extended syntax examples on that page. Frietjes (talk) 15:23, 12 March 2024 (UTC)
- The default is thin. It would be preferable to use no argument instead of "thin". Maybe with an if-not? --Watchduck (quack) 09:48, 12 March 2024 (UTC)