New answers tagged integer
1
vote
Digits in their lanes
Zsh, 50 bytes
for i;{for j (\- {0..9})printf ${j/[^$i]/\ };echo}
Try it online!
1
vote
Digits in their lanes
Uiua, 24 bytes SBCS
∵◇(↘1⊏×°⊏⊸∈:⊂" -"+@0⇡10)
Input is a boxed array of strings, output is a 2D array of strings. Try it online!
Explanation
...
1
vote
Construct a uInt from an array of bits
AWK, 42 bytes
{for(i=NF;i;i--)s+=x?($i*2)^(x++):x++}$0=s
Attempt This Online!
1
vote
Smallest palindrome divisible by the input
AWK, 74 bytes
func f(n,r){return n?f(int(n/10),r*10+n%10):r}{for(x=$0;$0!=f($0);)$0+=x}1
reverse() - or better yet rev() - is the one function I'm always missing.
...
0
votes
Smallest palindrome divisible by the input
Uiua, 12 bytes
⍢⊸+(¬≍⇌.°⋕).
Try this online!
Explanation:
...
0
votes
Stay away from zero
BrainChild ASM, 6 bytes
asm function f(int)->int{
xpopa
cpyab
notb
addba
xpusha
ret
}
Adds the top of the X Stack to the logical not of ...
0
votes
Stay away from zero
Uiua, 2 bytes
↥1
Try this online!
No need for explanation but here's one:
↥1 => determine maximum between n and 1
1
vote
Let's decrease the monotony
AWK, 64 bytes
{for(x=1;i++<NF;$i==$(i+1)&&x&&x=0)if($i<$(i+1)&&x=-1)break}$0=x
Prints 1, nothing, or -1.
Try it online!
...
0
votes
0
votes
2
votes
Minimal sparse rulers
JavaScript (ES7), 115 bytes
Returns the \$n\$-th term.
Adapted from my answer to this other challenge.
...
Top 50 recent answers are included
Related Tags
integer × 447code-golf × 417
number × 118
math × 97
sequence × 94
arithmetic × 58
array × 47
decision-problem × 38
string × 28
number-theory × 27
binary × 21
primes × 19
matrix × 19
ascii-art × 13
code-challenge × 13
base-conversion × 13
geometry × 10
bitwise × 9
division × 9
kolmogorov-complexity × 8
sorting × 8
fastest-code × 8
fibonacci × 8
subsequence × 8
polynomials × 8