# Background

This is a standard textbook example to demonstrate for loops.

This is one of the first programs I learnt when I started learning programming ~10 years ago.

You are to print this exact text:

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


# Specs

• You may have extra trailing newlines.
• You may have extra trailing spaces (U+0020) at the end of each line, including the extra trailing newlines.

# Scoring

This is . Shortest answer in bytes wins.

• @DylanMeeus "You are to print this exact text:" Aug 4 '16 at 12:56
• @DylanMeeus Since that is to do with the dev tools hiding repeated console outputs, and isn't native to JavaScript consoles as a whole and is not in the JavaScript spec - as well as the fact that feature can be turned off - i think it should be acceptable. Not all browsers will collapse it like that. Aug 4 '16 at 12:58
• One of the most interesting things about this challange is that depending on your language ********** can be shorter then a loop. Makes me wonder when it's better for a given language to switch between 1 or 2 loops. Aug 5 '16 at 9:14
• you say trailing new lines are acceptable. Are leading newlines acceptable too? Feb 10 '17 at 2:34

# Unary, 3584048336806633376708256331142263836115215 bytes

Can't post it here for obvious reasons.

But it's literally just 3584048336806633376708256331142263836115215 zeroes.

## Retina, 12 bytes

Byte count assumes ISO 8859-1 encoding. The leading linefeed is significant.


10$** .$_¶


The first stage writes a string of ten asterisks, the second stage replaces each asterisk with the entire string and a linefeed. This prints two trailing linefeeds.

# J, 10 9 bytes

• Also 9 bytes: '*'$~,~10 Aug 4 '16 at 18:26 ## Mathematica, 24 bytes Print@"**********"~Do~10  It's kinda unfortunate that StringRepeat alone is 12 characters long... # ///, 25 bytes /a/********** /aaaaaaaaaa  Try it online! A simple replace command. • It's screaming! – user42643 Aug 5 '16 at 14:08 # Julia, 23 22 bytes print(("*"^10*" ")^10)  See here to test on an online interpreter. Thanks @Dennis for the tip! • Try changing your code to function output. Aug 12 '16 at 23:06 # Sesos, 11 bytes With many thanks to Leaky Nun for his help, and credit to his Brainf*ck answer, which inspired this one. Golfing suggestions welcome. Try It Online! 0000000: A8 24 BE EC CB 82 06 BD A7 EC 0E .$.........


How it works

The binary file above has been generated by assembling the following SASM code.

add 42,fwd 1,add 10,fwd 1,add 10  # puts 42, 10, 10 in the register
jmp,sub 1,rwd 1                   # starts the first loop
jmp,sub 1,rwd 1,put,fwd 1,jnz     # second loop prints 42 or "*"
add 10,put,fwd 1                  # resets first loop, prints 10 or "\n"
# first loop ends implicitly

• Congratulations! Aug 5 '16 at 13:45

# T-SQL, 35 bytes

I used a hard carriage return in the string, which is why it wraps to the next line.

