# 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.

Here is a Stack Snippet to generate both a regular leaderboard and an overview of winners by language.

/* Configuration */

var QUESTION_ID = 88653; // Obtain this from the url
// It will be like https://XYZ.stackexchange.com/questions/QUESTION_ID/... on any question page
var COMMENT_FILTER = "!)Q2B_A2kjfAiU78X(md6BoYk";
var OVERRIDE_USER = 48934; // This should be the user ID of the challenge author.

/* App */

return "https://api.stackexchange.com/2.2/questions/" +  QUESTION_ID + "/answers?page=" + index + "&pagesize=100&order=desc&sort=creation&site=codegolf&filter=" + ANSWER_FILTER;
}

}

jQuery.ajax({
method: "get",
dataType: "jsonp",
crossDomain: true,
success: function (data) {
data.items.forEach(function(a) {
});
comment_page = 1;
}
});
}

jQuery.ajax({
method: "get",
dataType: "jsonp",
crossDomain: true,
success: function (data) {
data.items.forEach(function(c) {
if (c.owner.user_id === OVERRIDE_USER)
});
else process();
}
});
}

var SCORE_REG = /<h\d>\s*([^\n,]*[^\s,]),.*?(\d+)(?=[^\n\d<>]*(?:<(?:s>[^\n<>]*<\/s>|[^\n<>]+>)[^\n\d<>]*)*<\/h\d>)/;

function getAuthorName(a) {
return a.owner.display_name;
}

function process() {
var valid = [];

var body = a.body;
if(OVERRIDE_REG.test(c.body))
body = '<h1>' + c.body.replace(OVERRIDE_REG, '') + '</h1>';
});

var match = body.match(SCORE_REG);
if (match)
valid.push({
user: getAuthorName(a),
size: +match[2],
language: match[1],
});

});

valid.sort(function (a, b) {
var aB = a.size,
bB = b.size;
return aB - bB
});

var languages = {};
var place = 1;
var lastSize = null;
var lastPlace = 1;
valid.forEach(function (a) {
if (a.size != lastSize)
lastPlace = place;
lastSize = a.size;
++place;

.replace("{{NAME}}", a.user)
.replace("{{LANGUAGE}}", a.language)
.replace("{{SIZE}}", a.size)

var lang = a.language;
if (/<a/.test(lang)) lang = jQuery(lang).text();

languages[lang] = languages[lang] || {lang: a.language, user: a.user, size: a.size, link: a.link};
});

var langs = [];
for (var lang in languages)
if (languages.hasOwnProperty(lang))
langs.push(languages[lang]);

langs.sort(function (a, b) {
if (a.lang > b.lang) return 1;
if (a.lang < b.lang) return -1;
return 0;
});

for (var i = 0; i < langs.length; ++i)
{
var language = jQuery("#language-template").html();
var lang = langs[i];
language = language.replace("{{LANGUAGE}}", lang.lang)
.replace("{{NAME}}", lang.user)
.replace("{{SIZE}}", lang.size)
language = jQuery(language);
jQuery("#languages").append(language);
}

}
body { text-align: left !important}

width: 290px;
float: left;
}

#language-list {
width: 290px;
float: left;
}

font-weight: bold;
}

