New answers tagged string
1
vote
Output the HTML colors
Ruby, 75 bytes
Builds a list of possible colors using a Cartesian product and filters down to the correct ones with regex.
...
0
votes
Output the HTML colors
Tcl, 123 bytes
lmap c {0 80 FF 8000 8080 FF00 FFFF 800000 800080 808000 808080 C0C0C0 FF0000 FF00FF FFFF00 FFFFFF} {puts [format %06s $c]}
Attempt This Online!
0
votes
1
vote
0
votes
Number of string permutations that are palindromes
Vyxal 3, 5 bytes
⑴/⇄⧖∑
Vyxal It Online!
...
-2
votes
"Hello, World!"
HalfText, 11.375 bytes
This is one of small group of answers which has the code smaller than 13 bytes (length of Hello, World! with no quotations). HalfText codes ...
0
votes
2
votes
Find the largest contiguous prime in a string
Nekomata, 4 bytes
qĜQÅ
Attempt This Online!
Explanation
...
0
votes
0
votes
0
votes
1, 2, Fizz, 4, Buzz
Groovy, 60 bytes
1.upto(100){i->println"${i%3?'':'Fizz'}${i%5?'':'Buzz'}"?:i}
0
votes
Find the largest contiguous prime in a string
APL(NARS), 64 chars
{×≢⍵:⍕↑m/⍨m=⌈/m←⍎¨k←⍵⋄''}∘{∼×≢⍵:''⋄0π⍎⍵:,⊂⍵⋄×≢r←∇1↓⍵:r,∇¯1↓⍵⋄''}
Input one string contain only digits output one string. If not find one ...
0
votes
Find the largest contiguous prime in a string
Pascal, 326 B
This complete program requires a processor supporting features of Extended Pascal as defined by ISO standard 10206.
...
0
votes
0
votes
0
votes
1
vote
0
votes
True color code
Fortran (GFortran), 35 bytes
print'("#"Z6.6)',(i,i=0,8**8-1)
end
Try it online!
2
votes
0
votes
Trick or Treat polyglot
Brainfuck/JavaScript, 60 bytes
console["log"]("treat")//-[---[>]>+<<+<--]>+.--.>>++.>-.<++.
0
votes
0
votes
This isn't rocket science
AWK, 59 bytes
{gsub(/./," |&|\n")}$0=" |\n /_\\\n"$0" |_|\n/___\\\n VvV"
Attempt This Online!
Different AWK approach.
1
vote
Internationalisation -> I18n (numeronym)
K (ngn/k), 16 bytes
{($#2_x)/*x,'|x}
Try it online!
Function { } that zips ,' the argument <...
0
votes
0
votes
Zipper multiplication
Zsh, 108 bytes
a=${1/-};b=${(l:$#a::0:)2/-};for i ({1..$#a})Q+=${(l:2::0:)$((a[i]*b[i]))}
c=`bc<<<$1*$2`;bc<<<${c//[0-9]}$Q
Try it online!
...
0
votes
Zipper multiplication
Ruby, 94 characters
->m,n{(m.abs.digits.zip(n.abs.digits).map{'%02d'.%_1.to_i*_2.to_i}.reverse*'').to_i*(m*n<=>0)}
Sample run:
...
0
votes
Zipper multiplication
Pip, 18 bytes
R$* *Z R*:gTDtFD:h
Attempt This Online!
Explanation
List-of-digits base conversion makes this fairly straightforward.
...
0
votes
Zipper multiplication
AWK, 111 bytes
x=$1*$2<0?-1:1{for(;$1!=0||$2!=0;$2=int($2/10)){t=(($1%10*($2%10))^2)^.5;z=(t>9?t:0 t)z;$1=int($1/10)}}1,$0=z*x
Attempt This Online!
A note ...
2
votes
Zipper multiplication
Haskell, 79 bytes
import Data.Digits;r=reverse;d=r.digits 10;f a=unDigits 100.r.zipWith(*)(d a).d
Try it online!
We get lists of base ten digits using ...
1
vote
0
votes
#OctothorpeAsciiArt
Perl 5, 66 bytes
$==<>;$.=$_,print+((map+(($_|$.)&1?v35:$")x$=,@_),$/)x$=for@_=0..4
Try it online!
0
votes
0
votes
There are known knowns
Tcl, 57 bytes
puts "[set k known] $k\s
$k un$k\s
un$k $k\s
un$k un$k\s"
Try it online!
0
votes
Counting Letters in a String
Tcl, 106 bytes
proc C s {lmap c [split $s ""] {dict inc D [string tol $c]}
dict ma k\ v $D {if {$k!=" "} {puts $k:\ $v}}}
Try it online!
Top 50 recent answers are included
Related Tags
string × 2283code-golf × 2161
ascii-art × 217
decision-problem × 150
kolmogorov-complexity × 126
parsing × 125
number × 105
code-challenge × 72
natural-language × 68
math × 63
random × 61
balanced-string × 58
array × 56
restricted-source × 48
grid × 46
subsequence × 42
sorting × 40
alphabet × 39
sequence × 38
arithmetic × 38
permutations × 37
source-layout × 35
date × 34
counting × 33
palindrome × 33