select replicate('**********
',10)

• Save 1 byte by using PRINT instead of SELECT Jan 30 '18 at 21:30

## DOG, 22 bytes

10 bark "**********\n"


Prints out ********** and a newline 10 times.

Try it online! (you'll have to manually copy the code since I don't have permalink functionality yet ;_;)

• A cat posting in DOG language... interesting, could have sworn you were sworn enemies of the household
– ʰᵈˑ
Aug 9 '16 at 7:59
• @ʰᵈˑHe's learning the enemy language to become a spy.
– user47018
Aug 9 '16 at 18:03
• @Midnightas ahaha yes!
– ʰᵈˑ
Aug 10 '16 at 8:24

# Perl 6,  19 17  16 bytes

say '*'x 10 for ^10
put '*'x 10 for ^10
put('*'x 10)xx 10
put(\*x 10)xx 10

Try it

## Explanation:

put(       # print with trailing newline
'*' x 10 # ｢*｣ string repeated 10 times
) xx 10    # list repeat the above 10 times


Apparently \* or \(*) which is short for Whatever.new.list.Capture when coerced to a Str turns into just *.

• I've recently discovered that \* (a Capture containing one Whatever) stringifies to the asterisk, at one less byte than '*'.
– smls
Mar 3 '17 at 7:18

# Common Lisp, SBCL, 393835323129 28 bytes

(format t"~10{~10@{*~}
~}"1)


Ideas for improvement are welcomed.

~10{...~} ;loops 10 times, doing inside loop and printing newline
~10@{*~}  ;loops 10 times, displaying ten "*"

• In this form it gives me an error, maybe '(1) instead of 1 ? Sep 28 '17 at 18:44
• @Renzo Are you sure you tried it in SBCL? It works for me both when written to REPL and when loaded from file. It is true however that it does not work in TIO - they use Clisp implementation I think.
– user65167
Sep 30 '17 at 15:19
• You are right, I tried it in CCL and in TIO, where it does not work. But, it works in SBCL. Sep 30 '17 at 19:13

# Lost, 15211611410595916057 54 bytes

66 bytes saved thanks to Jo King

v%<@(<<<<<<<<<<<<<<
\?\<>"**********h^"
/<>9v+^?:)-1+-


Try it online!

This program is unbelievably convoluted. I might explain it when I finished golfing it. For now here is a rough overview.

## Explanations

To the left we have

v%
\?\<


which catches and cleans the ip. It exits when ? fails to jump over \ pushing the ip down to

  (
>
>9v


which puts a counter set at 9 into the scope.

Then we push the string "**********h^". The ip wraps around to the other side and back down onto the next line moving backwards. The +- combines the last two characters to turn the h^ to a newline.

From here +^?:)-1 subtracts one from the counter or deflects the counter up to the top row if it is already zero. On its way to the top row * combines the two junk values we have lying around once on the top row we get rid of the last value with ( and exit with @.

• 62 bytes
– Jo King
Feb 6 '18 at 9:28
• @JoKing Nice! I'll add that as soon as I have a chance to fully digest all of your changes. Feb 6 '18 at 14:12
• Sorry, but 60 bytes
– Jo King
Feb 6 '18 at 22:13
• @JoKing Ok I've updated the answer. Thanks Feb 6 '18 at 22:37

## TSQL, 24bytes

PRINT'**********'
GO 10


My first submission, please be kind with any help :)

• Welcome to PPCG! Feb 7 '18 at 16:04
• Nice trick! Added it to the Tips for golfing in T-SQL thread. Sep 20 '18 at 15:58

# vim, 8 bytes

10a*<ESC>Y9p


<ESC> is 0x1b.

## Annotated

10a*<ESC>  # append * 10 times
Y          # copy line into default register
9p         # paste 9 times


Try it online!

• Congrats on posting in the Language of the Month! Apr 14 '21 at 22:37

# Python 3, 22 bytes

print("*"*10+"\n"*10)



Try it online!

thanks to - hyper-neutrino, for tips!

• Welcome to CGCC! You seem to have an extra trailing newline - your code is actually only 25 bytes because you don't need to count that. Additionally, you have an extra space after print that you don't need. Jun 20 '21 at 7:58
• thanks for your tip(s) @hyper-neutrino, I didn't notice that haha! I guess I shouldn't edit that now, it might be cheating :/ Jun 21 '21 at 16:40
• Why would it be? You can edit your answer to save bytes any time, and it's very common for people to suggest tips in comments; it's part of the game :) it's a competition, but more importantly we're all here to have fun and enjoy golfing. Jun 21 '21 at 17:07
• Oh, thanks! I'll do it then haha Jun 25 '21 at 8:10
• you should update the byte count and the TIO link as well Jun 25 '21 at 15:09

'""""""'""'"""'""""""'"""'""'""'""'""'""'""'""'""'""'"""'"""""'""'""""""'""'"""'""""""""'"""""""'""'"""'""""'""""'""""""'""'""'"""'"""""""'"""'"""""'""'""""""'""'""'"""'""""""""'"""""""'""'""'"""'"'""'""'""'""'""'""'""'""'""'""'""'""'""'""'""'""'""'""'""'""'""'""'""'""'""'""'""'""'""'""'""'""'"""""""'"""'"'"""""""'"""


