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 »
Challenges

Post History

66%
+2 −0
Challenges Convert to Hexadecimal

Vyxal, 24 bytes 16ʀẋfÞ×'ẏ16$e*∑?=;hṘk6i∑ Try it Online! All this when just H, 16R, or even k6τ would have sufficed. Times out for every input > 100 Explained 16ʀẋfÞ×'ẏ16$e*∑?=;hṘk6i∑­⁡...

posted 8d ago by lyxal‭  ·  edited 7d ago by lyxal‭

Answer
#2: Post edited by user avatar lyxal‭ · 2025-04-11T23:54:57Z (7 days ago)
  • # [Vyxal](https://github.com/Vyxal/Vyxal/tree/version-2), 3 bytes
  • ```
  • k6τ
  • ```
  • [Try it Online!](https://vyxal.pythonanywhere.com/?v=1&c=1#WyIiLCIiLCJrNs+EIiwiIiwiMTUzIl0=)
  • Very simple
  • ## Explained
  • ```
  • k6τ
  • τ # Convert to base
  • k6 # "0123456789ABCDEF"
  • ```
  • # [Vyxal](https://github.com/Vyxal/Vyxal/tree/version-2), 24 bytes
  • ```
  • 16ʀẋfÞ×'ẏ16$e*∑?=;hṘk6i∑
  • ```
  • [Try it Online!](https://vyxal.pythonanywhere.com/?v=2&c=1#WyIiLCIiLCIxNsqA4bqLZsOew5cn4bqPMTYkZSriiJE/PTto4bmYazZp4oiRIiwiIiwiMTgiXQ==)
  • ![Image_alt_text](https://codegolf.codidact.com/uploads/vy7i8d55d6mc6dtuiov77cwhtjgf)
  • All this when just `H`, `16R`, or even `k6τ` would have sufficed.
  • Times out for every input > 100
  • ## Explained
  • ```
  • 16ʀẋfÞ×'ẏ16$e*∑?=;hṘk6i∑­⁡​‎‎⁡⁠⁡‏⁠‎⁡⁠⁢‏⁠‎⁡⁠⁣‏⁠‎⁡⁠⁤‏‏​⁡⁠⁡‌⁢​‎‎⁡⁠⁢⁡‏‏​⁡⁠⁡‌⁣​‎‎⁡⁠⁢⁢‏⁠‎⁡⁠⁢⁣‏‏​⁡⁠⁡‌⁤​‎‏​⁢⁠⁡‌⁢⁡​‎‏​⁢⁠⁡‌⁢⁢​‎‎⁡⁠⁢⁤‏⁠‎⁡⁠⁢⁡⁢‏‏​⁡⁠⁡‌⁢⁣​‎‎⁡⁠⁣⁡‏⁠‎⁡⁠⁣⁢‏⁠‎⁡⁠⁣⁣‏⁠‎⁡⁠⁣⁤‏⁠‎⁡⁠⁤⁡‏⁠‎⁡⁠⁤⁢‏⁠‎⁡⁠⁤⁣‏‏​⁡⁠⁡‌⁢⁤​‎‎⁡⁠⁢⁡⁡‏‏​⁡⁠⁡‌⁣⁡​‎‎⁡⁠⁤⁤‏⁠‏​⁡⁠⁡‌⁣⁢​‎‎⁡⁠⁢⁡⁣‏‏​⁡⁠⁡‌⁣⁣​‎‎⁡⁠⁢⁢⁡‏⁠‎⁡⁠⁢⁢⁢‏⁠‎⁡⁠⁢⁢⁣‏‏​⁡⁠⁡‌⁣⁤​‎‎⁡⁠⁢⁢⁤‏‏​⁡⁠⁡‌­
  • 16ʀẋ # ‎⁡Repeat the range [0, 16) (input) times.
  • f # ‎⁢And flatten into a single list.
  • Þ× # ‎⁣Get every possible combination with repetition of all possible lengths.
  • # ‎⁤(This is why it times out for large inputs)
  • # ‎⁢⁡(Because it needs to be long enough to have the correct output in theory)
  • ' ; # ‎⁢⁢Keep combinations where:
  • ẏ16$e*∑ # ‎⁢⁣ (x_0 * 16 ^ 0) + (x_1 * 16 ^ 1) + (x_2 * 16 ^ 2) + ...
  • = # ‎⁢⁤ equals
  • ? # ‎⁣⁡ the input
  • h # ‎⁣⁢Get the first combination
  • k6i # ‎⁣⁣And get the corresponding characters in the string "0123456789ABCDEF"
  • ∑ # ‎⁣⁤Join into a single string
  • 💎
  • ```
  • Created with the help of [Luminespire](https://vyxal.github.io/Luminespire).
#1: Initial revision by user avatar lyxal‭ · 2025-04-11T05:59:27Z (8 days ago)
# [Vyxal](https://github.com/Vyxal/Vyxal/tree/version-2), 3 bytes 

```
k6τ
```

[Try it Online!](https://vyxal.pythonanywhere.com/?v=1&c=1#WyIiLCIiLCJrNs+EIiwiIiwiMTUzIl0=)

Very simple

## Explained

```
k6τ
  τ # Convert to base
k6  # "0123456789ABCDEF"
```