# 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:" – 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. – James T Aug 4 '16 at 12:58
• @LeakyNun Leaderboard snippet please! – anna328p 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

# Braingolf, 18 bytes

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


# Marbelous, 81 bytes

@0
0A
>0\/
--
&0@1
&10B
@0&0
@1/\@2
@3@2
--/\\\..@4
>0&1&1/\&2
&2\/--@4/\s*
@3
:s*
2A
{0


Marbelous is a language based on marble machines

this program is composed of 4 subparts :

### the main loop

a while loop going from 10 to 0, realease &0, and wait for &1 to be released before continuing

@0
0A
>0 \/
--
&0
&1
@0


### the 11(0B) generator

a structure sending 11 (0B) to the portal @2 when the synchroniser group &0 is released

.. @1
.. 0B
.. &0
@1 /\ @2


### the printer

a while loop waiting for something in @2 it then print that value minus 1 asterisk finish by printing the ascii value of @2-1 (which is 10(\n) here) and release synchroniser &1

@3 @2
-- /\ \\ .. @4
>0 &1 &1 /\ &2
&2 \/ -- @4 /\ s*
@3


### asterisk creator

board transforming the inputted marble into a 2A (ascii value of *)

:s*
2A
{0


## used language built-in are :

• .. is a noop
• 00-FF initiate a marble with this value
• @n (n from 0 to Z) is a portal which teleport the marble to another portal with the same value
• &n (n from 0 to Z) is a synchroniser, hold the marble until all corresponding synchroniser (same n) are full
• \/ is a trash can
• /\ create a duplicate passing marble to it's left and right
• marbles going out of the machine from the bottom are implicitly outputed
• -- is a decrement
• \\ is a right deflector, the marble go right
• >n (n from 0 to Z) is a conditional, if marble > n then noop else go right

### boards

it also uses a board, boards are created with :name at the start of a new line with name being anything you want, they have special built-in

• }n (n from 0 to Z) input argument
• {n (n from 0 to Z) returned output

Boards execution pause the caller execution until finished

interpretor

# CJam, 8 bytes

'*A*N+A*


Explanation:

'*          Push an asterisk
A*        Multiply by 10
A*    Multiply by 10
Implicitly output


*<Ctrl-Shift-R><Ctrl-A><Ctrl-D><Ctrl-D><Ctrl-D><Ctrl-D><Ctrl-A><Ctrl-D><Ctrl-Shift-R><End><Enter><Ctrl-Shift-P>


Saved two keystrokes by using a macro. Explanation to come.

### Original code and explanation

*****<Ctrl-D><Del><Ctrl-D><Ctrl-D><Ctrl-D><Ctrl-D><Ctrl-A><Ctrl-D>→<Enter>


We start by inserting five asterisks. CtrlD duplicates this line, leaving the cursor at the end of the first line. Del removes the newline, so now we have a line of ten asterisks.

Four applications of CtrlD give us five lines of asterisks. Next, CtrlA CtrlD duplicates all five lines at once, but it doesn't include a newline between the copies:

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


Fortunately, the first half is still selected, so if we press , the cursor will be immediately after the tenth asterisk on the too-long line, and we can add the missing newline with Enter.

# GNU nano, 14 keystrokes

<C-6>*<C-K><M-:><C-U><C-U><C-U><C-U><C-U><M-:><M-;><C-K><M-;><M-;>


<C-X> refers to CTRL+X, <M+X> refers to META+X.

### Explanation

<C-6>         Start a selection block
*             Type an asterisk (typing does not affect the selection by default)
At this point, '*' is selected.
<C-K>         Delete the selection and put it into the cutbuffer. '*'
<M-:>         Start recording a macro
<C-U> (5x)  Paste 5 times, text is now '*****'
<M-:>         Stop macro recording. Macro pastes 5 times now.
<M-;>         Run the macro, pasting 5 more '*'s. Text is now '**********'
<C-K>         Delete the current line and put it in the cutbuffer. '**********\n'
<M-;><M-;>    Run the macro twice, pasting '**********\n' 10 times


Betcha didn't know nano had macros?

Video demo (done in Termux because of visible keyboard, --ignorerc just ignores any RC files that may alter the behavior)

# Batch, 42 bytes

@for /l %%a in (1,1,10) do echo **********


# vJASS (Warcraft 3), 100 76 bytes

Using //! import zinc "<code_path>" command to exclude //! zinc and //! endzinc.

library q{real w;function onInit(){for(0<=w<10){BJDebugMsg("**********");}}}


• Would you mind slowing down a bit on updating your answers, maybe wait for an hour or so before doing some more? The recently active page is getting flooded with older questions because of the edits, and it'd be good to let it settle down a bit – caird coinheringaahing Mar 11 at 22:44
• @ChartZBelatedly oh, okay. Sorry for my unintentional spam. – noise Mar 11 at 22:47
• No worries, just thought it'd be worth letting you know :) – caird coinheringaahing Mar 11 at 22:48

# Python 3, 23 bytes

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


Try it online!

# R, 39 bytes

cat(c("*","\n")[(0:219)%%21/10],sep='')


Don't know if R coercing indices to integer is commonly used, so thought it worth posting in case someone can do something extra with it!

• Sure, navigating among so many answers is a nightmare, but different variations of doing this in R were extensively discussed here. – Kirill L. Mar 15 at 9:55
• Fair point @KirillL. and I would have posted a comment but didn't have the reputation yet - ironically, posting the new answer has given me some of the reputation I need to do it... – Nick B Mar 15 at 21:17

# 05AB1E, 7 bytes

'*T×TF,


Try it online!

'*T×TF,  # full program
'*T×     # push "**********"
TF   # repeat 10 times...
,  # output top of stack to STDOUT
# (implicit) exit loop


# 05AB1E, 7 bytes

'*т×Tä»


Try it online!

'*т×Tä»  # full program
»  # join....
т×     # 100...
'*       # asteriks...
ä   # split into...
T    # 10...
ä   # pieces...
»  # by newlines
# implicit output


# CSASM v2.3.0.1, 50 bytes

func main:
push "**********\n"
push 10
mul
print
ret
end


mul duplicates a <str> value by a given <i32> amount, concatenating the copies together

# GFortran, 31 29 bytes

print'(10A)',('*',j=0,99)
end


The loop ('*',j=0,99) spits out 100 *s. Formatting directive '(10(A))' '(10A)' wraps it.

try it online!

31 bytes

• this shows that (fortran.ge.javascript) – roblogic Mar 15 at 1:22
• FWIW Gnu f95 doesn't is happy with this print'(10A)',('*',j=0,99) as the print line, meaning it does the right thing with 10A instead of 10(A), which drops 2 more characters. – cnamejj Mar 24 at 6:39

# Factor, 30 bytes

10 [ "**********"print ] times


Try it online!

Okay, is there a factor vocabulary to print string $$\n$/extract_tex] times? I couldn't find a documentation? # Excel, 10 8 keystrokes In a fresh empty sheet, Ctrl+GJ10EnterCtrl+Shift+Home*Ctrl-Shift-Enter Explanation: • Ctrl+G is a shortcut for the GoTo dialog • Entering J10 goes to that cell • Enter closes the dialog • Ctrl+Shift+Home expands the selection to A1, making a grid of 10x10 cells • Then we put in the asterisk • Ctrl+Shift+Enter (instead of plain Enter) fills in the input over all selected cells # PHP, 69 Bytes <?for(i=1;i<101;i++){if(i%10!=0){echo('*');}else{echo('*<br>');}}  # Vyxal, 8 bytes \*₀*¶+₀*  Try it Online! -1 due to cairdcoinheringaahing Later I reduced another one • -1 byte – caird coinheringaahing Apr 25 at 17:19 • @cairdcoinheringaahing thax! – wasif Apr 25 at 17:20 • here's how to do it in 4 bytes. But I recommend you keep this because it is flagless – lyxal Apr 26 at 2:36 • Flagless, ₀(\*₀*, – A username May 14 at 8:54 # Barrel, 14 13 bytes ^42#10(#10p¶  Explanation: ^42 // push 42 to the accumulator #10 // do 10 times... ( // defines a code block which becomes a single instruction // (the parenthesis is self-closing) #10p // print the accumulator as an ASCII character 10 times ¶ // print a newline  EDIT: removed the closing parenthesis, saving 1 byte, since I found the reason hadn't been able to get it to work right (I had added a newline at the end of my test file! *sigh*). # Vyxal, jH, 654 3 bytes ×*²  Try it Online! ## Explained ×*² ×* # Push 100 asterisks onto the stack (as a single string) // the H flag initalises the stack with 100 ² # Split into pieces of 10 and use the j flag to join on newlines.  # Racket, 52 bytes (display(string-join(make-list 10"**********")"\n"))  If you're fine with just returning the string and not printing it, you can forego the (display) for a score of 41 bytes. An alternate answer (longer at 73 bytes, but I like it better personally): (display(build-string 110(λ(n)(if(eq?(remainder n 10)0)#\newline #\*))))  ## Batch, 41 bytes @for /l %%i in (0,1,9)do @echo **********  • You can shave off 1 byte by removing the first @ – SomethingDark Aug 6 '16 at 3:44 • @SomethingDark But then it would print for /l %%i in (0,1,9)do @echo **********... – Neil Aug 6 '16 at 9:39 • It didn't when I tested it – SomethingDark Aug 6 '16 at 9:39 • @SomethingDark You mean as an immediate command? As it's a single line, you might be on to something there. – Neil Aug 6 '16 at 9:45 • As both an immediate command (in which case you could save an additional byte by using %i instead, but I need to double-check the rules for this language) and in a script. – SomethingDark Aug 6 '16 at 9:46 BASH, 46 bytes for((n=0;n<10;n++));do echo "**********"; done  • Or for n in {0..9};{ echo "**********";} – manatwork Aug 4 '16 at 12:43 • Or seq -f%10g 10|tr -c \\n \* in Bash + coreutils. – manatwork Aug 4 '16 at 14:52 ## Frink, 40 39 Bytes for r=0 to 9 println[repeat["*",10]]  -1 Byte @LeakNun • You can probably use 0 to 9 – Leaky Nun Aug 4 '16 at 11:18 # Maple 30 bytes printf(cat("**********\n"10))  # C, 84 bytes #include<stdio> int main(){int i;for(i=0;i<10;i++){printf("**********\n");return 0;}  If anyone can improve the answer, I'd appreciate it. I'm not trying to compete, it's just been simply ages since I've coded C or C++ and this challenge looked fun. • – Digital Trauma Aug 4 '16 at 15:17 • C function without a return? that's a paddlin'. But thanks, I didn't see that answer before so I'm going to study it now. – Joel Trauger Aug 4 '16 at 15:59 # Sprects, 22 bytes #eeep#eppp#pqqq* #q***  Note: The interpreter uses U+0020 instead of U+0010. # C, 47 bytes main(i){while(i<111)putchar(10|!!(i++%11)<<5);}  Try it online. Not as compact as the other C answer (putchar is such a long name!), but I don't use the asterisk character in my program. It treats the output as a 11 by 10 grid, where the 11th character is the newline. It then computes the ASCII for '*' (10 + 32 = 42) or '\n' (10) for each position. I could save one byte with this approach if I were to change the character expression to: 42-!(i++%11)*32, but that would require an asterisk. # EXCEL, 26 bytes. =REPT("**********[ae]",10)  Can go into any cell. • What is [ae]? Is that Alt+Enter (the means to input a line break in Excel)? You can include the line break in the code here. It would be 23 bytes total. – Engineer Toast May 4 '17 at 13:03 # tinyAll, 17 bytes The current version (untouched for a LONG time), is extremelly broken, but works enough for this challenge. P'*Ra_P" [:;]"R9_  Basically: • Pass * to the R(repeat) function • Repeat it a (10) times • Output it (_) • Pass the output (;), through string interpolation, prefixed by a newline • To the R function • And repeat 9 more times • And display the result A boring alternative, with the same byte count: P"********** "Ra_  Translating: • Pass "**********  (newline) • To the R function, to repeat a (10) times • And output the result (_) Try it: // Commit https://github.com/ismael-miguel/tinyall/commit/2589837678f4b6556d1bd22f163255e2e058808e#diff-65af36bb0dc600cbc7a54816dcda57fd (function(window, undefined) { var funcs = { //echo '_':function(value, data){ var tmp = data.out + (value === undefined ? data.last : value); data.vars[';'] = data.out = tmp; return tmp; }, //array A:function(value, data){ var split_value = (value || '').split(/(\-?\d+(?:\.\d*)?(?:[eE][\-+]?\d+)?|'(?:\\'|[^']*)*'),?/); var final_value = []; for(var i = 0, l = split_value.length; i<l; i++) { if(split_value[i][0] == '\'') { final_value[final_value.length] = split_value[i].replace(/^'(.*)'/,'1').replace(/\\'/g,'\''); } else if(split_value[i]/1 || split_value[i] == '0') { final_value[final_value.length] = +split_value[i]; } } return final_value; }, //comparison functions C:function(value, data){ }, D:function(value, data){ var debug = { value: value, type: typeof value, memory: data } if(console && console.log) { console.log(debug); } return value; }, //eval E:function(value, data){ run_code(value, data); }, //flip the value around F:function(value, data){ if(('object' === typeof value) && value.reverse) { return value.reverse(); } else { return value.toString().split('').reverse().join(''); } }, //hello worlds H:function(value) { return 'hH'[value&1] +'ello' +(value&2?',':'') +' ' +('wW'[+!!(value&4)]) +'orld' +(value&8?'!':'') +(value&16?'\n':''); }, //math functions M:function(value, data){ }, //not (inverts values/casing) N:function(value) { switch(typeof value) { case 'boolean': return !value; case 'number': return -value; case 'string': var tmp = ''; for(var i = 0, l = value.length; i < l; i++) { if(value[i] >= 'a' && value[i] <= 'z') { tmp += String.fromCharCode(value.charCodeAt(i) - 32); } else if(value[i] >= 'A' && value[i] <= 'Z') { tmp += String.fromCharCode(value.charCodeAt(i) + 32); } else { tmp += value[i]; } } return tmp; default: return 0; } }, //passthrough P:function(value) { return value; }, //repeat R:function(value, data){ var tmp = ''; if(value > 0) { while(value--) { tmp += data.last; } } return tmp; }, //string functions S:function(value, data){ var methods = { t:function(value){ return value.replace(/^\s+/,'').replace(/\s+/,''); }, u:function(value){ return value.toUpperCase(); }, T:function(value ){ }, R:function(value){ } }; var tmp = data.last.toString(); for(var i = 0, l = value.length; i < l; i++) { tmp = value[i] in methods ? methods[value[i]](tmp, value, i) : ''; } return tmp; }, //clears output Z:function(value, data) { return data.vars[';'] = data.out = 0; } }; var expand_string = function(value, data){ return value.replace( /\[:(?:([A-Z_])(.)?|([^A-Z_'"]))$/g,
function(_, func, arg, value){
if(func)
{
return funcs[func](get_value(arg, data, true), data);
}
else
{
return get_value(value, data, true);
}
}
);

};