Try it online!

That is quite ... unreadable, have some pseudocode:

Set 2 Set 1 10

While (Increment Set 2 Decrement Get 2)
Second Second
Set 3 Get 1
While (Increment Set 3 Decrement Get 3)
Print Increment*32 Get 1
Print Get 1


Transpile it online!

# Elixir53 bytes50 bytes48 bytes 40 bytes

IO.puts List.duplicate "**********\n",10


Run it online

Beginner to Elixir, any thoughts? :D

50 bytes thanks to Underslash

48 bytes thanks to Dom Hastings

40 bytes thanks to Jo King

• Couple of things, usually for answers its standard practice to include a link to some way to run it. A good website for this is TIO and if you look youll find Elixir there. Also, some basic things regarding your answer is always try to remove whitespace (in your case the " = " can be "=") but even better is doing this which comes out at 43 bytes. Good luck on future answers! Aug 12 '21 at 8:27
• Oh, something else, whitespace is counted in the bytecount, but websites like TIO automatically count bytes. Aug 12 '21 at 8:28
• Building on @JoKing's suggestion, you can also use List.duplicate instead of String for another -2: Try it online! Aug 12 '21 at 14:13
• A different approach entirely for 35: Try it online! Aug 12 '21 at 14:16
• Thanks Guys! :D I'll use what @DomHastings said about the List.duplicate. and oh yea they should be asterisks my bad :). I'll correct those! Thanks again! Aug 13 '21 at 10:03

# Tagscript, 45 bytes

{replace(a,\*\*\*\*\*\*\*\*\*\*
):aaaaaaaaaa}


I don't know where you can run this lang except through carlbot so heres a link to that

Does this count? haha

EDIT: Potentially controversial, but I can shave off 10 bytes if I don't escape the asterisks:

{replace(a,**********
):aaaaaaaaaa}


Carlbot doesn't actually parse asterisks as a special character, it's Discord's markdown system that displays the text as modified. The exact text context of the output would be

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



If this 35 byte solution is valid, I also argue that the original 45 byte solution is invalid, as while only the 10x10 of asterisks is displayed by Discord, the actual text context of Carlbot's message would be

\*\*\*\*\*\*\*\*\*\*
\*\*\*\*\*\*\*\*\*\*
\*\*\*\*\*\*\*\*\*\*
\*\*\*\*\*\*\*\*\*\*
\*\*\*\*\*\*\*\*\*\*
\*\*\*\*\*\*\*\*\*\*
\*\*\*\*\*\*\*\*\*\*
\*\*\*\*\*\*\*\*\*\*
\*\*\*\*\*\*\*\*\*\*
\*\*\*\*\*\*\*\*\*\*



Which would be incorrect.

# Python 2, 21 Bytes

exec"print'**'*5;"*10


Works in a similar way to Destructible Watermelon's Python 3 solution.

• Yay I inspired someone! Aug 4 '16 at 9:46
• Unfortunately, it only ties with the other Python 2 solution. :( Aug 4 '16 at 9:48
• Well, at least it is relevant in Python 2 Aug 4 '16 at 9:49
• Same length: exec"print'*'*10;"*10 Sep 20 '16 at 19:43

## CJam, 9 8 bytes

Thanks to Lynn for saving 1 byte.

'*A*N]A*


Try it online!

### Explanation

'*A*    e# Create a string of 10 asterisks.
N       e# Push a linefeed.
]       e# Wrap both in a list.
A*      e# Repeat 10 times.

• '*A*N]A* is 8 bytes.
– Lynn
Aug 4 '16 at 11:55

# ><>, 28 bytes

av
->:?!;av>~1ao
:-1o*76<^!?


Try it online!

# Befunge, 39 bytes

52*>52* v
,1-:!#v_>67*
#@_v  >\$52*,1-:!


