Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

for me ," is bugged

71 views
Skip to first unread message

Rosario19

unread,
Nov 19, 2023, 1:18:37 AM11/19/23
to
Don't you think I don't like APL, or I think I have right...
for me ," is bugged

({leftshoe},1),{dieresis}1 2
+2------------+
Ś+2---+ +2---+Ś
ŚŚ 1 1Ś Ś 1 2ŚŚ
Ś+~---+ +~---+2
+?------------+
1,{dieresis}1 2
+2------------+
Ś+2---+ +2---+Ś
ŚŚ 1 1Ś Ś 1 2ŚŚ
Ś+~---+ +~---+2
+?------------+
({leftshoe},1)
+----+
Ś+1-+Ś
ŚŚ 1ŚŚ
Ś+~-+2
+?---+
1
1
~

Why the same result when
This object
({leftshoe},1)
has different type of this
1
?

The same
,{dieresis} (1 1)(2 2)(3 3)
+3-------------------+
Ś+2---+ +2---+ +2---+Ś
ŚŚ 1 1Ś Ś 2 2Ś Ś 3 3ŚŚ
Ś+~---+ +~---+ +~---+2
+?-------------------+
,{dieresis} 1 2 3 4
+4------------------+
Ś+1-+ +1-+ +1-+ +1-+Ś
ŚŚ 1Ś Ś 2Ś Ś 3Ś Ś 4ŚŚ
Ś+~-+ +~-+ +~-+ +~-+2
+?------------------+

why in this last, each element is boxed, but in the other above, not?

One good question for resolve would be to find the recursive answer in
APL of this codegolf question


https://codegolf.stackexchange.com/questions/34491/list-the-combinations-of-elements-in-a-set


I think for base of induction one function q solution has to return as
1 q 1 2 3 4
+4------------------+
Ś+1-+ +1-+ +1-+ +1-+Ś
ŚŚ 1Ś Ś 2Ś Ś 3Ś Ś 4ŚŚ
Ś+~-+ +~-+ +~-+ +~-+2
+?------------------+
and as
4 q 1 2 3 4
+----------+
Ś+4-------+Ś
ŚŚ 1 2 3 4ŚŚ
Ś+~-------+2
+?---------+

so all solution make wrong the base of induction for me are wrong, in
count the codegolf answers in the site.

This hould be one solution

q{leftarrow}{leftbrace}{alpha}{rightcaretunderbar}{notequalunderbar}w{leftarrow}{omega}:{leftshoe}{omega}{diamond}{alpha}{leftcaretunderbar}1:{leftbrace}1{rightcaretunderbar}{equalunderbar}w:,{dieresis}w{diamond}{leftshoe}{dieresis}w{rightbrace}{diamond}({alpha}{del}a),({leftbrace}w[1],{omega}{rightbrace}{dieresis}({alpha}-1){del}a{leftarrow}1{downarrow}{omega}){rightbrace}

Rosario19

unread,
Nov 19, 2023, 6:25:18 AM11/19/23
to
On Sun, 19 Nov 2023 07:17:48 +0100, Rosario19 <R...@invalid.invalid>
wrote:
this seems shorter

q{leftarrow}{leftbrace}{alpha}{rightcaretunderbar}{notequalunderbar}w{leftarrow}{omega}:{leftshoe}{omega}{diamond}{alpha}{leftcaretunderbar}1:{leftbrace}1{rightcaretunderbar}{equalunderbar}w:,{dieresis}w{diamond}{leftshoe}{dieresis}w{rightbrace}{diamond}({alpha}{del}a),w[1]{jot},{dieresis}({alpha}-1){del}a{leftarrow}1{downarrow}{omega}{rightbrace}

it seems
{jot},{dieresis}
can be ok
because the answer of these below are differents
({leftshoe},1){jot},{dieresis}1 2
+2----------------+
Ś+2-----+ +2-----+Ś
ŚŚ+1-+ Ś Ś+1-+ ŚŚ
ŚŚŚ 1Ś 1Ś ŚŚ 1Ś 2ŚŚ
ŚŚ+~-+ ~2 Ś+~-+ ~2Ś
Ś+?-----+ +?-----+3
+?----------------+
1{jot},{dieresis}1 2
+2------------+
Ś+2---+ +2---+Ś
ŚŚ 1 1Ś Ś 1 2ŚŚ
Ś+~---+ +~---+2
+?------------+

so it seems ok for the q function
Someone can make shorter this?

{leftbrace}1{rightcaretunderbar}{equalunderbar}w:,{dieresis}w{diamond}{leftshoe}{dieresis}w{rightbrace}

But increase the numeber of fuction for me is not ok

Rosario19

unread,
Nov 20, 2023, 7:51:34 AM11/20/23
to
On Sun, 19 Nov 2023 12:24:30 +0100, Rosario19 <R...@invalid.invalid>
wrote:
Above it seems ,{dieresis}{leftshoe}{dieresis}
make all the input output as i searched, and so we have the APL 46
char solution

