New answers tagged

0

Emacs Lisp, 55/2=27.5 bytes! (error(and(princ"Hello World!")"Goodbye Cruel World!")) Usage: $ emacs --batch --eval '(error(and(princ"Hello World!")"Goodbye Cruel World!"))' Output: Goodbye Cruel World! # to stderr Hello World! # to stdout, exits with non zero


0

Pyth, 34 bytes VzI}N."09IÒ"p*\<Zp*\>KsN=ZK.?pN) With unprintable string \x96\x02 between ."09I and Ò Explained: Vz # For N in input I}N."09IÒ" # If N is in the packed string 1234567890 p*\<Z # Print Z * "<" p*\>KsN # K = int(...


0

JavaScript, 93 bytes, Real Crash var x=new XMLHttpRequest() x.open("POST", 1) alert`Goodbye Cruel World!` x.send(Array(135e6))


1

05AB1E, 19 18 bytes εDdi®α„><®y©@è×]J¦ Try it online!


0

Zsh, score >50 000 (1 112 046?), 16 + Σ(UTF-8 codepoint lengths) bytes exec echo $((${#:-$(<$0)}-33)) # Zsh handles multibyte encodings by default. The base snippet has 18 unique characters, 34 total. Every other codepoint (save for the null byte) can be added onto this. As I write this, my script testing these is on codepoint ~50 000, total file size ...


2

Perl 6, 48 bytes {$!=0;S:g{\d}=['<','>'][$/>$!]x abs +$!-($!=$/)} Try it online! Substitutes all digits with the appropriate character repeated the difference between the previous amount of times


3

Jelly, 18 bytes V©_¥®N,$Ø<xµ¹e?ØD) A full program. Assumes (like everyone else has) that no actual Brainfuck evaluation has to be made (no balancing of unbalanced brackets) Try it online! How? V©_¥®N,$Ø<xµ¹e?ØD) - Main Link: list of characters, s ) - for each character, c, in s: ØD - digits = "0123456789" ...


0

Retina 0.8.2, 27 bytes \d(\D*) $*>$1$&$*< +`<>|<$ Try it online! Explanation: \d(\D*) Match a digit and then all intervening non-digits. $*>$1$&$*< Slide the memory pointer to the desired cell, then after the intervening code, slide it back to the initial cell. +`<>|<$ Cancel out any overlapping slides and delete ...


0

C# (Visual C# Interactive Compiler), 103 99 bytes x=>{int i=48;foreach(var g in x)Write(g<58&g>47?new string(g-i<0?'>':'<',Math.Abs(i-(i=g))):g+"");} Try it online!


1

Python 3.6, 93 90 83 79 77 bytes p=0 for s in input(): try:a=int(s)-p;s='>'*a+'<'*-a;p+=a except:0 print(s) Try it online Thanks to @JonathanAllan for -2 bytes. Old version 90 bytes: p=0 for s in input(): if '/'<s<':':a=int(s);print('>'*(a-p)+'<'*(p-a));p=a else:print(s) Thanks to @EmbodimentofIgnorance for -3 bytes.


1

Japt v2.0a0, 20 16 bytes r\d@Tî< +'>pT=Xn Try it Saved 4 bytes porting a comment by tsh on Arnauld's solution which I've been told results in valid BF output. r\d@Tî< +'>pT=Xn :Implicit input of string r :Replace \d :Digits (RegEx /\d/g) @ :Pass each match X through a function Tî&...


2

JavaScript (ES6), 63 bytes s=>s.replace(/\d/g,n=>'<>'[+(p<n)].repeat(p<n?n-p:p-n,p=n),p=0) Try it online!


1

BBC BASIC 2 7 bytes P.2^127 Result 1.70141181E38 As commented the previous answer may violate the exponation rule, so here's something using the EXP (exponent) function instead. P.EXP(88) which returns 1.65163622E38


0

MathGolf, \$\approx 1.609 \times 10^{1859933}\$ 9!! Try it online! With MathGolf being a language written in Python, the main issue will be calculating the number in a timely fashion. This program produces its output in about a minute. It might be possible to to \$(10!)!\$, which would be significantly bigger. However, the approach and the byte-count is ...


1