Try it here!

• This is 39 bytes; you don't need to count the trailing newline Aug 4 '16 at 17:54
• Thanks, I guess my text editor put a trailing newline somewhere and added to the file size.
– user55852
Aug 4 '16 at 18:02
• Shorter version by switching the movement direction to be left instead of right: (36 bytes) ideone.com/GZi1PG Aug 4 '16 at 18:03

## Actually, 7 bytes

9u;'**n


Try it online!

Explanation:

9u;'**n
9u;      push two copies of 10
'*    push "*"
*   multiply by one of the copies, yielding "**********"
n  push 10 total copies of the string


# PowerShell, 14 bytes

0..9|%{'*'*10}


Items exiting the pipeline are automatically printed on individual lines by the default PowerShell host.

Hooray for * doing string repetition.

# Fuzzy Octo Guacamole, 15 bytes

'*'25**25*!_[X]


Explanation:

'*'              # Push '*'
25*           # Push 10
*          # Multiply, leaves '**********' ('*'*10)
25*!_     # Sets the for-loop counter to 10 (2*5)
[X]  # Iterates 10 times and prints '********' each time


# Lua 36 bytes

print((("*"):rep(10).."\n"):rep(10))


There is already a Lua answer, but his was however not a full program that would print output and this one is shorter.

I wanted to post it as a comment to that one, but I don't have the reputation yet.

• On which interpreter does this print output? Aug 6 '16 at 4:02
• @LeakyNun Whoops, my bad. I tested it with the Lua 5.3 interpreter but I started it in interactive mode. I fixed the code so that it also runs in non interactive mode. Aug 8 '16 at 10:08

# Chef, 252 bytes

Was purely for fun trying to learn Chef.

Try it online!

a.

Ingredients.
42 b
10 c
10 d
13 e

Method.
Put e into mixing bowl.
F the c.
Put b into mixing bowl.
F the c until fed.
Liquefy contents of the mixing bowl.
G the d.
Pour contents of the mixing bowl into the baking dish.
G the d until ged.

Serves 1.

• Nice answer! Welcome to the site :) Dec 20 '17 at 21:10

# TSQL, 45 bytes

SELECT TOP 10 REPLICATE('*',10) FROM systypes


Above query use TSQL REPLICATE function to replicate * 10 times and systypes is a system view in SQL Server which list out system specified and user defined data types.

Try it here

This is my answer on Code Golf and I hope I am doing it correctly.

• Welcome to PPCG! I would say you need to count those spaces in your bytecount, since they are required to execute your code Aug 4 '16 at 15:30
• @applejacks01 Thanks for your input. I have modified it. Aug 4 '16 at 15:32
• Couldn't you just do Select top 10 '**********' from systypes? Aug 6 '16 at 14:41
• Didn't see there was already a TSQL answer. You can do it in 24 bytes by just using Print and "Go 10"
– Paul
Feb 12 '18 at 11:25

# Backhand, 28 bytes

aH~0}|{:& [a ^v&v"*******" ^


Try it online!

It may seem weird that the quotes only contain 7 asterisks, but there's a reason for it.

### Explanation:

Note that the pointer usually moves in steps of 3

a         Push 10 as the counter
0 |{   Push 0 to not get reflected and enter the loop
&           Store the counter in the register
a        Push a newline
v v  Decrease the step value to 1
"*******"    Push 7 asterisks
^  Increase the step value to 2 and reflect
" * * * "    Push 3 asterisks
&   Restore the counter
^      Increase the step counter to 3
[         Decrement the counter
:    Duplicate the counter
}|      Repeat the loop if the counter is not zero
~     Otherwise, pop the excess copy of the counter
H      And terminate, printing the contents of the stack


# Charcoal, 4 bytes

Ｇ+α*


Try it online!

The code translates as: draw a filled polygon (Ｇ); give it four equal sides going in the four cardinal directions (+); each side should be 10 characters (α, a variable preinitialized to 10); use asterisks (*).

• Sep 3 '17 at 23:01