↧
Answer by Fmbalbuena for Write a Stack Exchange compliant brainfuck explainer
Vyxal 3Ṡ, 80 79 bytesDð4ק,0$"<>+-.,[]"£([¥nc[⁰Lm-ꜝðק¹,|n§1#x)4m+ðק¥nḞꜝ:[#?Ḣin§⁰Lm-ðק,0|n§1][ð§¹,Try it...
View ArticleAnswer by Radek for Write a Stack Exchange compliant brainfuck explainer
Haskell, 235 231 bytesimport Data.Listmain=interact$unlines.map(" "++).f"><+-.,[]".linesf o(i:e)|let t=not.(`elem`o);p=(>>" ").concat;w((c:r):t)=(c:r++p t++'':maybe(e!!8)id(lookup c$zip o...
View ArticleAnswer by Natte for Write a Stack Exchange compliant brainfuck explainer
Haskell, 330 bytesimport Data.Listmain=interact$unlines.f.linesf(c:a)=(s 4++c):(map(p c.(a%)).tail.inits.t)ct r|r==[]=[]|q x=[x]:t y|0<1=a:t b where(x:y)=r;(a,b)=span(not.q)rq=(`elem`n)p...
View ArticleAnswer by Natte for Write a Stack Exchange compliant brainfuck explainer
Ruby, 118 bytesc,*a=*$<print" "*l=4,cc.scan(/[^+-.\[\]<>\n]+|./){puts" "*l+$&+" "*(c.size+4-l+=$&.size)+a["><+-.,[]".index($&)||8]}Try it online!Explanationc,*a=*$< #...
View ArticleAnswer by lonelyelk for Write a Stack Exchange compliant brainfuck explainer
Ruby, 143142 138 bytes->i{c,*e=i.split ?\n;puts" "*(m=4)+c;c.scan(/[^<>+-.,\[\]]+|./){|b|r=" ".*c.size+5;r[m,z=b.size]=b;puts r+e["<>+-.,[]".index(b)||8];m+=z}}Try it online!The function...
View ArticleAnswer by tjjfvi for Write a Stack Exchange compliant brainfuck explainer
brainfuck, 811775709 701...
View ArticleAnswer by Unrelated String for Write a Stack Exchange compliant brainfuck...
Jelly, 46 bytes®Ṭ€z0aḷżṚ⁸ṭṚŻ€4¡o⁶ð“><+-.,[]”iⱮxṠoŒQÄ©ŒQƲ$$ịŻ€Try it online!Program on the left and list of descriptions on the right. I suspect this can lose a few bytes fairly easily, but I'm...
View ArticleAnswer by a stone arachnid for Write a Stack Exchange compliant brainfuck...
C (clang), 191 188 bytes-3 thanks to @ceilingcat*S="><+-.,[]";i;l;d;f(char*a,**e){for(i=5,l=printf(" %s...
View ArticleAnswer by Dom Hastings for Write a Stack Exchange compliant brainfuck explainer
Perl 5+-nF -M5.10.0, 93 bytesThanks to @Fmbalbuena for noticing I'd missed printing the unaltered string! Thanks to @emanresu A and @Neil's regex wizardry saving 14 (!!)...
View ArticleAnswer by DLosc for Write a Stack Exchange compliant brainfuck explainer
Pip, 65 60 bytesOsX4FbPp:#_FIa^C X^Y"><+-.,[]"P[sX4pRXXsRA Uvbs(gU(y@?b)|9)]The BF program and the nine explanation strings are taken as command-line arguments. Alternately, you can use the -r...
View ArticleAnswer by Razetime for Write a Stack Exchange compliant brainfuck explainer
Stax, 45 byteså☺m█Q╗½§ÄN!╢┼♫mù}Jt→v)╢+Θ☼î╔↓bÉü╡⌐CÇ-♠•¿♪FM¥2Run and debug itMade this after Fmbalbuena's challenge in TNB. Will try to post something in Pip as well.Found a nice save after Neil pointed...
View ArticleAnswer by Neil for Write a Stack Exchange compliant brainfuck explainer
Retina, 207 205 bytes*\K````*\0G`\G.$& $&¶m,-10T`_><+\-.,[]p`d`.$(?<=^(.+¶)*.) 9¶(?=. 9)+`^(.+¶)*(.)+ .¶(?!¶|(?<-2> )*(?(2)$))$& ,-10P`.++`(\d)(...
View ArticleAnswer by Kevin Cruijssen for Write a Stack Exchange compliant brainfuck...
05AB1E, 5352 50 bytes.γ"><+-.,[]"©såN>*}DU¹g>j|VεXN>£JvÁ}Y®XNèkè«}¹š4ú»-2 bytes thanks to @ovs.Outputs the lines with four leading spaces.Try it online.Explanation:.γ # Group the first...
View ArticleAnswer by Neil for Write a Stack Exchange compliant brainfuck explainer
Charcoal, 5448 47 bytes×⁴PSFθ«⊞υ⌕><+-.,[]ι¿⁺²Σ✂υ±²↓P⊟υι»↑⸿↓≔E⁹SηEυ§ηιTry it online! Link is to verbose version of code. Explanation:×⁴Indent by 4 spaces.PSPrint the code without moving the...
View ArticleAnswer by tsh for Write a Stack Exchange compliant brainfuck explainer
JavaScript (ES2022), 141 bytess=>a=>" "+s+s.replace(/(?:[^+-.<>[\]]+|.)(?=(.*))/g,(c,e)=>``+(c+e.replace(/.|$/g,'')).padStart(s.length+5)+a.at('><+-.,[]'.indexOf(c)))Try it...
View ArticleAnswer by lyxal for Write a Stack Exchange compliant brainfuck explainer
Vyxaloj, 69 bytes:4$꘍,`([%^])`\\`><+-,.[]`f:→+∑%ṡ';:vL¦0pṪZƛ÷$꘍nh←=Tuw∨□ḣ∇‟İ„L›„↲p4$꘍∑Try it Online!Explained`([%^])`Push the string "([%^])" to the stack. This will serve as the basis for...
View ArticleWrite a Stack Exchange compliant brainfuck explainer
You are to take a string representing a piece of brainfuck code and Explanations, containing only printable ASCII characters and newlines ( to ~, ASCII 10 and 32 to 126) as input and output an...
View Article
More Pages to Explore .....