Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Favorites infavorites:mine
infavorites:1234
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with Search options answers only user 42545

Conversion of numbers between positional numeral systems. Most common systems are decimal, binary, hexadecimal etc.

1
vote
Javascript (ES6), 181 180 bytes t=>((x=[...t].map(k=>`00${(k<'!'?26:k.charCodeAt(0)-97).toString(3)}`.slice(-3)).join``).slice(1)+x[0]).match(/.../g).map(j=>j>221?' ':String.fromCharCode(parseInt(j,3 …
answered Aug 13 '15 by ETHproductions
5
votes
Japt, 3 bytes +!U Uses base k+2, as the Jelly answer. There is a zero iff i==0. Test it online! Better version, 10 8 bytes UòV ¬è'0 This one uses base 10. Test it online! Bonus version, 14 12 …
answered Jan 29 '16 by ETHproductions
3
votes
JavaScript (ES6), 35 34 bytes f=n=>n?[...f(n>>=1),!n|n%2||-1]:[] Test snippet let f=n=>n?[...f(n>>=1),!n|n%2||-1]:[]; [25, 47, 1, 3, 1234567].map(x => console.log(x + ":", JSON.stringify(f( …
answered Aug 31 '17 by ETHproductions
8
votes
JavaScript (ES6), 59 58 55 bytes for(q=prompt(n=1);p=q--;n-=~n)for(m=n;p--;m*=2)alert(m) A full program that takes input through a prompt and alerts each number in succession. This also qualifies f …
answered Feb 7 '17 by ETHproductions
8
votes
JavaScript (ES6), 70 68 63 bytes g=n=>n?g(n-1).concat(/0/.test(n.toString(2).split`00`)?[]:n):[] console.log(g(1000).join(", ")) Slightly more interesting recursive solution: n=>[...Ar …
answered Dec 22 '16 by ETHproductions
2
votes
Japt, 11 bytes o@o!²ãXÄ mx Test it online! Explanation This pretty much uses @Dennis's approach: o@ o!² ãXÄ mx oX{o!p2 ãX+1 mx} // Implicit: U = input integer oX{ …
answered Feb 7 '17 by ETHproductions
13
votes
JavaScript (ES6), 30 28 bytes Saved 2 bytes thanks to @Arnauld f=(n,q)=>n?f(n>>1,q*2|n%2):q This basically calculates the reverse one bit at a time: We start with q = 0; while n is positive, we mu …
answered Jan 4 '17 by ETHproductions
3
votes
Javascript (ES6), 141 124 120 bytes Believe it or not.... :-) (t,i=0,c=w=>(t.charCodeAt(w)-123)%91+26)=>String.fromCharCode(...[...t].map(k=>(c(i)%9*3+c(++i%t.length)/9+65|0)%91+32)) As with my ot …
answered Aug 14 '15 by ETHproductions
5
votes
Japt, score 19 (23 bytes) nHo127 uA9 md)sG l /2 c Test it online! By coincidence, I don't think this can be golfed much even with non-ASCII chars... Explanation UnHo127 uA9 md)sG l /2 c Implic …
answered Aug 15 '17 by ETHproductions
2
votes
JavaScript (ES6), 32 bytes f=([...n])=>n+n&&+n.pop()+2*f(n) Recursion saves the day again! Though the parameterization seems a little long...
answered Dec 6 '16 by ETHproductions
1
vote
Japt, 26 bytes 1+U¬r@XwYn36}0)o37 £UnX} x Try it online! Ungolfed and explanation 1+U¬ r@ XwYn36}0)o37 £ UnX} x 1+Uq rXYZ{XwYn36}0)o37 mXYZ{UnX} x // Implicit: U = input string U …
answered Dec 4 '15 by ETHproductions
5
votes
Japt, 11 bytes _ì ìAn)¥U}a Test it online! Explanation _ì ìAn)¥U}a // Implicit: U = input integer, A = 10 _ }a // Return the smallest non-negative integer Z that returns a truthy value …
answered Jan 7 '17 by ETHproductions
8
votes
JavaScript, 82 bytes Saved a byte thanks to @Arnuald for(y of prompt(n=0))n=n<<8|y.charCodeAt() for(;alert(n)|n;)for(i=1;i<=n;i*=2)n^=i One of the very few times when a full program outp …
answered Nov 2 '16 by ETHproductions
3
votes
Japt, 32 31 bytes A¤i2Us4)¬®n s|iS)ù2 w i|1ÃqR² y Test it online! Not really satisfied with this yet, but it's a start... Explanation A¤ i2Us4)¬ ® n s |iS)ù2 w i |1à qR² y As2 i2Us4)q mZ{Zn …
answered Dec 1 '17 by ETHproductions
1
vote
Japt, 12 bytes !UsG r"[a-f] Try it online! How it works !UsG r"[a-f] // Implicit: U = input integer, G = 16 UsG // Convert U to a base-16 string. r"[a-f] // Replace all lowercase le …
answered Dec 12 '15 by ETHproductions

15 30 50 per page