q{leftarrow}{leftbrace}{alpha}{rightcaretunderbar}{notequalunderbar}w{leftarrow}{omega}:{leftshoe}{omega}{diamond}{alpha}{leftcaretunderbar}1:,{dieresis}{leftshoe}{dieresis}{omega}{diamond}({alpha}{del}a),w[1]{jot},{dieresis}({alpha}-1){del}a{leftarrow}1{downarrow}{omega}{rightbrace}


,{dieresis}{leftshoe}{dieresis}
it seems apply to
(1 1)(2 2)(3 3)
or to
1 2 3 4
make box elements of array elements
in both cases

Bob Smith

unread,
Nov 20, 2023, 11:32:07 AM11/20/23
to
On 11/19/2023 1:17 AM, Rosario19 wrote:
> Don't you think I don't like APL, or I think I have right...
> for me ," is bugged
>
> ({leftshoe},1),{dieresis}1 2
> +2------------+
> ¦+2---+ +2---+¦
> ¦¦ 1 1¦ ¦ 1 2¦¦
> ¦+~---+ +~---+2
> +?------------+
> 1,{dieresis}1 2
> +2------------+
> ¦+2---+ +2---+¦
> ¦¦ 1 1¦ ¦ 1 2¦¦
> ¦+~---+ +~---+2
> +?------------+
> ({leftshoe},1)
> +----+
> ¦+1-+¦
> ¦¦ 1¦¦
> ¦+~-+2
> +?---+
> 1
> 1
> ~
>
> Why the same result when
> This object
> ({leftshoe},1)
> has different type of this
> 1
> ?

The expression

(⊂,1),¨1 2 ←→ ((,1),1) ((,1),2), and
1 ,¨1 2 ←→ ( 1 ,1) ( 1 ,2)

catenating a one-element vector to a scalar is the same as catenating a
scalar to a scalar, so the results are the same.


> The same
> ,{dieresis} (1 1)(2 2)(3 3)
> +3-------------------+
> ¦+2---+ +2---+ +2---+¦
> ¦¦ 1 1¦ ¦ 2 2¦ ¦ 3 3¦¦
> ¦+~---+ +~---+ +~---+2
> +?-------------------+
> ,{dieresis} 1 2 3 4
> +4------------------+
> ¦+1-+ +1-+ +1-+ +1-+¦
> ¦¦ 1¦ ¦ 2¦ ¦ 3¦ ¦ 4¦¦
> ¦+~-+ +~-+ +~-+ +~-+2
> +?------------------+
>
> why in this last, each element is boxed, but in the other above, not?
>
> One good question for resolve would be to find the recursive answer in
> APL of this codegolf question
>
>
> https://codegolf.stackexchange.com/questions/34491/list-the-combinations-of-elements-in-a-set

Because NARS2000 has a Combinatorial Operator, a short answer is

set←1 7 4 ⋄ inp←2
set[010 1‼inp,⍴set]
1 7
7 4
1 4

or if you want the answer in lexicographic order

set[010 2‼inp,⍴set]
1 7
1 4
7 4

>
> I think for base of induction one function q solution has to return as
> 1 q 1 2 3 4
> +4------------------+
> ¦+1-+ +1-+ +1-+ +1-+¦
> ¦¦ 1¦ ¦ 2¦ ¦ 3¦ ¦ 4¦¦
> ¦+~-+ +~-+ +~-+ +~-+2
> +?------------------+
> and as
> 4 q 1 2 3 4
> +----------+
> ¦+4-------+¦
> ¦¦ 1 2 3 4¦¦
> ¦+~-------+2
> +?---------+
>
> so all solution make wrong the base of induction for me are wrong, in
> count the codegolf answers in the site.
>
> This hould be one solution
>
> q{leftarrow}{leftbrace}{alpha}{rightcaretunderbar}{notequalunderbar}w{leftarrow}{omega}:{leftshoe}{omega}{diamond}{alpha}{leftcaretunderbar}1:{leftbrace}1{rightcaretunderbar}{equalunderbar}w:,{dieresis}w{diamond}{leftshoe}{dieresis}w{rightbrace}{diamond}({alpha}{del}a),({leftbrace}w[1],{omega}{rightbrace}{dieresis}({alpha}-1){del}a{leftarrow}1{downarrow}{omega}){rightbrace}
>

Good job! That works.

--
_________________________________________
Bob Smith -- bsm...@sudleydeplacespam.com
http://www.sudleyplace.com - http://www.nars2000.org

To reply to me directly, delete "despam".

Rosario19

unread,
Nov 24, 2023, 5:50:30 AM11/24/23
to
On Mon, 20 Nov 2023 11:31:58 -0500, Bob Smith wrote:

