80
\$\begingroup\$

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.

Task

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.

Leaderboard

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 ANSWER_FILTER = "!t)IWYnsLAZle2tQ3KqrVveCRJfxcRLe";
var COMMENT_FILTER = "!)Q2B_A2kjfAiU78X(md6BoYk";
var OVERRIDE_USER = 48934; // This should be the user ID of the challenge author.

/* App */

var answers = [], answers_hash, answer_ids, answer_page = 1, more_answers = true, comment_page;

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

function commentUrl(index, answers) {
  return "https://api.stackexchange.com/2.2/answers/" + answers.join(';') + "/comments?page=" + index + "&pagesize=100&order=desc&sort=creation&site=codegolf&filter=" + COMMENT_FILTER;
}

function getAnswers() {
  jQuery.ajax({
    url: answersUrl(answer_page++),
    method: "get",
    dataType: "jsonp",
    crossDomain: true,
    success: function (data) {
      answers.push.apply(answers, data.items);
      answers_hash = [];
      answer_ids = [];
      data.items.forEach(function(a) {
        a.comments = [];
        var id = +a.share_link.match(/\d+/);
        answer_ids.push(id);
        answers_hash[id] = a;
      });
      if (!data.has_more) more_answers = false;
      comment_page = 1;
      getComments();
    }
  });
}

function getComments() {
  jQuery.ajax({
    url: commentUrl(comment_page++, answer_ids),
    method: "get",
    dataType: "jsonp",
    crossDomain: true,
    success: function (data) {
      data.items.forEach(function(c) {
        if (c.owner.user_id === OVERRIDE_USER)
          answers_hash[c.post_id].comments.push(c);
      });
      if (data.has_more) getComments();
      else if (more_answers) getAnswers();
      else process();
    }
  });  
}

getAnswers();

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

var OVERRIDE_REG = /^Override\s*header:\s*/i;

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

function process() {
  var valid = [];
  
  answers.forEach(function(a) {
    var body = a.body;
    a.comments.forEach(function(c) {
      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],
        link: a.share_link,
      });
    
  });
  
  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;
    
    var answer = jQuery("#answer-template").html();
    answer = answer.replace("{{PLACE}}", lastPlace + ".")
                   .replace("{{NAME}}", a.user)
                   .replace("{{LANGUAGE}}", a.language)
                   .replace("{{SIZE}}", a.size)
                   .replace("{{LINK}}", a.link);
    answer = jQuery(answer);
    jQuery("#answers").append(answer);

    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)
                       .replace("{{LINK}}", lang.link);
    language = jQuery(language);
    jQuery("#languages").append(language);
  }

}
body { text-align: left !important}

#answer-list {
  padding: 10px;
  width: 290px;
  float: left;
}

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

table thead {
  font-weight: bold;
}

