11
\$\begingroup\$

Challenge

Display to the screen or write to stdout this exactly:

    **
    **
   ****
   ****
   ****
   ****
   ****
   ****
   ****
**********
**********
**********

Winning

This is , so the shortest submission (in bytes) wins.

\$\endgroup\$
3
  • 7
    \$\begingroup\$ I assume from your answer that it's fine to have trailing spaces after the lines, at least to pad to a rectangle? \$\endgroup\$
    – xnor
    Commented Nov 14, 2023 at 20:21
  • \$\begingroup\$ My answer will be in PETSCII, which may therefore be non-competing. But I'll add it for fun anyway. \$\endgroup\$ Commented Nov 16, 2023 at 9:50
  • 1
    \$\begingroup\$ xnor, yes you may have trailing spaces after lines \$\endgroup\$
    – lame-lexem
    Commented Nov 17, 2023 at 1:38

36 Answers 36

1
2
2
\$\begingroup\$

COMMODORE 64 & MSX BASIC - Solution as a one-liner, 80 Bytes

0 DATA4,2,2,3,4,7,,10,3:READA,B,C:FORJ=1TOC:PRINTTAB(A):FORI=1TOB:PRINT"*";:NEXT:PRINT:NEXT:GOTO

In C64 must be typed in with abbreviations.

\$\endgroup\$
1
  • \$\begingroup\$ Welcome to Code Golf, and nice answer! I've edited it a bit to improve the formatting, feel free to change it back if I've messed anything up. \$\endgroup\$ Commented Nov 17, 2023 at 0:35
2
\$\begingroup\$

Desmos Graphing Calculator, 75 74 bytes

Display to the screen, eh?

a=[1...9]
b=0a-4
c=[-2...0]
(0a,a) **
(0a,a-3) ****
(b,c) ****
(-b,c) ****

Pasting that in directly will fail because the asterisks are actually part of the label.

Try it on Desmos!

\$\endgroup\$
4
  • 1
    \$\begingroup\$ First of all, it's nice to see a Desmos golf by someone other than me once in a while, and I hope you stick around! Also, as for your actual code, Label: does not need to be included in the byte count, but the asterisks should be contained in their own line to indicate a so-called "file boundary", as mentioned in this meta post on scoring Desmos code. In this case, the expression box of the label would be considered a different "file" than that of the point, so you need a file boundary. \$\endgroup\$
    – Aiden Chow
    Commented Nov 19, 2023 at 23:43
  • \$\begingroup\$ Also even with your current code, I am not entirely sure how you got 75 bytes. I'm getting 73 bytes. But regardless, there is the problem I mentioned above, and also the fact that (0a,a) is only labelled with **, not **** which is what you put in the code box. \$\endgroup\$
    – Aiden Chow
    Commented Nov 19, 2023 at 23:46
  • \$\begingroup\$ Also, c=[-2...0] is shorter than c=[1...3]-3 by one byte. \$\endgroup\$
    – Aiden Chow
    Commented Nov 19, 2023 at 23:48
  • \$\begingroup\$ Implementing all my changes gives a final byte count of 74 bytes: Try It On Desmos! \$\endgroup\$
    – Aiden Chow
    Commented Nov 19, 2023 at 23:55
1
\$\begingroup\$

C (GCC), 126 83 bytes (thanks to ceilingcat)

main(y){for(;y<14;puts("********"+(y<=9)*6+3/++y*2))printf("    **"+(y>2)+y/10*3);}

Attempt This Online!

\$\endgroup\$
0
1
\$\begingroup\$

Wolfram Language (Mathematica), 63 bytes

Uncompress@"1:eJxTTMoPCm5nYGBQAAItrRgDQyMUlpYWtZhacICPBwCDVxow"

It's a bit cheeky, but it gets the job done.

Try it online!

\$\endgroup\$
1
\$\begingroup\$

Python 3.8 (pre-release), 63 bytes

for i in[[4,2]]*2+[[3,4]]*7+[[0,10]]*3:print(" "*i[0]+"*"*i[1])

Try it online!

\$\endgroup\$
0
\$\begingroup\$

Ruby, 42 bytes

puts"    **
"*2,"   ****
"*7,("*"*10+$/)*3

Attempt This Online!

\$\endgroup\$
1
2

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.