| Bytes | Lang | Time | Link |
|---|---|---|---|
| 119 | Python | 251016T123652Z | ojdo |
| 031 | Canvas | 251015T054121Z | hakr14 |
| 193 | Vyxal 3 | 250331T115510Z | Themooni |
| 108 | Neovim Macro | 240928T010938Z | typecast |
| 086 | JavaScript ES6 | 240926T204618Z | Arnauld |
| 090 | Haskell | 240927T012833Z | Antonio |
| 133 | Bash + brotli | 240927T112026Z | Kjetil S |
| 043 | 05AB1E | 240927T075515Z | Kevin Cr |
| 039 | Jelly | 240926T203448Z | Jonathan |
| 030 | Charcoal | 240926T212522Z | Neil |
| 051 | Vyxal 3 Mj | 240926T164718Z | pacman25 |
| 129 | Bubblegum | 240926T150257Z | Themooni |
Python, 119 bytes
The "straightforward" way. I first had hopes of getting a f"{...:>35}" right alignment to pay for the syntax cost, but ' '*(27-k) just is simpler and gets the end right for free.
Submission:
for k in range(29):print(' '*(27-k)+(k>3)*('/'*(k<28)+'°'*((29>k>3)*(k+4)))+'/'*((0<k<4)*8+min(3,k,28-k))+'_'*8*(1-k))
Slightly expanded for clarity:
for k in range(29):
print(
' '*(27-k)+
(k>3)*(
'/'*(k<28)+
'°'*((29>k>3)*(k+4))
)+
'/'*((0<k<4)*8+min(3,k,28-k))+
'_'*8*(1-k)
)
Canvas, 31 bytes
‾⁹{8+/×}⌐)/¹{7+‾Ic×]/14╋_8×‾-0╋
Explanation:
‾⁹{8+/×}⌐)/¹{7+‾Ic×]/14╋_8×‾-0╋ | Code (some characters replaced for nice formatting)
--------------------------------+-------------------------------------------------------------
‾⁹ | 25
{ } | From 1 to ToS (25):
8+ | Add 8
/× | Repeat / that number of times horizontally
⌐ | Duplicate ToS twice
) | Collect into an array (effectively stack lines vertically)
/ | Anti-diagonalize
¹ | 25 (from previous loop)
{ ] | Map from 1 to ToS (25), collecting results in an array:
7+ | Add 7
‾Ic× | Repeat ° that number of times horizontally
/ | Anti-diagonalize
14╋ | Overlap ToS (° trapezoid) over SoS (/ pentagon) 4 lines down
_8× | ________
‾-0╋ | Overlap ToS (_ line) over SoS 28 chars right, one line up
Vyxal 3, 193 bytes
"iX,≛∻WÞ⌊ξ^ʁĿᴥ⩔?ᐵ⏚›⇄▲S8_ℭ∧? Ϣ£⌊‰]ƛhʎ⅟\≠}∪-ℭƛ⅟ᐐ-⌈⁜ƶ↸‰∧}O⎶s☷⇧∺¶O⎘⊣2ġ!⊖↝g¥1¶(ṪM.⊖Ŀʀ∥}ᛞ⎘ʁλn⇄Ƶ%%Cµ⑷⌊ʁb Ͼꜝ¨Ϣx∥¨⅟ƛ↺⤺(⤻M※⦰ƓPh␣◌Ł④⌊λSΠδɾ³⎄Þ;ꜝ⊞ꜝ~>^ℭ@Ġꜝ
z⨪'f¬¤N@NcKt⎄⍰↺b[␣ɦhɠ⑴␣∑øṬM⑵^ɾʀ⎀»”'t176Orka19⊖(nsƵj
"cci________
ccr mmlcmm/likmm//li /nli/ner /blr/sjlkhlkpehapta/gqihfqipoqrhjqrpnqr/gfqkhbqkpsjqhnsqpnfq/gbdkhnjdkpgdhgtdpnb//
/gnj/
ggjtik qdrp /nbftnssm///lqri jotirkh pgnnfsatldm
crrbsoate"'t176Orka19⊖(nsƵj
"..." # regpack compressed target string, with '°' replaced with 't'
r # replace...
't # 't' with...
176O # unicode value 176 ('°')
ka19⊖ # build regpack decompression key:
19⊖ # first 19 chars of...
ka # lowercase alphabet
(nsƵj # regpack decompression routine:
(ns # split main string by each char in key
Ƶj # join by last element
💎
Created with the help of Luminespire.
The vyxal single-byte character set does not include the character °, so i instead build it from its unicode value otherwise, including it in the source would make the bytes count in UTF-8. this has the nice side effect of making the main string compressible, which saves more bytes than i use to construct the character.
<script type="vyxal3">
"iX,≛∻WÞ⌊ξ^ʁĿᴥ⩔?ᐵ⏚›⇄▲S8_ℭ∧? Ϣ£⌊‰]ƛhʎ⅟\≠}∪-ℭƛ⅟ᐐ-⌈⁜ƶ↸‰∧}O⎶s☷⇧∺¶O⎘⊣2ġ!⊖↝g¥1¶(ṪM.⊖Ŀʀ∥}ᛞ⎘ʁλn⇄Ƶ%%Cµ⑷⌊ʁb Ͼꜝ¨Ϣx∥¨⅟ƛ↺⤺(⤻M※⦰ƓPh␣◌Ł④⌊λSΠδɾ³⎄Þ;ꜝ⊞ꜝ~>^ℭ@Ġꜝ
z⨪'f¬¤N@NcKt⎄⍰↺b[␣ɦhɠ⑴␣∑øṬM⑵^ɾʀ⎀»”'t176Orka19⊖(nsƵj
</script>
<script>
args=[]
</script>
<script src="https://themoonisacheese.github.io/snippeterpreter/snippet.js" type="module"/>
Neovim Macro, 108 bytes
28oEsc5GC-v23jI3/Esc23jVkgC-xG0C-v24kI7°EscgvgC-aGk0C-vggI1/EscC-v3j6C-agvgC-aC-v26jI28 EscgvlgC-x$r_:%s/\v(\d+)(.)/\1A\2C-vEsc/gEnterqq^D@"kq28@q
Unprintable characters have been replaced with the keypresses they represent. Below is the raw hexdump:
00000000 32 38 6f 1b 35 47 16 32 33 6a 49 33 2f 1b 32 33 |28o.5G.23jI3/.23|
00000010 6a 56 6b 67 18 47 30 16 32 34 6b 49 37 c2 b0 1b |jVkg.G0.24kI7...|
00000020 67 76 67 01 47 6b 30 16 67 67 49 31 2f 1b 16 33 |gvg.Gk0.ggI1/..3|
00000030 6a 36 01 67 76 67 01 16 32 36 6a 49 32 38 20 1b |j6.gvg..26jI28 .|
00000040 67 76 6c 67 18 24 72 5f 3a 25 73 2f 5c 76 28 5c |gvlg.$r_:%s/\v(\|
00000050 64 2b 29 28 2e 29 2f 5c 31 41 5c 32 16 1b 2f 67 |d+)(.)/\1A\2../g|
00000060 0d 71 71 5e 44 40 22 6b 71 32 38 40 71 0a |.qq^D@"kq28@q.|
Here's a command you can use to test it. It's the same code as above, but in mapping format rather than macro format. Run this and then press F5 in an empty buffer:
:map <F5> 28o<Esc>5G<C-V>23jI3/<Esc>23jVkg<C-X>G0<C-V>24kI7°<Esc>gvg<C-A>Gk0<C-V>ggI1/<Esc><C-V>3j6<C-A>gvg<C-A><C-V>26jI28<Space><Esc>gvlg<C-X>$r_:%s/\v(\d+)(.)/\1A\2<C-V><Esc>/g<CR>qq^D@"kq28@q
Explanation
Stage 1: RLE decoding
28oEsc5GC-v23jI3/Esc23jVkgC-xG0C-v24kI7°EscgvgC-aGk0C-vggI1/EscC-v3j6C-agvgC-aC-v26jI28 EscgvlgC-x$r_
The first part of the program is simply my best attempt to encode the RLE version of the final string:
27 8_
26 9/
25 10/
24 11/
23 1/8°3/
22 1/9°3/
21 1/10°3/
20 1/11°3/
19 1/12°3/
18 1/13°3/
17 1/14°3/
16 1/15°3/
15 1/16°3/
14 1/17°3/
13 1/18°3/
12 1/19°3/
11 1/20°3/
10 1/21°3/
9 1/22°3/
8 1/23°3/
7 1/24°3/
6 1/25°3/
5 1/26°3/
4 1/27°3/
3 1/28°3/
2 1/29°3/
1 1/30°2/
1/31°1/
32°
For example, the first line is 27 spaces followed by 8 underscores.
This was done by hand, there's not really any special tricks here. The best way to see what's going on here is to just execute the code by hand and watch it construct the string, it's mostly just going back to front (for alignment reasons) and using gC-A and gC-X along with block selections.
Stage 2: Macro conversion
:%s/\v(\d+)(.)/\1A\2C-vEsc/gEnter
This executes a pattern that matches an RLE "packet" and transforms it into a macro that inserts that packet. The buffer now looks like this:
27A ^[8A_^[ 26A ^[9A/^[ 25A ^[10A/^[ 24A ^[11A/^[ 23A ^[1A/^[8A°^[3A/^[ 22A ^[1A/^[9A°^[3A/^[ 21A ^[1A/^[10A°^[3A/^[ 20A ^[1A/^[11A°^[3A/^[ 19A ^[1A/^[12A°^[3A/^[ 18A ^[1A/^[13A°^[3A/^[ 17A ^[1A/^[14A°^[3A/^[ 16A ^[1A/^[15A°^[3A/^[ 15A ^[1A/^[16A°^[3A/^[ 14A ^[1A/^[17A°^[3A/^[ 13A ^[1A/^[18A°^[3A/^[ 12A ^[1A/^[19A°^[3A/^[ 11A ^[1A/^[20A°^[3A/^[ 10A ^[1A/^[21A°^[3A/^[ 9A ^[1A/^[22A°^[3A/^[ 8A ^[1A/^[23A°^[3A/^[ 7A ^[1A/^[24A°^[3A/^[ 6A ^[1A/^[25A°^[3A/^[ 5A ^[1A/^[26A°^[3A/^[ 4A ^[1A/^[27A°^[3A/^[ 3A ^[1A/^[28A°^[3A/^[ 2A ^[1A/^[29A°^[3A/^[ 1A ^[1A/^[30A°^[2A/^[ 1A/^[31A°^[1A/^[ 32A°^[
Stage 3: Macro Execution
qq^D@"kq28@q
Finally, record a macro into @q that takes the contents of a line, executes them as a macro, and moves up a line. Executing this for every line gives us the final result.
JavaScript (ES6), 86 bytes
f=(y=-1,x,n=9+y-x--)=>29-y?` /_°
`[x?n<0?0:n&&x>3&y>3?3:n<33^3*!y:4]+f(y+!x,x||36):""
Commented
f = ( // f is a recursive function taking:
y = -1, // y = row, starting at -1
x, // x = column, initially undefined
n = 9 + y - x-- // n is negative on the left side,
// 0 on the diagonal,
// greater than 0 on the right side
) => //
29 - y ? // if y is not equal to 29:
` /_°\n`[ // lookup string
x ? // if x is not zero:
n < 0 ? // if this is the left side:
0 // append a space
: // else:
n && // if this is not the diagonal
x > 3 & // and we're not too far on the right
y > 3 ? // and this is not the upper part:
3 // append '°'
: // else:
n < 33 ^ // append either '/' or ' ' on the
// bottom right corner,
3 * !y // or '_' on the first row
: // else (end of row):
4 // append a line feed
] + // end of lookup
f( // recursive call:
y + !x, // increment y if x = 0
x || 36 // reset x to 36 if x = 0
) // end of recursive call
: // else:
"" // stop
Haskell, 100, 91, 89, 90 bytes
g<$>[0..28]<*>[-27..8]
g y x|x>7='\n'|x+y>32||x+y<0=' '|y<1='_'|x+y>0,x<5,y>3='°'|0<1='/'
-11 bytes thanks to xnor!
+1 byte because I didn't notice non-ascii °
Bash + brotli, 133 bytes
Kind of cheating but here goes:
echo HwEGwByp4z4Rt81aWOEFZMDWyxf//HsD2thmeRh5zL/jyX1d4EQQh9t6rW3jgi936M+HpQGCAoMDhASFBYYGh0eAAgkaRKiQoUOG57ob8wY=|base64 -d|brotli -d
117 bytes if output in UTF-8 is not required. In the old de facto standard Latin1/ISO-8859-1:
echo Hw0E+I+UrMW5EuQFtmFfvhQiDA+onBpYGGBAMf+FwAyPxGuTleazVpsBWCwWi8VisVgsFovFYrFYLBaLRdJfzNvcAA==|base64 -d|brotli -d
05AB1E, 43 bytes
'_8×'/9DÌŸ×'°8žwŸ×ε'/4×ìÀN21-F¤ð.;]`¨)˜.Bí»
ε'/4×ìÀN21-F¤ð.;] could alternatively be RεN3‚ß'/×3jì'/«}R for the same byte-count:
Try it online.
Explanation:
'_8× '# Push a string consisting of 8 "_"s
'/ '# Push "/"
9DÌŸ # Push list [9,10,11]
× # Map those values to strings consisting of that many "/"s
'°8žwŸ× '# Do the same for "°" and a list in the range [8,32]
ε # Map over this list:
'/4×ì '# Prepend 4 "/"
À # Then rotate it once so one "/" is trailing
N21- # Push the 0-based loop-index and subtract 21
F # If it's a positive integer, loop that many times:
¤ð.; # Replace the first "/" with a " "
] # Close both the inner loop and outer map
` # Pop and push these mapped strings to the stack
¨ # Remove the last character of the top string
) # Wrap everything on the stack into a list
˜ # Flatten it
.B # Box it; add trailing spaces to make all lines the same length
í # Then reverse each inner string
» # Join by newlines
# (after which the result is output implicitly)
R # Reverse the list of "°"-strings to range [32,8]
ε # Map over this list:
N3‚ # Pair 3 with the 0-based loop index
ß # Pop and leave the minimum
'/× '# Pop and have a string consisting of that many "/"
3j # Prepend spaces to make it length 3
ì # Prepend it in front of the "°"-string
'/« '# And also append a "/"
}R # After the map: Reverse the list back
Jelly, 43 42 39 bytes
25ðṬṖ;“@ɦ(½¤‘b4UŻ€31СḊ€Ḋ$ƬḣẎ»/ị“_/° ”Y
A full program that takes no arguments and prints the pile to stdout.
How?
Makes a single cigarette using integers rather than characters in printing precedence order so that we can merge canvases of cigarettes and other spaces (zeros) by taking maximums:
_ 0001
// 0022
// 022
// 22
° 3
Then builds the pile, translates to characters, and prints.
25ðṬṖ;“@ɦ(½¤‘b4UŻ€31СḊ€Ḋ$ƬḣẎ»/ị“_/° ”Y - Main Link: no arguments
25 - set the left argument to 25
ð - start a new dyadic chain - f(L=25, R=25)
Ṭ - {L} untruth -> [0,0,...,0,1] (24 zeros & 1)
Ṗ - pop -> [0,0,...,0] (24 zeros)
“@ɦ(½¤‘ - code-page indices -> [64,160,40,10,3]
; - concatenate -> [0,0,...,0,64,160,40,10,3]
b4 - to base four -> [[0],[0],...,[0],[1,0,0,0],[2,2,0,0],[2,2,0],[2,2],[3]]
U - reverse each -> [[0],[0],...,[0],[0,0,0,1],[0,0,2,2],[0,2,2],[2,2],[3]]
(full-height canvas with the bottom-left cigarette)
31С - collect, repeating this 31 times:
Ż€ - prefix each with a zero
(a full-height canvas with the next leftmost cigarette of the bottom row)
Ƭ - collect while distinct applying:
$ - last two links as a monad - f(Canvases):
Ḋ€ - dequeue each (remove the top line from each canvas)
Ḋ - dequeue (discard Canvas of leftmost cigarette)
ḣ - head to index {R} (first 25 of these lists of canvases)
Ẏ - tighten (to a list of 500 canvases)
»/ - reduce by maximum (merge the canvases)
ị“_/° ” - index into "_/° " (1-based and modular)
Y - join with newline characters
- implicit print
Charcoal, 30 bytes
←×_⁸↓G→⁹↓²⁵↙³←³³/↓G↗²⁵→⁸↓²⁵°
Attempt This Online! Link is to verbose version of code. Explanation:
←×_⁸
Draw the top line of _s, leaving the cursor to the left of the first _.
↓
Move down to the top line of /s.
G→⁹↓²⁵↙³←³³/
Draw the irregular pentagon of /s (considering the area under the °s to be part of the pentagon) leaving the cursor at the bottom left.
↓
Move down to where the bottom left of the °s should be.
G↗²⁵→⁸↓²⁵°
Draw the trapezium (US: trapezoid) of °s. (Note that ° costs 3 bytes in Charcoal.)
Bubblegum, 129 bytes
not printable, xxd dump:
00000000: 5d00 0000 04ff ffff ffff ffff ff00 106e ]..............n
00000010: 0c5f d4dd 54e5 a78d 4c84 ac22 2022 8f09 ._..T...L.." "..
00000020: ed2d 6f9d c21f 5eb6 38a3 fcb2 09f3 6a61 .-o...^.8.....ja
00000030: 1eed 10e8 8559 e94c 903a dffc cd80 03c5 .....Y.L.:......
00000040: 2921 d152 7ee6 7884 9c92 2599 c1c9 cd30 )!.R~.x...%....0
00000050: e519 a58d d27e 62b0 741b 8bed a643 155e .....~b.t....C.^
00000060: 7ff8 fc42 d35c 970b 3b5c e4d6 f2ad 22f9 ...B.\..;\....".
00000070: b2ec f8ac ccac eec0 1c13 3f77 fffd ee00 ..........?w....
00000080: 00 .
outputs:
________
/////////
//////////
///////////
/°°°°°°°°///
/°°°°°°°°°///
/°°°°°°°°°°///
/°°°°°°°°°°°///
/°°°°°°°°°°°°///
/°°°°°°°°°°°°°///
/°°°°°°°°°°°°°°///
/°°°°°°°°°°°°°°°///
/°°°°°°°°°°°°°°°°///
/°°°°°°°°°°°°°°°°°///
/°°°°°°°°°°°°°°°°°°///
/°°°°°°°°°°°°°°°°°°°///
/°°°°°°°°°°°°°°°°°°°°///
/°°°°°°°°°°°°°°°°°°°°°///
/°°°°°°°°°°°°°°°°°°°°°°///
/°°°°°°°°°°°°°°°°°°°°°°°///
/°°°°°°°°°°°°°°°°°°°°°°°°///
/°°°°°°°°°°°°°°°°°°°°°°°°°///
/°°°°°°°°°°°°°°°°°°°°°°°°°°///
/°°°°°°°°°°°°°°°°°°°°°°°°°°°///
/°°°°°°°°°°°°°°°°°°°°°°°°°°°°///
/°°°°°°°°°°°°°°°°°°°°°°°°°°°°°///
/°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°//
/°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°/
°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°
This is a valid lzma2 stream encoded with the extreme 9 preset, which bubblegum will simply decode and output when it detects that this is the case. Yes, this is largely cheating (even though bubblegum is technically an allowed language, the joke is now old), but i wanted to get any answer out there so that other participants had a correct template to copy. Bubblegum is also exactly why such challenges generally require participants to implement variable output, such as "n cigarettes" ;)