var get_value = function(value, data, recursion) {

if(value === null || value === undefined || value === ' ')
{
return undefined;
}

var x = (value || '').toString();

if(/^\-?\d+(?:\.\d*)?(?:[eE][\-+]?\d+)?$/.test(x)) { //returns a number return +x; } else if(/^[a-z]$/.test(x))
{
//returns a number between 10-43
return (x in data.vars) ? data.vars[x] : x.charCodeAt(0) - 87;
}
else if(x[0] == '\'')
{
return x[1];
}
else if(x[0] == '"' && x.length >= 2)
{
var sub = x.substr(1, x.length - 2);

return recursion ? sub : expand_string(sub, data);
}
else
{
return data.vars[x];
}
};

var run_code = function(code, memory){

if(!code || /^[a-z\d]\$/.test(code))
{
memory.out = funcs.H(get_value(code, memory));
}
else
{
code.toString().replace(
// /(?:([^A-Z_:'"])=)?([A-Z_])(?::('.|"[^"]*"|-?\d+|.))?/g,
/(?:([^A-Z_'"])=)?([A-Z_])(?:('.|"[^"]*"|-?\d+|[^A-Z_'"]))?/g,
function(_, name, func, value){

memory.vars[name || ':'] = memory.last = (funcs[func] || noop)( value ? get_value(value, memory) : memory.last, memory);

return '';
}
);
}
}

var noop = function(){};

window.tinyAll=function(code, input) {
var data = {
out: '',
last: 0,
input: input || 0,
vars: {
//version
'|':'0.3',
//input
':':input || 0,
//output
';':0,
//code
'.':(code || '').toString()
}
};

run_code(data.vars['.'], data);

return data.out || 0;
};
})(Function('return this')());

//RUN THE CODE!!!
//\n instead of a real newline, but works the same
console.log(tinyAll('P\'*Ra_P"\n[:;]"R9_'));
console.log(tinyAll('P"**********\n"Ra_'));

PostgreSQL, 39 bytes

select repeat('**********'||chr(13),10)


# 99, 137 bytes

99999 9 9
9999 99999 9
999 99 9
999999 99 9

99 99 9 99 9 99 9 99 9999
99
99
99
99
99
99
99
99
99
99
999999
999 999 9
99 999
9 99999


Try it online!