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 hyper-neutrino‭

Type On... Excerpt Status Date
Edit Post #288536 Initial revision over 1 year ago
Answer A: Efficient censorship
[Python 3], 102 bytes def f(x,y): &#9;a=[x] &#9;for x in a: &#9;&#9;if y not in x:return x &#9;&#9;for i in range(len(x)+1):a+=[x[:i]+x[i+1:]] Try it online! Not exactly the most efficient, but it works. Just a BFS of all possible removals.
(more)
over 1 year ago
Edit Post #284096 Initial revision about 3 years ago
Answer A: Repeat the characters
[Jelly], 1 byte x Try It Online! `x` is Jelly's replicate atom. Since Jelly is inspired by languages like J, APL, etc, it is no surprise that is has an atom for a fairly important function.
(more)
about 3 years ago
Edit Post #283277 Initial revision over 3 years ago
Answer A: Reduce over the range [1..n]
[Python 2], 33 bytes lambda a,b:reduce(a,range(1,1+b)) Try it online! Or, without using the `reduce` built-in: [Python 2], 37 bytes f=lambda a,b:b-1and a(f(a,b-1),b)or 1 Try it online!
(more)
over 3 years ago
Comment Post #282972 Can we require the art to be padded to a rectangle with spaces when provided as input?
(more)
over 3 years ago
Edit Post #281523 Post edited:
over 3 years ago
Comment Post #282457 @#54143 Thanks, fixed.
(more)
over 3 years ago
Edit Post #282457 Post edited:
over 3 years ago
Edit Post #282457 Initial revision over 3 years ago
Answer A: Multiply complex numbers.
[Python 3], 98 bytes print(str(eval("("+input().replace(" ",")(").replace("i","j")+")")).strip("()").replace("j","i")) Try it online! Since the input format is restrictive, I may as well just spam replace and abuse `eval`.
(more)
over 3 years ago
Edit Post #282426 Initial revision over 3 years ago
Answer A: Evens or Odds - you know this one
[Python 3], 10 bytes 1 .and Try it online! Returns `1` for odd numbers and `0` for even numbers. Two bytes shorter than the trivial `lambda x:x%2` and one byte shorter than the equivalent magic function `2 .rmod`.
(more)
over 3 years ago
Comment Post #282334 I know how it works in Python. But you didn't specify it in your question itself. Also I agree with Razetime that this is extremely trivial - most language have this as a builtin so solutions will all just use that, and only a handful of strange esolangs _might_ have an interesting solution.
(more)
over 3 years ago
Comment Post #282334 what are `1 % 2`, `-1 % 2`, `1 % -2`, and `-1 % -2`?
(more)
over 3 years ago
Comment Post #282280 Can you define "printable"? IIRC tabs and newlines aren't part of printable ASCII. Also just to be sure - whitespace is just space, newline, and tab, right? Or am I missing something...
(more)
over 3 years ago
Edit Post #282245 Post edited:
over 3 years ago
Edit Post #282245 Post edited:
over 3 years ago
Edit Post #282245 Initial revision over 3 years ago
Answer A: Are they abundant, deficient or perfect?
[Jelly], 6 bytes ÆṣṠ)Ġ Try it online! In order of abundant, perfect, deficient. ``` ÆṣṠ)Ġ Main Link ) For each from 1 to N Subtract Æṣ The proper divisor sum Ṡ Sign of the difference Ġ Group equal elements' indices ```
(more)
over 3 years ago
Edit Post #282076 Post edited:
over 3 years ago
Edit Post #282076 Post edited:
over 3 years ago
Edit Post #282076 Post edited:
over 3 years ago
Edit Post #282076 Initial revision over 3 years ago
Answer A: Evaluation order of an APL n-train
[Jelly], 8 bytes ṖUs2UṭµF Try it online! -1 byte thanks to caird coinheringaahing (Also posted on Stack Exchange by myself) ``` ṖUs2UṭµF Main Link Ṗ pop (remove last element; for numbers, comes with an implicit range) U reverse s2 slice into chun...
(more)
over 3 years ago
Edit Post #281958 Post edited:
over 3 years ago
Comment Post #281958 @user Oh, using an accumulator is a good idea. thanks.
(more)
over 3 years ago
Edit Post #281958 Post edited:
over 3 years ago
Edit Post #281958 Initial revision over 3 years ago
Answer A: Backspace an array
[Python 3.8 (pre-release)], 62 bytes f=lambda x,a=[]:f(x[1:],a+[x[0]]if x[0]else a[:-1])if x else a Try it online! -11 bytes thanks to user
(more)
over 3 years ago
Edit Post #281523 Initial revision over 3 years ago
Answer A: Make my number a set
[Python 3], 34 bytes f=lambda x:[f(y)for y in range(x)] Try it online! -9 bytes thanks to Moshi Unfortunately, I cannot use Python sets, because sets are unhashable and thus cannot be put into sets.
(more)
over 3 years ago
Comment Post #281371 @user How would I test the code (as in how should I format my TIO fields to use that)?
(more)
over 3 years ago
Edit Post #281371 Initial revision over 3 years ago
Answer A: Cumulative Counts
[APL (Dyalog Unicode)], 11 bytes (SBCS) 1 1∘⍉+\∘.=⍨ Try it online! This was a fun APL exercise. Working on figuring out how to get it down to 7 bytes.
(more)
over 3 years ago
Edit Post #281369 Initial revision over 3 years ago
Answer A: Cumulative Counts
[Jelly], 7 bytes =þ`ÄŒDḢ Try it online!
(more)
over 3 years ago