table td {
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<tr><td></td><td>Author</td><td>Language</td><td>Size</td></tr>

</tbody>
</table>
</div>
<div id="language-list">
<h2>Winners by Language</h2>
<table class="language-list">
<tr><td>Language</td><td>User</td><td>Score</td></tr>
<tbody id="languages">

</tbody>
</table>
</div>
<table style="display: none">
</tbody>
</table>
<table style="display: none">
<tbody id="language-template">
</tbody>
</table>

• @DylanMeeus "You are to print this exact text:" – Leaky Nun 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. – Trotski94 Aug 4 '16 at 12:58
• @LeakyNun Leaderboard snippet please! – dkudriavtsev Aug 4 '16 at 22:08
• 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. – dwana Aug 5 '16 at 9:14
• you say trailing new lines are acceptable. Are leading newlines acceptable too? – Albert Renshaw Feb 10 '17 at 2:34

## ArnoldC, 171 bytes

IT'S SHOWTIME
HEY CHRISTMAS TREE i
YOU SET US UP 10
STICK AROUND i
TALK TO THE HAND "**********"
GET TO THE CHOPPER i
GET DOWN 1
ENOUGH TALK
CHILL
YOU HAVE BEEN TERMINATED


Just for the fun of it. Nothing fancy going on here, just loops 10 times printing ********** each time.

• I think you're missing a HERE IS MY INVITATION i between lines 6 and 7. – ceilingcat Sep 4 '17 at 3:54

# Racket, 43 36 bytes

It's nice to see friendly Racket competition on here :).

(for([i 10])(displayln"**********"))

• Can be shorter with just (i 10) rather than (i (range 10)). – rnso Sep 6 '16 at 23:11

## QBIC, 18 bytes

[1,z:?@**********|


Explanation

[ starts a for-loop
@**********| introduces the string literal "**********" and ? prints it
z is short for 10
FOR-loops are auto-closed at the end of the program code.


If you'd like me to demonstrate more features of QBIC, upvote this: Showcase of Languages

QBIC's a work-in-progress. The current state would allow us to solve this in 15 bytes:

    [|?@**********


[ starts a FOR-loop, but the number of arguments is flexible. When | directly follows [, the FOR loop runs from 1 to 10. One argument makes it go from 1 to N, two args runs from M to N and three args introduces an increment:

[3,11,2| --> FOR a=3 TO 11 STEP 2 (or JS-style: for(a=3;a<11;a=a+2){} )

• Maybe put a link to QBIC, for those who aren't familiar with a language? – user48538 Aug 4 '16 at 9:57
• @zyabin101 I've added a link. – steenbergh Aug 4 '16 at 10:42

# Charcoal, 4 bytes (non-competing)

The language is newer than the question.

Ｇ+α*


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 (*).

• – totallyhuman Sep 3 '17 at 23:01

# Brain-Flak, 77 bytes

(((()()()()()){})<>){({}<((((((((((<>(((({})<>)){}){}()()))))))))))>[()])}{}


Try it online!

The naive approach is 91 bytes:

((()()()()()){}){({}<((((((((((((((()()()){}()){})){}{}))))))))))((()()()()()){})>[()])}{}


But this approach holds an extra ten on the alternate stack to create large numbers easier. Unfortunately, since looping is so expensive in brain-flak, it's actually shorter to just push * 10 times directly rather then setting up a loop to do it.

I'm sure this could be made shorter.

## Javascript: 65 bytes

s="";for(i=1;i<=100;i++){s+="*";if(i%10==0)s+="\n"}console.log(s)


-- After it has been pointed out to me in the comments on the question, that we don't have to care about the dev-tools combining repeated output (as it can be turned off) I rewrote it as following

## Javascript: 42 40 bytes

i=10;while(i--)console.log("**********")


(Saved 2 bytes thanks to @kamoroso94)

• Better change that if into ternary operator and combine it with previous concatenation: s+="*"+(i%10?"":"\n"). This way, having a single instruction, you can remove the surrounding braces too. – manatwork Aug 4 '16 at 12:52
• Only do the loop to 10, and remove the if.... to add the new line. Spell out the *s and the \n in one string. – gabe3886 Aug 4 '16 at 12:56
• Replace the for loop with i=10;while(i--) to save 2 bytes. – kamoroso94 Aug 4 '16 at 22:56
• for(i=10;i--;) is even shorter – Patrick Roberts Aug 4 '16 at 23:58

# 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 :) – DJMcMayhem 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 – applejacks01 Aug 4 '16 at 15:30
• @applejacks01 Thanks for your input. I have modified it. – Anuj Tripathi Aug 4 '16 at 15:32
• Couldn't you just do Select top 10 '**********' from systypes? – pinkfloydx33 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

# JVM Bytecode, 309 bytes

Hexdump output because the entire file is hex:

00000000  ca fe ba be 00 03 00 2d  00 15 01 00 16 28 5b 4c  |.......-.....([L|
00000010  6a 61 76 61 2f 6c 61 6e  67 2f 53 74 72 69 6e 67  |java/lang/String|
00000020  3b 29 56 01 00 08 74 6f  53 74 64 6f 75 74 07 00  |;)V...toStdout..|
00000030  13 07 00 0c 01 00 26 28  4c 6a 61 76 61 2f 6c 61  |......&(Ljava/la|
00000040  6e 67 2f 53 74 72 69 6e  67 3b 29 4c 6a 61 76 61  |ng/String;)Ljava|
00000050  2f 6c 61 6e 67 2f 53 74  72 69 6e 67 3b 01 00 06  |/lang/String;...|
00000060  63 6f 6e 63 61 74 01 00  04 43 6f 64 65 01 00 04  |concat...Code...|
00000070  6d 61 69 6e 01 00 0a 53  6f 75 72 63 65 46 69 6c  |main...SourceFil|
00000080  65 0c 00 06 00 05 0c 00  02 00 12 01 00 10 6a 61  |e.............ja|
00000090  76 61 2f 6c 61 6e 67 2f  53 74 72 69 6e 67 0a 00  |va/lang/String..|
000000a0  03 00 0b 01 00 0b 2a 2a  2a 2a 2a 2a 2a 2a 2a 2a  |......**********|
000000b0  0a 08 00 0e 0a 00 04 00  0a 07 00 07 01 00 15 28  |...............(|
000000c0  4c 6a 61 76 61 2f 6c 61  6e 67 2f 53 74 72 69 6e  |Ljava/lang/Strin|
000000d0  67 3b 29 56 01 00 15 73  75 6e 2f 6d 69 73 63 2f  |g;)V...sun/misc/|
000000e0  4d 65 73 73 61 67 65 55  74 69 6c 73 01 00 00 00  |MessageUtils....|
000000f0  20 00 11 00 03 00 00 00  00 00 01 00 09 00 08 00  | ...............|
00000100  01 00 01 00 07 00 00 00  22 00 03 00 01 00 00 00  |........".......|
00000110  16 12 0f 59 b6 00 10 59  59 b6 00 10 59 b6 00 10  |...Y...YY...Y...|
00000120  b6 00 10 b8 00 0d b1 00  00 00 00 00 01 00 09 00  |................|
00000130  00 00 02 00 14                                    |.....|
00000135


To minimize size, I:

• Used the classs name "Code" to avoid putting another entry into the constant table
• Set the SourceFile to an empty string

• Used sun.misc.MessageUtils.toStdout() rather than System.out.println() to avoid an extra get static instruction, which also let me avoid having to juggle to keep it on the stack

• Used exponentially growing dups and String.concat() rather than having a loop
• Extended the class from sun.misc.MessageUtils to avoid having an entry for java.lang.Object on the stack

The jasmin assembler code used to generate this class is:

.source ""
.class Code
.super sun/misc/MessageUtils
.method public static main([Ljava/lang/String;)V
.limit stack 3
ldc "**********\n"
dup
invokevirtual java/lang/String/concat(Ljava/lang/String;)Ljava/lang/String;
dup
dup
invokevirtual java/lang/String/concat(Ljava/lang/String;)Ljava/lang/String;
dup
invokevirtual java/lang/String/concat(Ljava/lang/String;)Ljava/lang/String;
invokevirtual java/lang/String/concat(Ljava/lang/String;)Ljava/lang/String;
invokestatic sun/misc/MessageUtils/toStdout(Ljava/lang/String;)V
return
.end method


and the CFR decompiler output for this class is:

/*
* Decompiled with CFR 0_125.
*/
import sun.misc.MessageUtils;

class Code
extends MessageUtils {
public static void main(String[] arrstring) {
String string = "**********\n".concat("**********\n");
String string2 = string.concat(string);
MessageUtils.toStdout(string.concat(string2.concat(string2)));
}
}


# Wumpus, 22 bytes

)"*"9&=l(&o
}@?!-)9=N}


Try it online!

### Explanation:

) increment the counter
"*" push an asterisk to the stack
9&= Duplicate it 9 times (leaving 10 copies)
l(&o Print length of stack-1 times
Reflect off the end of the line and go South-West
} Turn right by 60 degrees, now going West along the second line
N  Print a newline
=  Duplicate the counter
!-)9  Check if it is equal to 10
@? If so, end the program
} Else turn right and go back to the start of the first line


# Python 3, 29 23 bytes

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


Thanks to orlp for shaving off 6 bytes.

• We require either a full program or a function. An expression is not sufficient. – orlp Aug 4 '16 at 9:35
• Yes, I'm referring to your second paragraph. – orlp Aug 4 '16 at 9:36
• print((10*"*"+"\n")*10) is shorter. – orlp Aug 4 '16 at 9:37
• darnit we had the same answer :( – Destructible Lemon Aug 4 '16 at 9:50
• Changing print to exit will save 1 byte and still output the result, there wasn't specified if it should be printed on standard output. – Gábor Fekete Aug 4 '16 at 13:50

## Golisp, 34 bytes

for[range@10{(_)writeln@*["**"5]}]


Due to a "bug", I can't concatenate strings...

• Congratulations! – Leaky Nun Aug 4 '16 at 10:29
• @LeakyNun For what? – TuxCrafting Aug 4 '16 at 10:30
• For developing a language. – Leaky Nun Aug 4 '16 at 10:30
• @LeakyNun Just look at my GitHub repos... – TuxCrafting Aug 4 '16 at 10:35
• I didn't say "for developing your first language" – Leaky Nun Aug 4 '16 at 10:35

# SpecBAS - 18 bytes

?(("*"*10)+#13)*10


? is shorthand for PRINT, #13 is the equivalent of \n in other languages.

## C#, 79 bytes

class P{void Main(){for(int i=0;i++<10;)System.Console.Write("**********\n");}}

• This won't run without static void right? – pay Aug 4 '16 at 15:49
• @pay has void already not sure if it needs static will check later when I have chance – TheLethalCoder Aug 4 '16 at 15:59

# golflua, 22 characters

~@i=0,9 w"**********"$ Sample run: bash-4.3$ golflua -e '~@i=0,9 w"**********"\$'
**********
**********
**********
**********
**********
**********
**********
**********
**********
**********


I have no idea how to score this, but I decided to give it a shot since there's an answer on Notepad.

Here's the sequence:

* * * * * CTRL (hold) A D D D D D D D D D D

# Bash (pure), 30 bytes

printf '%.s**********
' {0..9}


Test it on Ideone.

### How it works

Before calling the shell built-in printf, Bash expands the glob {0..9} to 0 1 2 3 4 5 6 7 8 9.

The format string

%.s**********


specifies a string whose first 0 characters are included in the output (%.s), followed by ten asterisks and a linefeed. printf repeats the format string as many times as needed to consume all arguments. Since .%s is an empty string, this results in the desired output.

# MSX BASIC, 40 30 bytes

1FORR=1TO10:FORC=1TO10:?"*";:NEXT:?:NEXT


Update: D'oh... much shorter if I just print whole rows:

1FORR=1TO10:?"**********":NEXT

• -1 byte: 1FORR=0TO9:?"**********":NEXT – mazzy Jul 2 '18 at 9:55

# Clojure, 38 bytes

(apply print(repeat 10"**********\n"))


Simple enough

• I'm afraid, that should be 38 bytes. Currently it prints only 8 x 8. – manatwork Aug 5 '16 at 13:17
• You are completely right. I keep posting wrong cases this whole day. – Michael M Aug 5 '16 at 13:52

## Scheme, 51 Bytes

(map (lambda (n)(display "**********\n"))(iota 10))


# Ruby, 26 20 bytes

10.times{puts'*'*10}


Try it online!

## Explanation

Runs 10 times; each time, it prints * (10 times), with an automatic line break at the end.

Kudos to OrangeFlash81 for saving me 6 bytes.

• I think 10.times{puts'*'*10} works as well and is shorter. – Aaron Christiansen Aug 7 '16 at 8:26

# PyMin, 14 bytes / 10 characters (non-competing)

»("*"Ҁ+ѿ)Ҁ


Non-competing because I added a few things.

Shorter version with v0.5:

### 13 bytes / 9 characters:

»("*"ҀƜ)Ҁ

• The repository was deleted. – A _ Nov 7 at 10:07

## Xtend, 33 bytes

[for(_:0..9)print('**********
')]


... a Java dialect; [] is a lambda definition

{{iiii}ii{c}{ddd}ddc{d}}


## how it works:

{foo} does foo exactly ten times. first, it starts a ten loop, in this loop, it sets the counter to 42, prints it ten times (as char (asterisk)), decrements it to 10, prints it (newline), subtracts 10, then loops again, doing this 10 times.

# Cubix, 26 bytes (non-competing)

Not a competing entry as the stack commands used post-date the question.

'*u.NNw\./>rroq(?;(?@....N


Try it here

This maps onto a side length 3 cube. Now to try and get rid of some of the no-ops and try and fit it on a side length 2 cube.

      ' * u
. N N
w \ .
/ > r r o q ( ? ; ( ? @
. . . . N . . . . . . .
. . . . . . . . . . . .
. . .
. . .
. . .

• / Redirect the flow to the top face
• '*u Add an * to the stack and u-turn
• NN Add a couple of 10's to the stack as counters
• >rroq Rotate the stack to bring the * to the top, output and push it to the bottom
• (? Decrement the top counter (character) and test.
• If zero ;( pop from stack, decrement next counter (line), otherwise go around to previous command set.
• ?@ Test the counter (line) and exit if zero
• No\w Add a 10 to the stack as a linefeed and a new character counter, output it and redirect back to the > to start the sequence again.

# Google Sheets, 31 23 bytes

Code:

In cell A1 (12 bytes):

=REPT(B1,10)


In cell B1 (11 bytes):

**********        # Contains New Line
# <--


Result:

Previous Attempt #1 (31 bytes):

=REPT(REPT("*",10)&CHAR(10),10)


Previous Attempt #2 (also 31 bytes):

=REPT("**********"&CHAR(10),10)


# Braingolf, 18 bytes [non-competing]

8V9R#*[.]#
[R&!@v]


Try it online!

## Explanation:

8V9R#*[.]#\n[R&!@v]
8                    Push 8
V                   Create stack2 and switch to it
9                  Push 9
#*               Push codepoint of *
[.]            Do-while loop, will run 9 times due to the 8 pushed at the start
.             Duplicate last item on stack
#\n         Push codepoint of newline
[R...v]  Do-while loop, uses stack2 for loop counting
Will run 10 times due to the 9 pushed at the start
&!@    Print entire stack1 without popping

• Please tag the answer with non-competing. – Leaky Nun Jun 8 '17 at 8:09
• 15 bytes – Leaky Nun Jun 16 '17 at 8:00

# S.I.L.O.S 45 bytes

All whitespace necessary due to my poor interpreter design.

a = 10
lbla
printLine **********
a - 1
if a a


Try it Online!

# Lua, 34 bytes

for i=1,10 do print"**********"end


# Befunge-93 (PyFunge), 28 bytes

#<90v0-1_@#:,
#^_ >1+"*",:9


Try it online!