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 Arpad Horvath‭

Type On... Excerpt Status Date
Comment Post #293336 I am not familiar with TIO. (And also with APL, I've used Q/KDB+ earlier, and they are somewhat similar.) If I remember correctly assigning the function to a name is not part of the code so I've added the assignment (f←) in the footer. If that counts too, than it is 2 characters longer.
(more)
26 days ago
Edit Post #293336 Post edited:
26 days ago
Edit Post #293336 Initial revision 26 days ago
Answer A: Expand a greyscale/colour hex code
[APL (Dyalog Classic)], 31 bytes '#',{4=≢⍵:⍵[2 2 3 3 4 4]⋄6⍴1↓⍵} Try it online!
(more)
26 days ago
Comment Post #292945 with lambda function it is little bit shorter Instead of def f(n,d):return (19 chars with the space at the end) You can write: lambda n, d: (11 chars) As far as I know you don't need to assign it to a name, so it is a solution.
(more)
27 days ago
Edit Post #293328 Post edited:
Testing
27 days ago
Edit Post #293328 Initial revision 28 days ago
Answer A: Expand a greyscale/colour hex code
Q/KDB+, 39 bytes {"#",?[4=count x;x 1 1 2 2 3 3;6#1x]} Testing the function: q)cc:{"#",?[4=count x;x 1 1 2 2 3 3;6#1x]} q)cc "#ABCDEF" "#ABCDEF" q)cc "#A" "#AAAAAA" q)cc "#AB" "#ABABAB" q)cc "#ABC" "#AABBCC" q) is the prompt, other lines a...
(more)
28 days ago
Edit Post #291390 Initial revision 10 months ago
Answer A: Round trip stones
[Python], 104 bytes ```python f=lambda n:"1.0000000.7272730.7285710.7368420.7437890.7491640.7533440.7566570.7593360.761542"[8n-8:8n] ``` Try it online! Not too clever. I am curious whether it can be beaten with a Python code that really calculates the probability and prints the result...
(more)
10 months ago
Edit Post #291320 Post edited:
version
10 months ago
Edit Post #291320 Post edited:
just python
10 months ago
Edit Post #291320 Post edited:
10 months ago
Comment Post #291320 There are 8 kind of characters, " IXLCDM". 2 characters are 6 bits that can be easily mapped to printable characters (after 32 code point). This string is much shorter then the "DD DM IC ..." string itself. Even if I add the extraction it is still somewhat shorter. I just regenerate the " IXLCDM" ...
(more)
10 months ago
Edit Post #291324 Initial revision 10 months ago
Answer A: The 50 substrings that validate any string of Roman numerals
[Haskell], 271 bytes import Data.Char import Data.List n=" IVXLCDM" r x=maximum[if(s`isInfixOf`x)then s else"A"|s(n!!div x 8):[(n!!(x-8(div x 8)))])$map(\x->ord x-32)"&PW!H.!@/$HF$@G\"H6\"@7\"03#P?%N%O%U%]%^%&N&O!!+!1!=!9!<!:!;$=$<\"\"+#M#N#L#O#K#C#=#<%MH))\'X;;"] Try it ...
(more)
10 months ago
Edit Post #291320 Post edited:
even shorter 220
10 months ago
Comment Post #291320 Sorry for making that much work for you. My bad. I don't know exactly what did I do then but does't work for me now. But fortunately the current one is just 1 bytes longer. It works if I use square brackets inside te max function, but then it is longer then the current one.
(more)
10 months ago
Edit Post #291320 Post edited:
Fixing the code
10 months ago
Edit Post #291320 Post edited:
3.9
10 months ago
Edit Post #291320 Post edited:
10 months ago
Edit Post #291320 Post edited:
shorter
10 months ago
Edit Post #291320 Post edited:
10 months ago
Edit Post #291320 Initial revision 10 months ago
Answer A: The 50 substrings that validate any string of Roman numerals
[Python], 220 bytes Works with Python 3.8 or newer. n=" IVXLCDM" x=("".join([n[(d:=ord(c)-32)//8]+n[d-8(d//8)]for c in'&PW!H.!@/$HF$@G"H6"@7"03#P?%N%O%U%]%^%&N&O!!+!1!=!9! r=lambda c:max(s if s in c else"A"for s in'DD DM IC ID IL IM LC LD LL LM VC VD VL VM VV VX XD XM CCD CC...
(more)
10 months ago
Edit Post #291299 Post edited:
small fix
10 months ago
Edit Post #291299 Post edited:
remove test
10 months ago
Edit Post #291299 Post edited:
remove duplicate
10 months ago
Edit Post #291299 Post edited:
was a long variable name
10 months ago
Edit Post #291299 Post edited:
try it online after the code
10 months ago
Edit Post #291299 Post edited:
you can try it online
10 months ago
Edit Post #291299 Post edited:
Doesn't matter whether the assignments are in one line or several lines, the number of bytes are the same, so I have here the more readable version with new lines.
10 months ago
Edit Post #291299 Post edited:
584
10 months ago
Edit Post #291299 Post edited:
shorter version
10 months ago
Comment Post #291299 Thank you, At the end I have realized, that using 0,1 and 2 instead of the variables is even shorter.
(more)
10 months ago
Edit Post #291299 Post edited:
remove set
10 months ago
Edit Post #291299 Post edited:
10 months ago
Edit Post #291299 Post edited:
reordering long version
10 months ago
Edit Post #291299 Post edited:
test cases
10 months ago
Edit Post #291299 Initial revision 10 months ago
Answer A: Construct the Irish possessive
Python 3.8+, 577 bytes (was 634 than 591 bytes before) V="eéiíaáoóuúEÉIÍAÁOÓUÚ" r={"mé":("mo",0),"tú":("do",0),"sí":("a",1),"sé":("a",0),"muid":("ár",2),"sibh":("bhur",2),"siad":("a",2)} s=lambda a,b:a.upper()if b[0].isupper()else a def f(x,y):w,R=r[x];w=s(w[0]+"'"if w in{"...
(more)
10 months ago
Edit Post #290206 Post edited:
Shorter
over 1 year ago
Comment Post #290200 Ok. I have added the bytes of the import to the code.
(more)
over 1 year ago
Edit Post #290206 Post edited:
+import
over 1 year ago
Edit Post #290200 Post edited:
Adding import
over 1 year ago
Edit Post #290206 Post edited:
Back to 16, ay z_1 is the original
over 1 year ago
Comment Post #290206 Can I get the iterate function [from a 3rd party package](https://toolz.readthedocs.io/en/latest/api.html#toolz.itertoolz.iterate)? Then I can get a similar solution in Python. Where can I find a detailed description of the rules? How to count imports, for example.
(more)
over 1 year ago
Edit Post #290206 History hidden:
Detailed history before this event is hidden because of a redaction.
over 1 year ago
Edit Post #290206 Post edited:
Some hints how does it work
over 1 year ago
Edit Post #290206 Post edited:
print version
over 1 year ago