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 Glory2Ukraine‭

Type On... Excerpt Status Date
Edit Post #295332 Post edited:
8 months ago
Comment Post #295332 @#53890 thank you for the clarification; one of the rules in this challenge is "It should work at least for all inputs greater than 0 ", and I took it literally. Anyway I have modified my golf to include the 0-case too.
(more)
8 months ago
Edit Post #295332 Post edited:
8 months ago
Edit Post #295332 Initial revision 8 months ago
Answer A: Convert to Hexadecimal
R, 73 bytes ```r `-`=\(n,s="",`<`=paste0)`if`(n,n%/%16-c(0:9,LETTERS[1:6])[1+n%%16]<s,0<s) ``` Attempt This Online! Similar to the JS and Python answers, but uses recursion. Adds a leading 0 to the output. This way, the case for 0 is solved, with no empty output.
(more)
8 months ago