05AB1E, score: 167 (111 bytes + 448/8) ¬g©i˜Oëøć',ý’.Œ¬With(’DŠ’(¬€ÿ*)[ÿ].ÒÀ(‚é.(‚ª.)ÿ^))’sø',ý€…[ÿ]',ý…[ÿ]s…ÿÿ)®G"(ÿ.)"}„id®ÍF’((ÿ.ÒÀ(:)).)’}s“ÿ(ÿ©¬) Since I don't know Haskell, I figured I'd just port the output of @ChristianSievers' Haskell answer, so make sure to upvote him!! Input is taken in a similar matter as well (first being the multiplicative ...


4

Brainfuck, 4201 bytes compressed. Image format used is PNG. I'm pretty sure the challenge is over because I'm leaving 4 instances modified script overnight. Explaination So how does it work? Using a Java program I'm generating a JPG file. Then, it's compressed and it's size is being checked prompting me shall I keep it. I ran this script for a while and ...


4

0.9514747859 (4204-byte output) Note: the image above is not the actual file I used, but it is the image. Here is a hexdump of the file: https://gist.github.com/pommicket/cf2982e8ecf09a4de89d3a849526c64b The file is in the netpbm format, and can be generated with this C code: #include <stdio.h> #include <stdlib.h> int main(int argc, char **...


11

Brainfuck, 77 75 73 + 32894 = 32967 32969 32971 bytes ++++++[->+++++++<]>+>++++++++++>+[>+[-<<<.>>>]<<.>[->+>+<<]>>[-<<+>>]<<+] Try it online! output is the simplest possible + ++ +++ ++++ ... explanation: ++++++[->+++++++<]>+ set cell 2 to 43 (ascii of plus) >+...


1

05AB1E, score: 4848 (1219 bytes source code + 3629 bytes output) '+14L×»Â'+'-:•тômG‚ΣP;e3₃ìèÕwƵÜè-½;¨Z±µΛé±V™NkKJžšë₅ušΘ(M₄+ܧ‘мoÕθÚzÇYï#J×¢θýει™₃tQØËв¿U®GƵ´GZ’¯ε¨jjØÛλÄ₅X∍µxθÆvËjS¹∊f˜«VÐZ<ÇĆ’Š2&ØÍäßÍĆlΓV₆ëßê©Œ‡ÛiyĆ=*÷Í´¢‹j,3½íµ'ž4‘û29ôãζм§x…1P|ÛéΣ=~çš5Œ±€Ô“q òǝ?ó¬Æí5¢G‘°êóÿв4LFÍK&zζb2Ó∍æïι8₃4XƵÜÙôt₁‘,Ö…6₅ÞαÇø†c÷Ûλ9…F;ĆA¬iмéλ8ä¶×ƶYΔè¡aû v=M„ûñ]C₅...


1

Scala, 95 + 16639 = 16734 bytes object M extends App{(1 to 127).map(x=>println("+"*x));(0 to 127).map(x=>println("-"*(128-x)))} Try it online! A simple answer which obviously is not going to win. Uses only the fact that the - operator (decreasing a byte) wraps back to 255.


4

