6
\$\begingroup\$

Today is May 4th, Star Wars day, so here's a Star Wars ASCII-art task. Output this image of an X-Wing starfighter:

\             /
o\           /o
V \(+)___(+)/ V
|  --/ | \--  |
  /(+)\|/(+)\
 /    |||    \
/o     |     o\
 V           V
 |           |

Your output may have any extra whitespace that doesn't affect the representation of the image. You may output a list of lines instead of a string with newlines.

This is , so shortest answer wins. May the 4th be with you!

(If it's May 5th in your timezone, try Sith TIE-Fighter)

\$\endgroup\$

5 Answers 5

5
\$\begingroup\$

Charcoal, 36 bytes

↑|VoP/²↖↑↑|Vo↘³M↑“↗↧ºXu⊘$…(s”↙↘|↑⁴‖B

Try it online! Link is to verbose version of code. Explanation:

↑|VoP/²

Draw the bottom left leg.

↖↑↑|Vo↘³

Draw the top left leg.

M↑“↗↧ºXu⊘$…(s”

Draw the left body using a compressed string.

↙↘|↑⁴

Draw the middle of the body.

‖B

Reflect to complete the starfighter.

\$\endgroup\$
3
\$\begingroup\$

K (ngn/k), 96 bytes

Hardcode the left half, then reverse and replace \/() -> /\)( to get the other half.

`0:"/()\\"{y,1_|y^'x@3-x?y}/:8$";"\"\\;o\\;V \\(+)__;|  --/ |;  /(+)\\|; /    ||;/o     |; V; |"

Attempt This Online!

\$\endgroup\$
2
\$\begingroup\$

JavaScript (ES6), 125 bytes

_=>`09/
o08/o
V 0(+)___(+)/ V
|2--/ | 0--2|
2/(+)0|/(+)0
 /3|||30
/o4|4o0
 V8V
 |8|`.replace(/\d/g,n=>"".padEnd(n/.67)||"\\")

Try it online!

\$\endgroup\$
2
\$\begingroup\$

Vyxal Drj, 387 bitsv2, 48.375 bytes

` |/\-_)+(Vo`»¬W,Ze:iw≠ꜝ≬⊍eȦR`¡ßdĿ$»τ»÷Ṡ%]»fẇƛ8røM

Try it Online!

Bitstring:

011010111101100010101100010111010011011110100000111110000101110011010101110101111111100100001011101100001100010001000010010111111001000011011010111111001010110100011001100001011101110111110110100111000100101100111001011110110000011000101011001110101110010101101101001000110110111000010110110000110110110110011101100110000111100110010100110010010001111011011110011001001010000110111111101

-2 bytes thanks to Kevin Cruijssen

\$\endgroup\$
2
  • \$\begingroup\$ The hard-coded string can be »¬W,Ze:iw≠ꜝ≬⊍eȦR`¡ßdĿ$»` |/\-_)+(Vo`τ, although I'm not sure how to combine it with the r flag.. :/ \$\endgroup\$ May 6 at 7:23
  • \$\begingroup\$ r flag just switches the two \$\endgroup\$
    – pacman256
    May 6 at 13:54
1
\$\begingroup\$

05AB1E, 48 bytes

•D¾ì6ªβh§ζƶwāZ·ªrΣ∍kϪ#8ñ2•" 
|/\-_)+(Vo"ÅвJ.B.º

Outputs as a list of lines.

Try it online. (The » in the footer joins the list by newlines. Feel free to remove it to see the actual result.)

Explanation:

Step 1: Draw the left side without trailing spaces:
by using this 05AB1E ASCII-art compression technique

•D¾ì6ªβh§ζƶwāZ·ªrΣ∍kϪ#8ñ2•
                # Push compressed integer 78542092356563376216422644276947767672388754200679396880402
" \n|/\-_)+(Vo" # Push this string
  Åв            # Convert the integer to custom base-" \n|/\-_)+(Vo",
                # basically convert it to base-length, and then index into the string
    J           # Join this list of characters to a single string

See this 05AB1E tip of mine (section How to compress large integers?) to understand why •D¾ì6ªβh§ζƶwāZ·ªrΣ∍kϪ#8ñ2• is 78542092356563376216422644276947767672388754200679396880402.

Try just this first step.

.B              # Split on newlines, but add trailing spaces to make all lines the same length
  .º            # Mirror the list of lines horizontally with overlap in the middle
                # (after which the result is output implicitly)
\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.