Activity for torresâ€
Type | On... | Excerpt | Status | Date |
---|---|---|---|---|
Answer | — |
A: Digit antitranspose J, 8 char Solution: ``` |:|.|."1 ``` Test example: ``` (i. 3 3) 0 1 2 3 4 5 6 7 8 |:|.|."1 (i. 3 3) 8 5 2 7 4 1 6 3 0 (i. 4 2) 0 1 2 3 4 5 6 7 |:|.|."1 (i. 4 2) 7 5 3 1 6 4 2 0 ``` How it works: ``` |."1 reverses the order of each row of the array on it... (more) |
— | over 1 year ago |
Answer | — |
A: Lowercase, but not just the letters J, 39 char Solution: ``` (a.{ a.((6|.8{.1)+.(8&{.))&.#:"0@i.]) ``` Test example: ``` (a.{ a.((6|.8{.1)+.(8&{.))&.#:"0@i.]) '([({Enclosed})])A@B.c' ({({enclosed})})a`b.c ``` How it works: ``` 6|.8{.1 creates binary 0 0 1 0 0 0 0 0 8&{. ensures that binari from ascii is 8 bit (6|... (more) |
— | over 1 year ago |
Answer | — |
A: Mediocre pop count J, 46 char Solution: ``` (]#[:([:./(./):"0 1])([:+/"1@#:a.&i.)) ``` Test example: ``` (]#[:([:./(./):"0 1])([:+/"1@#:a.&i.)) 'oAPwSoeHcoDretMBBoesoBsagHDoew' SecretMessage ``` How it works: ``` a.&i. converts from text to ascii number #: converts from ascii number to binary +/"... (more) |
— | over 1 year ago |
Answer | — |
A: Just the vowels please J, 19 char Solution: ``` (e.&'aeiouAEIOU'#]) ``` Test examples: ``` (e.&'aeiouAEIOU'#]) '' (e.&'aeiouAEIOU'#]) 'Rhythm' (e.&'aeiouAEIOU'#]) 'a' a (e.&'aeiouAEIOU'#]) 'emu' eu (e.&'aeiouAEIOU'#]) 'aLtErNaTe' aEae ``` How it works: ``` ] is whatever value is o... (more) |
— | over 1 year ago |
Answer | — |
A: Cumulative Counts J, 24 char ```([: +/ [: ( +/\ )"1 . ="0 1 ])``` Sample Runs ``` ([:+/[:(+/\)"1.="0 1]) 1 1 2 2 2 1 1 1 3 3 1 2 1 2 3 3 4 5 1 2 ([:+/[:(+/\)"1.="0 1]) 3 7 5 4 9 2 3 2 6 6 1 1 1 1 1 1 2 2 1 2 ``` (more) |
— | almost 2 years ago |
Answer | — |
A: Find the IP address class J, 46 char ``` 'ABCDE'{:".{.}.;.1'.', ``` Sample runs ``` 'ABCDE'{:".{.}.;.1'.', '127.255.255.255' A 'ABCDE'{:".{.}.;.1'.', '191.255.255.255' B 'ABCDE'{:".{.}.;.1'.', '223.255.255.255' C 'ABCDE'{:".{.}.;.1'.', '239.255.255.255' D 'ABCDE'{:".{.}.;.1'.', '255.255.255... (more) |
— | almost 2 years ago |
Answer | — |
A: "Hello, {name}!" J, 29 char ``` ('!','Hello, ',1!:1<1)1!:2<4 ``` Sample run ``` ('!','Hello, ',1!:1<1)1!:2<4 torres Hello, torres! ``` (more) |
— | almost 2 years ago |
Answer | — |
A: Golf a FRACTRAN interpreter J, 36 char ``` {.2{(}.,(=<.)@v{.@#v=.}.{.)^:(<) ``` Sample runs: ``` {.2{(}.,(=<.)@v{.@#v=.}.{.)^:(<) 1096135733 78r55 5r3 1r5 11r2 5r7 328842888196762472689573703 {.2{(}.,(=<.)@v{.@#v=.}.{.)^:(<) 1296 3r2 6561 {.2{(}.,(=<.)@v{.@#v=.}.{.)^:(<) 72 455r33 11r13 1r11 3r7 11r2 1r... (more) |
— | almost 2 years ago |
Answer | — |
A: A number adder, not a death adder J, 7 char ``` '+/',": ``` Sample runs: '+/',": 6 +/6 +/6 5 11 '+/',": 55 +/55 +/55 45 100 (more) |
— | almost 2 years ago |
Answer | — |
A: Are All Elements Equal? J, 5 char ``` 2>#. ``` How it works: '.' produces list of unique elements of list on its right '#' counts how many elements in the list on its right '2>' tests if number on its right only has one unique element Sample runs: 2>#. 3 3 3 4 0 2>#. 3 3 3 3 1 (more) |
— | almost 2 years ago |
Answer | — |
A: Solve Goldbach's Conjecture J, 46 char ``` ({.(+/m)#a),{:(+/"1 m=:x=+/a)#a=:p:i.1 p:x=: ``` Sample runs ({.(+/m)#a),{:(+/"1 m=:x=+/a)#a=:p:i.1 p:x=:4 2 2 ({.(+/m)#a),{:(+/"1 m=:x=+/a)#a=:p:i.1 p:x=:6 3 3 ({.(+/m)#a),{:(+/"1 m=:x=+/a)#a=:p:i.1 p:x=:24 5 19 ({.(+/m)#a),{:(+/"1 m=:x=+/a)#a=... (more) |
— | almost 2 years ago |
Answer | — |
A: Determine whether an integer is square-free J, 7 char ``` ./:q: ``` How it works: 'q:' produces prime factors of number on right ':' replaces the first instance of unique numbers with a 1, the rest 0 './' tests for all ones Sample runs: ./:q: 30 1 ./:q: 40 0 ./:q: 50 0 ./:q: 100 0 ... (more) |
— | almost 2 years ago |
Answer | — |
A: The Pell Numbers J, 30 char ``` ((2%:2)%(1+%:2)&^-(1-%:2)&^) ``` ``` ((2%:2)%(1+%:2)&^-(1-%:2)&^) 0 0 ((2%:2)%(1+%:2)&^-(1-%:2)&^) 1 1 ((2%:2)%(1+%:2)&^-(1-%:2)&^) 2 2 ((2%:2)%(1+%:2)&^-(1-%:2)&^) 8 408 ``` (more) |
— | almost 2 years ago |
Answer | — |
A: Make $2 + 2 = 5$ J, 17 char ``` +/`5:@.(2./@:=]) ``` How it works: What's within parentheses tests if both numbers on the right are 2. If so, the verb agenda @. selects the verb 5: which is always 5. If not, the verb agenda @. selects the verb +/ which sums the numbers. ``` +/`5:@.(2./@:=]) 2 2 ... (more) |
— | almost 2 years ago |
Answer | — |
A: Looping counter J, 13 char ``` '',^:(<)'' ``` How it works: What's in parenthesis indicates to the verb ^: that the verb to the left of ^: has to be performed to the object on the right of the ^: an infinite number of times and that it has to list each intermediate result. '' is infinity, and '<' boxes it to ... (more) |
— | almost 2 years ago |
Answer | — |
A: Collatz conjecture; Count the tries to reach $1$ J, 35 char ``` :@:&3)@.(2&|)^:(1&:@:&3) if intermediate result is odd, multiply by 3 NB. @. choose from gerund using index on right NB. (2&|) mod 2 used as index into gerund on left NB. ^:(1&1 NB. ^:(<) repeat verb on left until intermediate value stops changing and keep intermedia... (more) |
— | almost 2 years ago |
Answer | — |
A: Can you give me half? J, 4 unique, 4 char ``` -:= ``` How it works: ``` -: results in half of what's on the right = results in signum of what's on the right is infinity ``` (more) |
— | about 2 years ago |