A-M baby
This commit is contained in:
parent
764da6cbbb
commit
db842d013d
19005 changed files with 197040 additions and 7 deletions
4
Task/Generic-swap/J/generic-swap-1.j
Normal file
4
Task/Generic-swap/J/generic-swap-1.j
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
(<2 4) C. 2 3 5 7 11 13 17 19
|
||||
2 3 11 7 5 13 17 19
|
||||
(<0 3)&C.&.;:'Roses are red. Violets are blue.'
|
||||
Violets are red. Roses are blue.
|
||||
4
Task/Generic-swap/J/generic-swap-2.j
Normal file
4
Task/Generic-swap/J/generic-swap-2.j
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
|.2 3
|
||||
3 2
|
||||
|.&.;:'one two'
|
||||
two one
|
||||
6
Task/Generic-swap/J/generic-swap-3.j
Normal file
6
Task/Generic-swap/J/generic-swap-3.j
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
destructiveSwap=:4 :0
|
||||
t=. do y
|
||||
(y)=: do x
|
||||
(x)=: t
|
||||
i.0 0 NB. result is meaningless
|
||||
)
|
||||
7
Task/Generic-swap/J/generic-swap-4.j
Normal file
7
Task/Generic-swap/J/generic-swap-4.j
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
V1=: 'cat'
|
||||
V2=: 7
|
||||
'V1' destructiveSwap 'V2'
|
||||
V1
|
||||
7
|
||||
V2
|
||||
cat
|
||||
Loading…
Add table
Add a link
Reference in a new issue