table td {
  padding: 5px;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<link rel="stylesheet" type="text/css" href="//cdn.sstatic.net/codegolf/all.css?v=83c949450c8b">
<div id="answer-list">
  <h2>Leaderboard</h2>
  <table class="answer-list">
    <thead>
      <tr><td></td><td>Author</td><td>Language</td><td>Size</td></tr>
    </thead>
    <tbody id="answers">

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

    </tbody>
  </table>
</div>
<table style="display: none">
  <tbody id="answer-template">
    <tr><td>{{PLACE}}</td><td>{{NAME}}</td><td>{{LANGUAGE}}</td><td>{{SIZE}}</td><td><a href="{{LINK}}">Link</a></td></tr>
  </tbody>
</table>
<table style="display: none">
  <tbody id="language-template">
    <tr><td>{{LANGUAGE}}</td><td>{{NAME}}</td><td>{{SIZE}}</td><td><a href="{{LINK}}">Link</a></td></tr>
  </tbody>
</table>

\$\endgroup\$
  • \$\begingroup\$ I'm not that familiar with this. The chrome dev tools print repetition on one line. e.g, here it would print (10)********** is that acceptable, as we know it's a dev-tool 'optimisation'? \$\endgroup\$ – Dylan Meeus Aug 4 '16 at 12:37
  • 2
    \$\begingroup\$ @DylanMeeus "You are to print this exact text:" \$\endgroup\$ – Leaky Nun Aug 4 '16 at 12:56
  • 12
    \$\begingroup\$ @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. \$\endgroup\$ – Trotski94 Aug 4 '16 at 12:58
  • 6
    \$\begingroup\$ @LeakyNun Leaderboard snippet please! \$\endgroup\$ – dkudriavtsev Aug 4 '16 at 22:08
  • 1
    \$\begingroup\$ you say trailing new lines are acceptable. Are leading newlines acceptable too? \$\endgroup\$ – Albert Renshaw Feb 10 '17 at 2:34

264 Answers 264

5
\$\begingroup\$

Mathematica, 24 bytes

Print@"**********"~Do~10

It's kinda unfortunate that StringRepeat alone is 12 characters long...

\$\endgroup\$
5
\$\begingroup\$

Brainfuck, 74 bytes

first brainfuck submission ever, first reasonable length program, too

+++>>+++>>+++++++[<+<+<<+>>>>-]<[>++++++<-]<<<[->++++++++++[>>>.<<<-]>.<<]
+++>>+++>>+++++++[<+<+<<+>>>>-]<[>++++++<-] < sets tape to 10 0 10 0 42

                                           <<< moves to the first 10
            [->++++++++++[>>>.<<<-]>.<<] <
loops while the first cell of the tape is not zero:
    subtracts 1 from first cell
    sets the second cell to 10,
    loops while second cell is not zero: prints 42 cell, subtracts from second cell
    moves to third cell, prints it
\$\endgroup\$
  • \$\begingroup\$ 57 bytes \$\endgroup\$ – Leaky Nun Aug 4 '16 at 11:05
  • \$\begingroup\$ 48 bytes \$\endgroup\$ – Leaky Nun Aug 4 '16 at 11:06
  • \$\begingroup\$ 47 bytes \$\endgroup\$ – Leaky Nun Aug 4 '16 at 11:08
  • 11
    \$\begingroup\$ points for trying though, right..? ;_; \$\endgroup\$ – Destructible Lemon Aug 4 '16 at 11:13
  • \$\begingroup\$ also post the answer yourself \$\endgroup\$ – Destructible Lemon Aug 4 '16 at 11:14
5
\$\begingroup\$

Julia, 23 22 bytes

print(("*"^10*"
")^10)

See here to test on an online interpreter. Thanks @Dennis for the tip!

\$\endgroup\$
  • \$\begingroup\$ Try changing your code to function output. \$\endgroup\$ – Mama Fun Roll Aug 12 '16 at 23:06
5
\$\begingroup\$

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
\$\endgroup\$
  • \$\begingroup\$ Congratulations! \$\endgroup\$ – Leaky Nun Aug 5 '16 at 13:45
5
\$\begingroup\$

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)
\$\endgroup\$
  • 1
    \$\begingroup\$ Save 1 byte by using PRINT instead of SELECT \$\endgroup\$ – BradC Jan 30 '18 at 21:30
5
\$\begingroup\$

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 ;_;)

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

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

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

Common Lisp, SBCL, 39 38 35 32 31 29 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 "*"
\$\endgroup\$
  • \$\begingroup\$ In this form it gives me an error, maybe '(1) instead of 1 ? \$\endgroup\$ – Renzo Sep 28 '17 at 18:44
  • \$\begingroup\$ @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. \$\endgroup\$ – PrzemysławP Sep 30 '17 at 15:19
  • 1
    \$\begingroup\$ You are right, I tried it in CCL and in TIO, where it does not work. But, it works in SBCL. \$\endgroup\$ – Renzo Sep 30 '17 at 19:13
5
\$\begingroup\$

TSQL, 24bytes

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

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

\$\endgroup\$
4
\$\begingroup\$

Python 2, 21 Bytes

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

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

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

///, 25 bytes

/a/**********
/aaaaaaaaaa

Try it online!

A simple replace command.

\$\endgroup\$
  • 4
    \$\begingroup\$ It's screaming! \$\endgroup\$ – mınxomaτ Aug 5 '16 at 14:08
4
\$\begingroup\$

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.
\$\endgroup\$
  • 1
    \$\begingroup\$ '*A*N]A* is 8 bytes. \$\endgroup\$ – Lynn Aug 4 '16 at 11:55
4
\$\begingroup\$

><>, 28 bytes

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

Try it online!

\$\endgroup\$
4
\$\begingroup\$

Jelly, 8 bytes

”*x³s⁵j⁷

Try it online!

How it works

”*x³s⁵j⁷  Main link. No arguments.

”*        Yield '*'.
  x³      Repeat the character 100 times.
    s⁵    Split into chunks of length 10.
      j⁷  Join, separating by linefeeds.
\$\endgroup\$
  • \$\begingroup\$ You finally found a use for the default value of ³. \$\endgroup\$ – Leaky Nun Aug 4 '16 at 17:12
  • \$\begingroup\$ Here and in Fizz Buzz. \$\endgroup\$ – Dennis Aug 4 '16 at 17:14
  • \$\begingroup\$ Check it out Dennis...(and what a nice little wrapper you've made!) \$\endgroup\$ – Jonathan Allan Aug 7 '16 at 19:58
  • \$\begingroup\$ I'm guessing Y wasn't added yet when this was created? If so, now it's -1 byte. \$\endgroup\$ – AdmBorkBork Jun 6 '18 at 1:26
  • \$\begingroup\$ @AdmBorkBork It was added 8 days after the challenge was posted. :/ \$\endgroup\$ – Dennis Jun 6 '18 at 2:16
4
\$\begingroup\$

Befunge, 39 bytes

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

Try it here!

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

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
\$\endgroup\$
4
\$\begingroup\$

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.

\$\endgroup\$
4
\$\begingroup\$

Unary, 3584048336806633376708256331142263836115215 bytes

Can't post it here for obvious reasons.

But it's literally just 3584048336806633376708256331142263836115215 zeroes.

\$\endgroup\$
4
\$\begingroup\$

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
\$\endgroup\$
4
\$\begingroup\$

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.

\$\endgroup\$
  • 1
    \$\begingroup\$ On which interpreter does this print output? \$\endgroup\$ – Leaky Nun Aug 6 '16 at 4:02
  • \$\begingroup\$ @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. \$\endgroup\$ – Seeseemelk Aug 8 '16 at 10:08
4
\$\begingroup\$

Lost, 152 116 114 105 95 91 60 57 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 @.

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

Cheddar, 24 bytes

print(['*'*10]*10).vfuse

'*'*10 builds the string **********.

Then, ['**********']*10 creates 10 copies of that string.

Then, vfuse joins by newline.

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

Perl, 17 bytes

Requires -E at no extra cost.

say"*"x10for 0..9

Usage

perl -E 'say"*"x10for 0..9'
**********
**********
**********
**********
**********
**********
**********
**********
**********
**********

Saved a byte thanks to @manatwork!

\$\endgroup\$
  • 1
    \$\begingroup\$ Keywords may touch the preceding digits. \$\endgroup\$ – manatwork Aug 4 '16 at 12:27
  • \$\begingroup\$ @manatwork Ahhh... I always forget that works, expecially as for0.. doesn't! Thanks! \$\endgroup\$ – Dom Hastings Aug 4 '16 at 12:29
  • 1
    \$\begingroup\$ I literally typed out the same program :) \$\endgroup\$ – simbabque Aug 4 '16 at 14:14
3
\$\begingroup\$

><>, 35 bytes

ab*1-:?!v:20.
>'*'o72.~
^?%b;!?l<oa

Try it online!

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

dc, 22 18 bytes

[**********]ddddff

Invoked in bash as

echo [**********]ddddff | dc

Explanation:

[**********] # This is dc's way of making a string, which is then pushed onto the stack
dddd         # d is for duplicate, so we duplicate it 4 times on the stack
ff           # print the whole stack twice, which contains 5 repetitions of 10 *'s (x2)

Thanks to LeakyNun for saving 5 4 bytes; Edited from 5 since I can't count.

\$\endgroup\$
  • 1
    \$\begingroup\$ Ah, right! f doesn't clear the stack. Alternatively, ...dfffff would accomplish it as well with the same byte count. Come to think, ...ddfffp would work just as well (3 sets of three and then just one). There are a lot of ways to get 10 reps with 6 bytes. \$\endgroup\$ – Delioth Aug 4 '16 at 17:45
3
\$\begingroup\$

C#, 53,122 108 bytes

Seeing that I'm seriously new to code golf... I'll give it a shot in c#

public class Program{public static void Main(){for (var i=0;i<10;i++)System.Console.Write("**********\n");}}

try it online

\$\endgroup\$
  • \$\begingroup\$ for(var i=0;i++<10;)Console.Write("**********\n"); is shorter, also, you need a full program or function. \$\endgroup\$ – ASCII-only Aug 4 '16 at 11:08
  • \$\begingroup\$ @MarsUltor - thanks for the feedback. As mentioned, I'm seriously new to this and not exactly sure what is allowed and what not. Could you please elaborate on full program? Would this include literary all the code, such as using, namespaces, main etc. Thanks! \$\endgroup\$ – Richard Bailey Aug 4 '16 at 11:12
  • 2
    \$\begingroup\$ class a{static void Main{for(var i=0;i++<10;)Console.Write("**********\n");}} is acceptable (not entirely sure it works though, you should test it, maybe you need System before Console) \$\endgroup\$ – ASCII-only Aug 4 '16 at 11:21
  • 1
    \$\begingroup\$ You can get rid of using System; and use System.Console.WriteLine("**********");. It saves you 6 bytes. Also, you can get rid of some spaces for extra savings - the ones around the for cycle. \$\endgroup\$ – auhmaan Aug 4 '16 at 17:23
  • 2
    \$\begingroup\$ It's a shame Enumerable.Repeat() is so many bytes... C# could move up a lot of these with a shorthand for that function. \$\endgroup\$ – Joel Coehoorn Aug 8 '16 at 19:28
3
\$\begingroup\$

Python 3, 25 23 bytes

Hey I actually outgolfed someone :).

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

if stderr is valid, 22 bytes

exit(("*"*9+"*\n")*10)

realised that execing didn't actually golf it down :(


25 bytes answer

exec("print('*'*10);"*10)

Works by concatenating ten copies of print('*'*10); and execing, which in turn works by concatenating '*' 10 times and printing

\$\endgroup\$
  • \$\begingroup\$ I think you're missing parentheses: print(("*"*9+"*\n")*10) \$\endgroup\$ – shooqie Aug 4 '16 at 9:46
  • \$\begingroup\$ I think you're missing my update \$\endgroup\$ – Destructible Lemon Aug 4 '16 at 9:48
  • \$\begingroup\$ I mean your 21-byte solution gives a wrong output. \$\endgroup\$ – shooqie Aug 4 '16 at 9:52
  • \$\begingroup\$ I'm not sure chronologically which came first the comment or my edit anymore \$\endgroup\$ – Destructible Lemon Aug 4 '16 at 10:25
  • \$\begingroup\$ I didn't even know about that stderr trick, neat! \$\endgroup\$ – sagiksp Feb 17 '17 at 6:11
3
\$\begingroup\$

Same, 239 bytes

ЕEЕEЕEЕEЕEEЕЕEЕEЕEЕЕEΕЕEЕEEЕЕЕΕЕЕEЕEЕEЕEЕEЕEЕEЕEЕEЕEΕEEΕEЕΕЕEEЕЕЕЕЕЕЕЕЕЕЕЕЕЕЕЕЕЕЕЕЕЕЕЕЕЕЕЕЕЕЕЕЕЕЕЕЕЕЕЕЕЕΕЕЕEЕEЕEЕEЕEЕEЕEЕEЕEЕEЕЕЕЕEΕEEΕЕЕΕΕΕ

Samebly code used to generate this:

add 5
mstore
add 3
mult
add 2
mstore
clear
add 10
while
    minc
    mstore
    mdec
    mread
    outc
    outc
    outc
    outc
    outc
    outc
    outc
    outc
    outc
    outc
    clear
    add 10
    outc
    minc
    mread
    mdec
    dec
end
\$\endgroup\$
3
\$\begingroup\$

><>, 22 15 bytes

'*o'l),lb%a$?$o

The program exits with an error and the output has no trailing newlines. Try it online!

'*o'                  Push 42 '*' and 111
    l),               Divide the 42 by (111 > length of stack) - this is a no-op
                      initially and a division by zero error later on
       lb%            Push (length of stack) % 11
          a$          Put 10 '\n' beneath that
            ?$        If (length of stack) % 11 is nonzero, swap top two chars,
                      moving the '*' above the '\n'
              o       Output top char, leaving the other char and hence
                      increasing the length of the stack by 1

><> is a toroidal 2D language, so the above runs in a loop until the division by zero causes the program to error out.


Alternative 15s (which work for different reasons):

'*o'l),lb%?!{oa
'*o'l),lb%?!}oa
\$\endgroup\$
3
\$\begingroup\$

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.

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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