New answers tagged kolmogorov-complexity
2
vim, 103 bytes
25a <ESC>r30r9O0i <C-v><ESC>15l2xA <C-v><ESC><ESC>0"aDddqbYp<C-x>e<C-a>q2@a@b4@a@b6@aggqbYP<C-a>e<C-x>q@axr 2hr2@b4@a@b6@ayyjpr lr yyj2p2j2p2jp
<ESC> is 0x1b, <C-a> is 0x01, <C-x> is 0x18, and <C-v> is 0x16.
This includes all trailing spaces because I ...
1
Scratch, 327 bytes (Illegitimate)
Try it online!
I was really excited to submit this answer, but then I read the first rule, stating that my program must generate all 36 numbers before I can submit. However, this rule makes hard-coding the only viable option, which is not optimal. I decided to circumvent the several millennia necessary to satisfy this rule, ...
0
Grok, 23 bytes
`jiHello, World!
}lYW
q
Non-terminating version, 18 bytes
iHello, World!`lwh
0
Python 3 + lkjqwhe, 8 bytes
import a
Well, I beat It's-a-fake-one-Daniel. ¯\_(ツ)_/¯
0
Golunar, 66 bytes
142209095870573693396245504627320468349603549841832242891887476756
2
JavaScript, 572 (?) bytes
_=>`@r>=V6R=bWn3s*Ch=%{Fg>QNM'|c6SMH>wF=*
IElopM2Mw=?-,Knb7bW{\\=\rH3j=N9.3l*jm6Y(.wJP|
tFR7vmvt/))*D.F) . n}Hk18KTn0a{E6
w1z0]\\o.jV"ytga25d+~VNP{0v:zq[d) |.]d,t6P5:;:*?9m[8sI>\\R"'
wG*<#[^L/HFzAISvBDnmuy;+JNQj_n{[*d6DH#HtsLt}\`T+DX3T6/17
guv,\\d8G!\\9;Wug[78\\Iw]5"
r!~ZqN96Y\\99-g...
0
Python - 11 bytes
print -1 0 1
I would say "Good luck improving this.", but past experience has taught me never to assume: though, this won't be easily beat (for i in range(3), %ding the spaces and %sing the 1s are all overweight, so you can eliminate those.) (Edit 1: -4 due to caird, as is expected)
1
Grok, 13 bytes
}q
{p1+YzP9>!
2
Jelly, 3 bytes
-r1
Try it online!
1r-
Try it online!
-ŒR
Try it online!
1ŒR
Try it online!
Ø-Ż
Try it online!
Ø+Ż
Try it online!
-rN
Try it online!
1rN
Try it online!
2Ż’
Try it online!
3Ḷ’
Try it online!
and a bonus one:
M, 2 bytes
-R
Try it online!
answered 18 hours ago
caird coinheringaahing
31.4k77 gold badges7070 silver badges204204 bronze badges
0
05AB1E, 47 42 bytes
•1)âÝÈ݉ʒ%и&ñjÓU‰÷JêĆ+•₆B'X¶:AuðAuÇ31&ׇ.c
Try it online!
•...•₆B'X¶:AuðAuÇ31&ׇ.c # trimmed program
•...• # push 1902039976984631753317213270923121051329258518010...
B # in base...
₆ # 36...
: # with all...
'X #...
0
dotcomma, 67 bytes
[[[[[[[[[[.,][.].,][.].,][.].,][.].,][.].,][.].,][.].,][.].,][.].,]
Try it online!
A simple approach which nests [[...][.].,], which adds one to and then pushes each number from one to ten. The "root" of this is [.,] which pushes one.
Explanation:
In dotcomma, dots and commas are the only operators. Their behaviors are extremely ...
0
Javascript, 93 bytes
console.log((
_=>`F 12
A11F 1
10FE2
9FCB3
8FE4
B7F 5
AC6`.replace(/[A-F]/g,c=>''.padEnd('0x'+c-5))
)())
Port of Arnauld's answer to general JS
1
Canvas, 49 bytes
12∙11∙17«1╋¶10∙2‾⁶2╋¶¶9∙3‾⁹3╋¶¶8∙4‾⁵3╋¶7∙5‾¹2╋6)r
Try it here!
1
Scratch, 110 bytes
Try it online!
Easy sauce. Alternatively, 12 blocks.
when gf clicked
say(join((4)-(3))(join[, ](join((5)-(3))(join[, miss a few, ](join((3)*(33))(join[, ]((66)+(34
0
PHP, 69 bytes
<?=55-54,', ',floor((5*4)/7),', ','miss a few ',64746/654,', ',5*5*4;
2
PHP, 69 Bytes
<?for($i=1;$i<101;$i++){if($i%10!=0){echo('*');}else{echo('*<br>');}}
0
Brainfuck, 189 bytes
++[[+<]>+>++]<->>+[+[<]>>+<+]>>>-[-[-<]>>+<]>-<++++++++++<<<<<<<<[-[->+>+<<]>[-<+>]>[->>>>>>>.<<<<<<<]>>[->+>+<<]<+[->>>+<<<<+<+>>]<[->&...
1
Vyxal, C, 7 bytes
₄ƛkAẎṘṄ
Try it Online!
Very nice
Explained
₄ƛkAẎṘṄ
₄ƛ # over the range [1, 26]: (call each item n)
kAẎ # push "ABCDE....XYZ"[0:n]
ṘṄ # reverse and join on spaces
# the -C flag auto-centers the top of the stack
0
Deadfish~, 3354 bytes
...
1
V (vim), 11 unique characters, N=6
irow␛␛
cdddd␛
o␛i␛␛␛
l␛␛a␛␛
␛kdd␛␛
␛iblk␛
Try it online!
lot of escapes here. N=5 might be achievable, but I can't see a way to do it without increasing the unique characters.
2
Scratch, 256 bytes
Try it online!
At first, I thought it would be shorter to add each string manually, but I was very wrong! It doesn't look very good outside of monospace fonts though...
when gf clicked
delete all of[P v
set[A v]to[ABCDEFGHIJKLMNOPQRSTUVWXYZ
set[C v]to(25
set[L v]to(
repeat(26
set[S v]to(
repeat(C
set[S v]to(join(S)(
change[C v]by(-1
set[...
3
vim, 8 bytes
10a*<ESC>Y9p
<ESC> is 0x1b.
Annotated
10a*<ESC> # append * 10 times
Y # copy line into default register
9p # paste 9 times
Try it online!
1
Arn, 22 bytes
˜▒çc>åžî¼#(¸“├)øW§Ò┴Ì"
Try it!
Explained
Just the string literal. Pretty boring, the next-shortest I could get without this was 29 bytes.
0
Twue, 31 bytes
a::~**********\n
::=
aaaaaaaaaa
Try it on the website!
Simply defines the replacement a which maps to printing 10 asterisks. The main body consists of 10 as. Trying a secondary replacement b::=aa or b::=aaaaa both yield 33 bytes, which is unfortunately longer.
Whereas in some Thue interpreters, outputting implicitly outputs a newline, that is ...
2
vim, 42 41 bytes
:set nf=alpha
aZ<ESC>qqYp<C-x>q24@qVggJqqYPxq24@q
<ESC> is 0x1b, <C-x> is 0x18, <NL> is 0x0a.
Annotated
:set nf=alpha # make <C-x> work with letters
aZ<ESC> # put Z in buffer
qqYp<C-x>q # Record macro q: Append a line with the previous letter
24@q # ...and execute ...
4
Barrel, 31 34 bytes
+n, +n, 'miss a few, '#44+#45+n, +n
This is my own esolang, follow the link for more info.
Increments the accumulator, prints it, implicitly prints some strings (, and miss a few, are implicitly printed), does a loop on accumulator incrementation, and finishes as it started.
Edit: I realized that "97" used a "9". ...
0
R, 52 bytes
write(intToUtf8(outer(26:1,1:26,"<=")*90:65,T),1,26)
Try it online!
A different and (for now) golfier approach than this or that R answers.
To generate "exact text" as is required in kolmogorov-complexity challenges, there are usually two options in R: cat and write. cat is more flexible, as write is actually a wrapper ...
2
Vim, 20 bytes
i0<esc><C-A>s<C-R>=range(<C-R>"0<C-R>")
Try it online!
Trying to improve on Razetime's answer, I stumbled upon the range function, which works wonders for this task. i<C-R>=range(101)\n would print the numbers we want, we just need to be a little creative to do it without 1.
Explanation
i0<esc><C-A&...
1
VBScript, 39 bytes
For i=0 to 9
WSH.Echo "**********"
next
VBScript, 53 bytes
For i=0 to 9
WSH.Echo replace(space(10)," ","*")
next
The second solution is slightly more interesting......
0
V (vim), 30 bytes
i00<esc><C-a>hxpi0<esc>0"aDi0<esc>qqYp<C-a>q@a@qdd
Try it online!
can definitely be improved.
1
Jelly, 41 bytes
ȷ;€ȷḥ€ɠḋ“¥ẏ⁻ỵŻŀ]Ḥ6Iɠçịƥṃƈ=ẈQk®bȷƥ!?’b5¤%5
Try it online!
Full program: input from standard input, output to standard output. Output is 1/2/3/0 for 1 character / 2 characters / 3 characters / non-ASCII.
Discussion
Hey, I found another question where my algorithm for automatically generating answers to "map this input to that output" ...
0
Stax, 5 bytes
VAcKT
Run and debug it
Explanation
VAcKT
VA uppercase alphabet
c copy
K cross-product map short-form(displays with newlines):
T max of two values
0
Deadfish~, 1293 bytes
{iiiiii}iiiiicicicicicicicicicicicicicicicicicicicicicicicicicic{{d}ii}c{iiiii}iiiiiiccicicicicicicicicicicicicicicicicicicicicicicicic{{d}ii}c{iiiiii}dddcccicicicicicicicicicicicicicicicicicicicicicicic{{d}ii}c{iiiiii}ddccccicicicicicicicicicicicicicicicicicicicicicic{{d}ii}c{iiiiii}dcccccicicicicicicicicicicicicicicicicicicicicic{{d}...
2
Haskell, 139 bytes
t.zipWith(^)p.f.f$fromEnum<$>"آ\\maXyZ]k^d"
f=map(read.pure).show.t.map(p!!).scanl1((+).(+1))
p=[x|x<-[2..],mod(-t[1..x-1])x==1]
t=product
Try it online! (the code above times out on TIO, so the link points to a slightly more efficient version).
How?
♣ Preliminaries
t=product defines an alias for product (the builtin ...
1
Excel, 79 bytes
=LET(k,ROW(1:26),REPT(" ",26-k)&RIGHT(CONCAT(" "&CHAR(91-TRANSPOSE(k))),2*k-1))
Explanation
k,ROW ' k = 1..26
REPT(" ",26-k)&RIGHT(CONCAT(" "&CHAR(91-TRANSPOSE(k))),2*k-1) ' Final Calculation
REPT(" ",26-k) ...
2
SNOBOL4 (CSNOBOL4), 103 bytes
N &UCASE LEN(X) LEN(1) . B
X =X + 1 LT(X,26) :F(END)
R A =B ' ' A
OUTPUT =DUPL(' ',26 - X) A :(N)
END
Try it online!
0
Stax, 11 bytes
ùivK‼9⌂m¬╚─
Run and debug it
1
Jelly, 55 bytes
x39_;ḤØ1jƊƲ}
⁵Ḷµ+4Ḷ++Ḥ“ /*\”çⱮYð€;ø“ |-|”ẋ12”_-¦s4ç€4µY
Try it online!
1
brainfuck, 526 bytes
+>+[[-]<-[>+++>+<<-]>>+[<<+>>-]<[>+>+<<-]>>[<<+>>-]<<<[>>---->+<<<-]>>>[<<<+>>>-]<[[-]>>>--[<+>++++++]<---<<<[>+>>-<<<-]>[<+>-]>>[<<+>>-]++++[...
0
Deadfish~, 1103473 bytes
View source here
By far the longest answer I've ever done, and probably one of the longest (non-Unary) on Code Golf. Definitely longer than all my other answers and questions put together.
6
Charcoal, 111 84 bytes
F⪫⪪”)¶³6ΠKsv8∨ιm↥Sq3iθ¿⁼p[⪪∕¤⁺WηQDσ⁰”9¦87878≡ι3F”{∨>´↶}⦃α”✳Iκ#✳Iι×#I§⪪”)⧴Z/g↑◨M⸿”²Iι
Try it online! Link is to verbose version of code. Explanation: As @Arnauld points out, the diagram is not quite symmetric; only six of the top left to bottom right lines are the same, and even then they are not mirror images of themselves, ...
7
Ruby, 252 247 bytes
->{r=s=(' '*62+$/)*34
32.times{|i|s[[7,826,853,1672][i/8]+i%8*62,28]="##{(i%8%7<1??#:' ')*26}#"}
96.times{|j|s[q=[70,97,504,531][j/12%4]-603*(k=j/48)+(m=j%12)*63*z=1-k*2]=?#
m<1&&r=1-k
s[q+r-k*t=80>>m-(79>>j/12&1)&1|2,t]=?#*t
r+=z*t
j==5&&r-=1}
s}
Try it online!
The horizontal, ...
5
Deadfish~, 2090 bytes
{iii}iiccccccci{cc}cccccccc{dd}dddc{ii}iicccccciccccd{cc}cccicccc{dd}dddc{ii}iicccccicdcicdcciccd{cc}icdcicdccicc{dd}dddc{ii}iiccccicdccicdcccciccd{c}cccccccicdccicdccccicc{dd}dddc{ii}iicccicdcccicdcccccciccd{c}ccccicdcccicdccccccicc{dd}dddc{ii}iiccicdccccicdcccccccciccd{c}cicdccccicdccccccccicc{dd}dddc{ii}iicicdcccccicd{c}...
9
JavaScript (Node.js), 428 bytes
Uses 0 instead of #.
_=>Buffer('QaV6:)R/rEkQy|:|\\!8GG6Pzy}lO<:xv-q,GoKfhfkci;Br"? &]N9Xx[}~tvc1Z6;%Fq6>DO(9dGs&sG~n@z},=x7]+Qo4y}~8Tr~>45<y#J;_a-^"X=^:?`(8*QQh"GQ.V0>GBpa~ytaJYb^YJdo=/W&59kP#@pZ-pYt-uLLe-lDv/kV|}.ylnY<-$H@G&H{h4PPL%q&7t?1.?t}cI6Fcz-Nvo_wPUPP:Xh|tG0zp)...
0
Excel, 198 bytes
99*2 bytes of code on the wall.
=LET(q,100-ROW(1:98),b," bottles of beer",w,b&" on the wall",CONCAT(q&w&", "&q&b&".
Take one down and pass it around, "&(q-1)&w&".
")&"1"&b&", 1"&b&".
Go to the store and buy some ...
1
Stax, 21 bytes
åS╬╕▌≡º$)ö;▀├Xè¶XΔ£≈♀
Run and debug it
Not sure why recursive's solution from the tutorial hasn't been posted here yet. Probably the most minimal fizzbuzz possible in stax.
1
M4, 224 bytes
define(b,`$1 bottle`'ifelse($1,1,,s) of beer')define(w,`b($1) on the wall')define(f,`w($1), b($1).
ifelse($1,1,`Go to the store and buy some more, w(99).',`Take one down and pass it around, w(decr($1)).
f(decr($1))')')f(99)
If I learn GNU extensions, perhaps I would shorten this code.
Try it online!
0
Rust, 134 bytes
fn main(){let mut s:String=('α'..'ϊ').collect();s.remove(34);print!("{}",if std::env::args().nth(1)==None{s.to_uppercase()}else{s})}
Try it on the Rust Playground!
ungolfed:
fn main() { //full program
let mut s: String = ('α'..'ϊ').collect(); //create a range of chars from 'α'(inclusive) to '...
0
Excel, 48 bytes
=CONCAT(UNICHAR(ROW(1:24)*19/18+944-(A1="")*32))
Alternatively, you could put the upper case alphabet in B2 and use the formula below for a combined 47 bytes (or more depending on how you account for multiple cells)
=IF(A1="",B2,LOWER(B2))
0
PowerShell, 94 bytes
param($n)$k=((0..16)+(18..24)|%{[char]($_+913)})-join'';if($n){$k.tolower()}else{$k.toupper()}
Try it online!
Top 50 recent answers are included
Related Tags
kolmogorov-complexity × 623code-golf × 576
ascii-art × 162
string × 122
restricted-source × 39
graphical-output × 36
number × 30
code-challenge × 30
alphabet × 25
sequence × 19
math × 18
date × 18
geometry × 14
animation × 13
natural-language × 10
compression × 10
arithmetic × 9
integer × 8
primes × 8
unicode × 8
chemistry × 8
random × 7
cops-and-robbers × 7
code-generation × 7
metagolf × 7