Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »

Activity for torres‭

Type On... Excerpt Status Date
Edit Post #287429 Initial revision about 2 years ago
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)
about 2 years ago
Comment Post #287173 I get Z00= -25, not -125, and 100= 25, not 125. (Z*5^2)+ (0*5^1)+ (0*5^0) = _25 . 'Z000' would be -125. Similarly for 100/1000.
(more)
about 2 years ago
Comment Post #287236 I hope I didn't give the wrong impression. I really like the ATO and I wish it would have worked. I'll wait for the J update. As to the output, it's not a dealbreaker. I was planning to add it manually, but then the answer didn't match.
(more)
about 2 years ago
Comment Post #287236 Seems cool, but I can't get it to work. The input is not giving the same output that my J installation does, and the output does not show up in the Code Golf clipboard copy.
(more)
about 2 years ago
Comment Post #287239 This works, without the right bracket ``` 7 u:32 OR 3 u: 'abcABC' abcabc ``` A variation inspired by your solution: ``` (32&OR)&.(3&u:)'abcABC' abcabc ```
(more)
about 2 years ago
Edit Post #287236 Initial revision about 2 years 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)
about 2 years ago
Edit Post #287216 Initial revision about 2 years 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)
about 2 years ago
Edit Post #287187 Post edited:
about 2 years ago
Edit Post #287187 Post edited:
about 2 years ago
Edit Post #287187 Initial revision about 2 years 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)
about 2 years ago
Edit Post #286746 Initial revision over 2 years 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)
over 2 years ago
Edit Post #286565 Initial revision over 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)
over 2 years ago
Edit Post #286564 Initial revision over 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)
over 2 years ago
Edit Post #286562 Post edited:
over 2 years ago
Edit Post #286562 Post edited:
over 2 years ago
Edit Post #286562 Post edited:
over 2 years ago
Edit Post #286562 Initial revision over 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)
over 2 years ago
Edit Post #286559 Initial revision over 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)
over 2 years ago
Comment Post #285638 By that description it would seem that the parentheses don't count. My concern is that, when they wrote the definition, they may have not known that in J there is a distinct difference between how "(-%)" works versus "-%".
(more)
over 2 years ago
Comment Post #285638 This requires parentheses to work, so shouldn't they be counted?
(more)
over 2 years ago
Edit Post #286558 Initial revision over 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)
over 2 years ago
Edit Post #286557 Initial revision over 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)
over 2 years ago
Edit Post #286556 Post edited:
over 2 years ago
Edit Post #286556 Post edited:
over 2 years ago
Edit Post #286556 Post edited:
over 2 years ago
Edit Post #286556 Post edited:
over 2 years ago
Edit Post #286556 Post edited:
over 2 years ago
Edit Post #286556 Post edited:
over 2 years ago
Edit Post #286556 Post edited:
over 2 years ago
Edit Post #286556 Initial revision over 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)
over 2 years ago
Edit Post #286544 Initial revision over 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)
over 2 years ago
Edit Post #286543 Post edited:
over 2 years ago
Edit Post #286543 Initial revision over 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)
over 2 years ago
Comment Post #285697 ``` 3 (++4&=@+) 1 5 ```
(more)
over 2 years ago
Edit Post #286542 Post edited:
over 2 years ago
Edit Post #286542 Initial revision over 2 years ago