>On 11/19/2023 1:17 AM, Rosario19 wrote:
>> Don't you think I don't like APL, or I think I have right...
>> for me ," is bugged
>>
>> ({leftshoe},1),{dieresis}1 2
>> +2------------+
>> Ś+2---+ +2---+Ś
>> ŚŚ 1 1Ś Ś 1 2ŚŚ
>> Ś+~---+ +~---+2
>> +?------------+
>> 1,{dieresis}1 2
>> +2------------+
>> Ś+2---+ +2---+Ś
>> ŚŚ 1 1Ś Ś 1 2ŚŚ
>> Ś+~---+ +~---+2
>> +?------------+
>> ({leftshoe},1)
>> +----+
>> Ś+1-+Ś
>> ŚŚ 1ŚŚ
>> Ś+~-+2
>> +?---+
>> 1
>> 1
>> ~
>>
>> Why the same result when
>> This object
>> ({leftshoe},1)
>> has different type of this
>> 1
>> ?
>
>The expression
>
>(?,1),¨1 2 ?? ((,1),1) ((,1),2), and
> 1 ,¨1 2 ?? ( 1 ,1) ( 1 ,2)
>
>catenating a one-element vector to a scalar is the same as catenating a
>scalar to a scalar, so the results are the same.
>
>
>> The same
>> ,{dieresis} (1 1)(2 2)(3 3)
>> +3-------------------+
>> Ś+2---+ +2---+ +2---+Ś
>> ŚŚ 1 1Ś Ś 2 2Ś Ś 3 3ŚŚ
>> Ś+~---+ +~---+ +~---+2
>> +?-------------------+
>> ,{dieresis} 1 2 3 4
>> +4------------------+
>> Ś+1-+ +1-+ +1-+ +1-+Ś
>> ŚŚ 1Ś Ś 2Ś Ś 3Ś Ś 4ŚŚ
>> Ś+~-+ +~-+ +~-+ +~-+2
>> +?------------------+
>>
>> why in this last, each element is boxed, but in the other above, not?
>>
>> One good question for resolve would be to find the recursive answer in
>> APL of this codegolf question
>>
>>
>> https://codegolf.stackexchange.com/questions/34491/list-the-combinations-of-elements-in-a-set
>
>Because NARS2000 has a Combinatorial Operator, a short answer is
>
> set?1 7 4 ? inp?2
> set[010 1?inp,?set]
>1 7
>7 4
>1 4
>
>or if you want the answer in lexicographic order
>
> set[010 2?inp,?set]
>1 7
>1 4
>7 4

I find that

{leftbrace}{omega}[010 2{\x203C}{alpha},{rho}{omega}]{rightbrace}

solve the problem if {alpha}>1.

this below would solve the problem for each {alpha} in Ints

{leftbrace}{alpha}{leftcaretunderbar}1:{commabar}{omega}{diamond}{omega}[010
2{\x203C}{alpha},{rho}{omega}]{rightbrace}

but the autor of the question said is not possible to use combinations
functions and should work for each {alpha} in Ints
so this is my little solution

{leftbrace}{alpha}{leftcaretunderbar}1:{commabar}{omega}{diamond}{omega}[{rightshoe}{uparrow},/b{leftshoe}{dieresistilde}{upcaret}/{dieresis}2</{dieresis}b{leftarrow},{iota}{alpha}{rho}{notequalunderbar}{omega}]{rightbrace}

34 chars solution.
I dont know if {iota}{alpha}{rho}{notequalunderbar}{omega} is allowed
because it seems generate each {alpha} index in
1..{notequalunderbar}{omega}
1 f 5 6 7 8
+1-+
4 5Ś
Ś 6Ś
Ś 7Ś
Ś 8Ś
+~-+
3 f 5 6 7 8
+3-----+
4 5 6 7Ś
Ś 5 6 8Ś
Ś 5 7 8Ś
Ś 6 7 8Ś
+~-----+
4 f 5 6 7 8
+4-------+
1 5 6 7 8Ś
+~-------+
5 f 5 6 7 8
+5-+
0 0Ś
+~-+
6 f 5 6 7 8
+6-+
0 0Ś
+~-+
0 f 5 6 7 8
+1-+
4 5Ś
Ś 6Ś
Ś 7Ś
Ś 8Ś
+~-+

>> I think for base of induction one function q solution has to return as
>> 1 q 1 2 3 4
>> +4------------------+
>> Ś+1-+ +1-+ +1-+ +1-+Ś
>> ŚŚ 1Ś Ś 2Ś Ś 3Ś Ś 4ŚŚ
>> Ś+~-+ +~-+ +~-+ +~-+2
>> +?------------------+
>> and as
>> 4 q 1 2 3 4
>> +----------+
>> Ś+4-------+Ś
>> ŚŚ 1 2 3 4ŚŚ
>> Ś+~-------+2
0 new messages