SuperMarioLang, 231 + 32894 bytes ) ))++>(>+)*>[!((&(>[!*>-)-[!([! ===+"="==="=#===="=#="====#==# +++<( ) !+< ! ( < +===+ ( - . #=" #====" >[!+( ( !(< "=#++ ( #=" - (++ !.)) ))) < ) +++ #======================" + +++ + ++! !+<=# #=" Try it online! This sure can be golfed more, as the ...


11

Malbolge, 28 743 bytes + 7 166 of output Not too creative, ain't it? I'm going to work on golfing this bad boy. D'`;qp"~~5|3VU6/AQ?br)ML&\[)5h&g|ezyQ,_N)9xwponmlk1RQ.Okdihg`&%]E[`_XWVzZSXWVUNrqpPONGLEDCgG)E>=a`_^>=<|49870T.t2+*NMLKJkj('~%${Ay~}|{t:98765srqpRQ.Okdihg`&%$#"!~^W?[ZSRvVUTMRQPImlkjihgf@E>=<`@?>7};43WVUTSRQPO/.-...


4

JavaScript (Node.js), 691 + 3627 = 4318 Using the same approach as @Neil's Charcoal answer, and therefore also based on @JonathanAllan's Jelly answer. _=>(a=require('zlib').inflateRawSync(Buffer('bZXRsQMhCEX/0wpDB4yNOPbfxoMLKLAvs8lyQBEBDf2I9MHXf+I3X/f9hCJVsckdBgH3gih8YHT80Kpj01zQ7dUZb9osZ0Fzfvra+qiCl6GaqTB9vTdvNn2TjiaVjvBQKG5mHS/...


7

Charcoal, 707 698 410 + 3627 = 4334 4325 4037 bytes UT≔”}⊞J5±)↷γ²⁼⎇⦃<✂f^⊗L…¬⁻←«θ↥v⊙^≔¶υSψVτ16⁷·9I⌕↘;⦃@Pmt↙ |TL ‹.bE^↷Am⟧←⪫✂«GIχ¤⟲V⁻PÀ$χ¹'$↙‖%S³6◧N=$kHIpQ×ïu|%÷I↖➙⁸≔Wλ¹ê8⌕dNK‽3H∨↥γh➙↘⊙⊕“~Oj↨-⬤…⊟⁺§◨CB℅P⌕KNEAR№K⬤X"¬S⎇⧴V⁻±6⁼✂kι×CÀ⊞‴≡w↓γ=`→P5η1C⊖OSoNυs⊘$M↙êαη↖φ¡¿:θ-γ“rJW%E(7<w¤Uφ´ρHπ←SX↔τ↧%<Tº⎇0gθμ↓⌕;σw⌈pL;Y↘YΠ⊙>ξLzλ↓⁸ι⎚|⌕ΠP″M³⧴⬤¦➙⟧⌕/δ;↥⁻ºJK⌊≡<⊖λ✳...


1

Retina 0.8.2, 28 + 16640 = 16668 bytes 127$*+128$*- \+ ¶$`+ - ¶$'- Try it online! Includes output for 0. Just outputs using +s up to 127 and -s up to 255.


9

Stax, score 4751 4783 (812 bytes + 3971) ç♥←ħòqε↓F"QS₧9(2╤↑▌T~│áZk♣☺nàK╬l•▼2≡→fZ⌂▼├▄<ÖΘá6≈¡K"B∩₧∟µ#°ôQí⌡B2ô§↕*∩)V╕EôD=)O╥T⌠û◘¬dⁿ┤☻∞ô↓♫√○¬z.â\²╕ùHÑ~≡M√☻:EzLƒ→B{O◙ΔΦ_S┼╤g°▓─+dï-┌└α½╥ôRù♠3f½⌐▀Pösúô₧f☻■Aε→τΓ£╒fε▬▬►EÜ%¬╧←y═←{╤╒öú5Ñ╡♀^α☺╨▼$kEÑ■µjh≈↕█Cªü←Z#∟gV↓►S3≥╟╗K‼╞.N|⌠↨╣}5H↕ê;±↓♣≤Tj█'x╒·±ΩßL;ª$Å÷ÑPIδ`◘▌╦┼╡<√▌{òE√PPQ/h@8kq/ÖΓb6╡]≈╤æ░╣{┌‼¢ÜαT├#ΓCN∞*╬⌡↕...


5

Ruby 271 + 5363 = 5634 1.upto(255){|n|r=n>(o=n>128?256-n:n)??-:?+;puts o>20?(s=o.to_s(i=(3..9).find{|i|!(s=o.to_s i)[1..-2][s[0]]}).bytes;s[-1]+=s[0]%8;(s[1,9].reverse.map{|c|(c-=s[0])<0??-*-c:c>0??+*c:?-}*?>+'[>'+?+*(s[0]%8)).tr(n>o ?'+-':'','-+')+'[-<'+?+*i+'>]<<]'+(s[-1]>s[0]?'':?>+r)):r*o} Try it online! ...


5

Jelly, 1224 + 3716 = 4940 bytes ⁾+-ẋ€Ɱ14ZY€U0¦j“6VⱮ×ė7¬(Ị¢ẋṀⱮM⁵Ѭkbvœ⁸½ẋƓ0⁽ṖçḟŻßɓẉḷ0Ƙ¥@ⱮZĊⱮ{ṫṇØ"ỵðẓ⁵!ḳqḄƬiỴƥṇØm@ɗẆḅƥƲ⁴ŀ-5¦€ÑɓZĖ/gPṄḌ!ẹ$ḞıƒĿỵ⁷£Q.%¦ẊiUı-M⁹ƈxṁ,CsḲtÆƇỴṄĿiæEṛⱮẒʠþƘ%ƘƙṾ ('ȥ€½⁵ḥ+,þ@ẇ&ạV|ĊuAYḃfṖƘLƥQtPƬivxHj)Ṇɓ5JṘØẓæĿøɗjḥrñþa®OṅḍṪ¥=ɼġċṫßṬỌƈrUẉçŻ½\=]€ʂ_ⱮṖ¥Ƥȥ6SṡÆcạdn;ṅⱮDɦ⁹ṢAy)~Ḷ`ẒẓMTİṂḋ|ẉ]Wɠ¿⁾Ṣ|ḷ6hẸƒⱮQ1ẏƝC@Ŀ!ʠ⁽ṃ@ƓŒQ3@ƝḊñçcZ\¥3Z¤~çD>ċọuⱮȦAẈⱮ%L3Æ¢...


15

Perl 6, 224 + 3964 = 5834 4188 bytes map {say (.[0]~'['~.[3]~'>'~.[1]~'<]')x?.[1],'>'x?.all,.[2]}o*.min({$_>>.abs.sum+6*?.[1]})>>.&{<- +>[.sign>0]x.abs},classify({0+|(grep(*%%1,(((256 X*^4)X+.[0]%256)X/-.[3]))[0]*.[1]+.[2])%256},[X] |(^27-13 xx 3),-7..-1){^256} Try it online! (may timeout. Change the ^27-13 to ^25-12 to ...


4

Python 2, 70 + 8428 = 8498 -2 Bytes Thanks to A__! -20 Bytes Thanks to Jonathan Allan! -229 Bytes by putting the number in the second cell -1000ish bytes by switching from 16 to 9 p='+' i=1 exec"print[p*i,i/9*p+'[>'+p*9+'<-]>'+i%9*p][i>20];i+=1;"*255 Try it Online! Output


2

Unofficial Keg 16 + 32895 = 32911 bytes A baseline solution for a golfing language. This is the simplest I can think of. ÿï((:|\+$;)_\ ') Try it online!


2

Ruby 26 + 32895 = 32921 bytes puts (0..255).map{|n|?+*n} As a baseline. This is the simplest solution I can think of.


0

Forth (gforth), 9 bytes, 7 bytes -1. ud. Try it online! Produces: 340282366920938463463374607431768211455


2

Keg, 260144641↑260144641 *:*(:|:* Surprised I was able to get it this high, probably can be improved Edit: Improved by A__ How it works Pushes 127 to the stack twice, I used 127 since it is the highest number that can be pushed in 1 byte (Note there is two characters there, they're just unprintables) * Multiplies them :* Squares that ( Begin ...


2

Go, 6 bytes */``` Try to crack it online! The grave accent (`) marks a raw string literal, inside which all characters except `, including newlines and backslashes, are interpreted literally as part of the string. Three `'s in a row are the core: adjacent string literals are invalid and ` always closes a ` string, so there's no way to make sense of them. ...


0

33, $139,968 (12 bytes) "$"jcaaaxxpo Explanation "$" p | Prints '$' jca | Loads 36 (ASCII value of '$') into the accumulator and counter aaxx | Trebles it (108), then multiplies the result by 1,296 (139,968) o | Prints it


3

Keg, $298298 (5 Bytes) \$Ī: Fixed my answer now so it actually fits within the rules. Ī is two bytes so this is very close to the max I can get for this byte count. How it works \$ Pushes $ to the stack, has to be escaped since $ is the swap instruction in Keg Ī Pushes the unicode value of this character, which is 298 : Duplicates the top value of ...


6

Python, 2.62 * 10^40 This algorithm just floodfills (BFS) the plane starting from the black parts of the image, where for each new pixel we record what black part it was flooded from. As soon as we have two neighbouring pixels with different black parts as ancestors, we basically merge these two black parts by joining them through the ancestors of the two ...


7

C, score 2.397x10^38 Man this took way too long to do, most likely due to my choice of language. I got the algorithm working fairly early, but ran into a lot of problems with memory allocation (couldn't recursively free stuff due to stack overflows, leak sizes were huge). Still! It beats the other entry on every test case, and might even be optimal gets ...


2

MarioLANG, score 2, 3+925 bytes It's-a-me, Mario. 1 : + : I can count 1 when I see a +, adding 1 to cell0 (which contains 0 by default) and : prints the content of current cell as a number to STDOUT. Then I fall to death. Mamma mia! Kill me online! 2 : - - - - - - - - - - - - - - - ...


0

ArnoldC, score 1, 57 bytes I have a question with this. Would an "ArnoldC snippet" exist? Would it consist of removing IT'S SHOWTIME (beginMain) and YOU HAVE BEEN TERMINATED (endMain)? Would we need to I'LL BE BACK (return)? Anyway, if it doesn't, I can count to ... 1. IT'S SHOWTIME TALK TO THE HAND 1 YOU HAVE BEEN TERMINATED Try it online!


3

Befunge-98 (PyFunge), score 20, 89 bytes ! 2 3 4 5 6 7 8 9 a b c d e f y\-.@ 11111111111111111++++++++++++++++ '\x12 "\x13" 0gg0g###########################\x14 All are snippets except for 16, which is a full program. Some control characters are present, I've written them in the form \x?? here. Explanations 1. ! Pop an implicit zero off the empty stack ...


0

21. Flobnar, A010709 (All 4s) //0q ÷GxJiiiiihhZUUUUUUUNYAxcccccbCLDLxyzUUUUUTxyzJCLOzUUUUUURzyzxyzxyzcccccbbCLxGC//*/0e#§≈2*1z⌂'>[=====[===]]=[[==========]]=[ /*] 박망희 0# ;*/ //\u000A\u002F\u002A n=>//\u002A\u002Fn-> /**/""+n==""+n?5/2>2?1:40-/**/n:n*n//AcaAcAAI(((1)(1)(1)1)((1)(((1)1)1)1)(((1)(1)1)(((1)((1)1)(1)1)...


5

Python 3: 1.7x10^42 1.5x10^41 Using Pillow, numpy and scipy. Images are assumed to be in an images folder located in the same directory as the script. Disclaimer: It takes a long time to process all the images. Code import sys import os from PIL import Image import numpy as np import scipy.ndimage def obtain_groups(image, threshold, structuring_el): ...


0

T-SQL 2008, 55 bytes I apologize for being unable to figure out the scoring system. Input is 2 tables SELECT min(x)FROM a,b WHERE i>f and i<t+2GROUP BY z,f,t Try it online


0

Python 2, 42 bytes, \$O(n)\$ runtime, \$O(1)\$ space, score 1765 lambda x,L:[min(x[l[0]:l[1]+1])for l in L]


0

Jelly, 6 bytes, \$O(n)\$ runtime, \$O(1)\$ space, score 37 r/ịṂɗ€ Try it online! I hope I’ve understood the scoring correctly. Naive implementation that simply indexes into the list and finds the minimum. Requires no lookup table, but limited by needing to check each input value (so \$O(n)\$ in efficiency.


3

Every Python Release, 18.37291 points import sys print('Python '+'.'.join(map(str,sys.version_info[:-2]))) Technically valid, if you consider all the python versions to be different languages. There are currently 116 python versions, which I believe gives me a score of around 18.37291. (Also I understand if this isn't considered a valid answer, this was ...


0

Idris, score >>> g64 h:Nat->Nat h Z=S(S Z) h(S y)=let n=h y in hyper n n n let x=iterate h Z in index((index$S$S$S$Z)x)x Last line is the expression resulting in an extremely high number. I did never use exponentiation directly, since I never even called the hyper operator on level 3. The fifth element of x already results in hyper(hyper(hyper(hyper(...


2

Casio fx-350 ES PLUS, approx. 9.999882753E99 Do calculators count? At 70! the calculator throws error because apparently it has a number range limit -1E100 ~ 1E100


Top 50 recent answers are included