Print a 10 by 10 grid of asterisks

86

9

Background

This is a standard textbook example to demonstrate for loops.

This is one of the first programs I learned 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>

Leaky Nun

Posted 2016-08-04T09:29:21.627

Reputation: 45 011

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'? – Dylan Meeus – 2016-08-04T12:37:24.880

2@DylanMeeus "You are to print this exact text:" – Leaky Nun – 2016-08-04T12:56:25.113

13@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 – 2016-08-04T12:58:40.783

@JamesTrotter oh I didn't notice that it can be turned off, cheers! – Dylan Meeus – 2016-08-04T13:01:38.060

6@LeakyNun Leaderboard snippet please! – dkudriavtsev – 2016-08-04T22:08:46.177

2One 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 – 2016-08-05T09:14:22.163

Do they have to be astricks? What about newlines? – addison – 2016-08-08T21:34:42.283

The shortest solution in JavaScript I can come up with to print to browser in JavaScript is for(d=document.body,i=0;10>i++;d.innerHTML+='<br>')for(j=0;10>j++;)d.innerHTML+='*'. I'd love to post this as an answer, but for some reason this question is "protected" and I don't have enough reputation here yet to post answers to "protected" questions. – John Slegers – 2016-08-10T09:24:13.863

1you say trailing new lines are acceptable. Are leading newlines acceptable too? – Albert Renshaw – 2017-02-10T02:34:47.713

Answers

75

Brainfuck, 47 bytes

++++++++++[->++++>+>+<<<]>++>[-<..........>>.<]

Try it online!

++++++++++[->++++>+>+<<<]   set the tape to 40 10 10
>++>                        set the tape to 42 10 10
[-<..........>>.<]          come on

Leaky Nun

Posted 2016-08-04T09:29:21.627

Reputation: 45 011

48+1 for emoticon in the code >.< – user48538 – 2016-08-04T11:27:25.873

25+1 for the fish bones >++> – Beta Decay – 2016-08-07T23:56:46.657

72

C (gcc), 41 39 bytes

main(i){for(;++i<puts("**********"););}

orlp

Posted 2016-08-04T09:29:21.627

Reputation: 37 067

what version of c? – Zaibis – 2016-08-04T12:51:59.323

@Zaibis Works fine on gcc: http://coliru.stacked-crooked.com/a/848cb22a00c35c29 .

– orlp – 2016-08-04T13:28:04.500

Add this info. I got that i is undcleared ;) So I can un downvote. – Zaibis – 2016-08-04T13:32:07.683

4looks good, good ol' ANSI C. – YSC – 2016-08-04T13:38:58.420

4main(i){while(11-i++)puts("**********");} is an alternative, same length. – YSC – 2016-08-04T13:41:06.450

@YSC I saved two more bytes :) – orlp – 2016-08-04T14:07:17.310

7I like the clever use of the return from puts() (and of the initial value of i). – Toby Speight – 2016-08-08T14:17:26.103

66

Bash + coreutils, 19 bytes

I prefer to repeat stuff in Bash using 'yes'.

yes **********|head

I saved 2 bytes by @Neil's suggestion. But when the directory where you are running this command does not only contain files starting with a '.' dot you need to enclose the stars * with ".

Bash + coreutils, 21 bytes

yes "**********"|head

CousinCocaine

Posted 2016-08-04T09:29:21.627

Reputation: 1 572

2Great idea to use yes. We usually label such solutions as “Bash + coreutils”. – manatwork – 2016-08-04T14:58:36.290

8Nice that 10 lines coincidentally happens to be the default for head. – Digital Trauma – 2016-08-04T15:15:16.260

3Can you save two bytes by requiring that any files in the current directory must begin with a .? – Neil – 2016-08-04T18:51:18.290

@Neil, is your comment ment for my answer? If so, I do not get it :) – CousinCocaine – 2016-08-04T18:57:39.737

Normally echo * expands to all the files in the current directory that don't begin with a .; if there are no such files though, the * has no effect. – Neil – 2016-08-04T18:59:55.540

I do not get it. yes just repeats the following text over and over. I do not use echo here... I just do not see what you mean. – CousinCocaine – 2016-08-04T19:03:18.553

@CousinCocaine: His point was that you can get away with not quoting the ********** command-line argument if the program is always run in a directory where no files match that pattern. – hmakholm left over Monica – 2016-08-05T00:01:28.547

@HenningMakholm Aha! I get it! So is it 'legal' to golf the "? – CousinCocaine – 2016-08-06T08:34:34.223

1You can also write yes \**********|head without the restriction on files. – Florian F – 2016-08-10T13:51:39.357

@FlorianF and what if the filename starts with an *? – CousinCocaine – 2016-08-10T19:55:01.483

@CousinCocaine If a file starts with a * then it doesn't work. :-( So it is just a good compromise. Having a file that starts with * is much less likely than to sit in a non-empty directory. – Florian F – 2016-08-11T14:12:35.547

In programming, relying on 'less likely' is dangerous, but you are right, it also wont work with a file named ********** – CousinCocaine – 2016-08-11T14:44:31.657

50

Vim, 13 8 bytes

Saved 5 bytes thanks to @Lynn

qqi*␛9.o␛q9@q 

10i*␛Y9p

10i*␛ insert 10 times *, and Y9p copy the line and paste it 9 times.

TuxCrafting

Posted 2016-08-04T09:29:21.627

Reputation: 4 547

810i*♥Y9p works. – Lynn – 2016-08-04T11:25:33.800

1That's insane vi. – nbubis – 2016-08-07T06:53:04.617

I think you can count keystrokes instead of bytes for text editors, which means <ESC> would be shorter. – addison – 2016-08-07T14:55:40.563

@addison <ESC> is 1 byte – TuxCrafting – 2016-08-07T15:02:03.190

Oh nevermind, I misread the answer. I see now – addison – 2016-08-07T15:07:10.873

1Why ♥ and not ␛ ? – CL. – 2016-08-08T12:54:30.527

Can you provide some explanation as to why this works? Great work (+1) – Jeel Shah – 2016-08-10T03:30:54.093

1I would have used yy9p myself, but nice job using capitals to save a character! – Joe Z. – 2016-08-12T21:08:35.743

49

Pyth, 6 bytes

VT*T\*

T is 10 in Pyth, Vab executes statement b a times, \* is the asterisk character constant, and multiplying (*) a string and an integer repeats that string n times. Pyth's implicit printing with V means 10 lines are printed.

orlp

Posted 2016-08-04T09:29:21.627

Reputation: 37 067

40

Hexagony, 37 35 34 31

10"+}(=${";<$<1}42/.0@_=<>\;>(_

Expanded:

   1 0 " +
  } ( = $ {
 " ; < $ < 1
} 4 2 / . 0 @
 _ = < > \ ;
  > ( _ . .
   . . . .

Try it online

Basically just has two for loops counting down from ten to zero, printing out an asterisk on the inner loop, and a newline on the outer loop.

Explanation:

This program consists of three main parts: initialisation of memory, a loop which prints ten asterisks and a loop which prints a newline. The loop which prints a newline also contains the loop which prints the asterisks.

First, the code runs the totally linear memory initialisation. The code works out to be: 10"+}42. This sets the memory of the nearby edges to look like:

10 \ / 10
    |
   42

42 is the ASCII code for the asterisk character, and the two tens will be used as our loop counters. Of note is that the memory pointer is currently pointing away from the two tens, so moving backwards will put us on one of the tens.

Next, we start the astersisk printing loop. Linearly, the code looks like: ;".._(. This prints out an asterisk, moves the memory pointer backwards and to the left and finally decrements the value there. After one iteration, the memory would look like:

10 \ / 9
    |
   42

Then we hit the loop condition: the bottom-leftmost >. If the edge we just decremented is still positive we bounce around and execute a { to move us back onto the 42. Then we hit a $ and return to the beginning of the printing loop, the ;, by skipping the <. If the value was zero, we head into the other loop.

The outer loop begins by resetting the recently zeroed memory edge to ten (this is the 10 in the code, going southwest). Then, we print out this ten as an ASCII character, which is a newline. Next, we move onto the other memory edge and decrement it with {( and then execute what amounts to a bunch of noops: =${_=. Now, after one iteration of this loop, memory would look like:

 9 \ / 10
    |
   42

This time, the memory is facing outwards from the edge storing a nine in the above diagram. Next we execute the < which acts as the loop condition for the outer loop. If the value was non-zero we bounce around off of some mirrors, then begin executing meaningful instructions again after entering the top of the hexagon at the " moving southwest. This causes us to move backwards and to the left, onto the 42 again, but facing inwards. Then the = flips our direction, resetting the state properly to begin the inner loop again. If the edge was set to zero, the instruction pointer goes on a little adventure which does nothing until it exits the program.

The adventure begins by the instruction pointer venturing northeast, perilously disregarding the safety of the cardinal directions. It bravely ignores a mirror that is aligned with its diretion (/) and heroically leaps off of a trampoline ($) entirely evading the deadly trap of another, totally identical trampoline. Staring out at the emptiness of uninitialised hexagon edges, the pointer, without faltering for a moment, adds the two blank edges it faces together, setting the current edge to their sum: 0 (the edge was actually zero beforehand, but the pointer likes to believe this was pretty important). Since the edge is zero, the pointer makes a left turn at the fork in the road, walking into a mysterious forest (of hexagons). There, it finds itself disoriented, moving forwards and backwards and forwards, until it winds up at the same place in memory as it started. Thinking that the problem must be that the current edge was set to zero last time, the pointer bravely plants a 1 into the current edge. Then, the noble pointer investigates another path, one laid with... a trap! The current edge is decremented and set back to zero! The pointer, dazed by the shocking turn of events, stumbles back into the trap setting the current edge to negative one. Infuriated, the pointer attempts to return to the comparatively pleasant forest, only to notice that since the current edge is not positive, the paths have yet again shifted and the pointer finds itself walking into a cave. And by a cave, I mean the mouth of a giant hexagonal worm. Helpless, the pointer curses the sexinity with its dying breath. Also, the program ends.

FryAmTheEggman

Posted 2016-08-04T09:29:21.627

Reputation: 16 206

Golly, I hope the worm was OK with swallowing a pointer. Those things can hurt. – Joffan – 2016-08-08T04:01:59.737

3+1 for writing the most interesting—the only—Hexagony explanation I've ever read. I felt so tense when the edge was decremented! – Joe – 2016-08-28T00:07:03.713

37

Emacs, 10 8 keystrokes

F3 C-1 0 * ENTER F4 C-9 F4

Explanation

F3             Starts a macro recording
C-1 0 *        Apply 10 times command '*': prints 10 asterix'
ENTER          Insert new line
F4             Stops the macro record
C-9 F4         Apply 9 times the macro

Thanks to Sean for saving two keystrokes, suggesting to replace C-udigit with C-digit.

YSC

Posted 2016-08-04T09:29:21.627

Reputation: 732

9+1, I always upvote text editor answers (even though I'm more of a vim guy myself) :) – James – 2016-08-04T15:10:35.073

1If C-u counts as just one keystroke, then you can shave off two strokes by typing C-1 C-0 (or M-1 M-0) instead of C-u 1 0 and C-9 instead of C-u 9. – Sean – 2016-08-05T14:45:15.197

15+1 because you had to suffer through using emacs to write this. – addison – 2016-08-07T14:54:27.153

1Alternatively (saves nothing) the line repetition can be done inside the macro: F3 C-1 0 * ENTER C-1 0 F4 – Jonathan Carroll – 2016-08-09T05:14:37.510

@JonathanCarroll yes it would save bytes if we were to print more than 10 lines ;) – YSC – 2016-08-09T08:28:54.433

@DrMcMoylex Even is they're spam? (Not that this answer is, +1 for no vim) – NoOneIsHere – 2016-11-28T22:49:23.263

29

Jelly, 7 bytes

”*x⁵Ṅ9¡

What's going on?

”*x⁵Ṅ9¡  - No arguments
”*       - character literal, *
  x      - multiply (dyadic operation)
   ⁵     - integer literal, 10 (we have now constructed the string '**********')
    Ṅ    - Print & linefeed (monadic operation)
     9   - integer literal, 9
      ¡  - Repeat n times (n is 9 as the first Ṅ is not a repeat)

Test it on tryitonline

Jonathan Allan

Posted 2016-08-04T09:29:21.627

Reputation: 67 804

9I really like the Ṅ9¡. – Dennis – 2016-08-07T20:16:54.510

List version: ”*ẋ⁵Wẋ⁵. – Erik the Outgolfer – 2016-10-01T14:51:47.613

@EriktheGolfer you'd need a Y on the end to "print this exact text" – Jonathan Allan – 2016-10-01T14:54:19.887

@JonathanAllan It is a list on its own, though. It isn't meant to "print this exact text", but, if you want to work on it, you'll use it. – Erik the Outgolfer – 2016-10-01T14:55:59.390

26

PowerShell, 14 12 bytes

,('*'*10)*10

Constructs a string of asterisks of length 10 using string multiplication. Encapsulates that in parens and feeds that into the comma-operator to construct an array. We use array multiplication to construct a 10-element array consisting of that element (i.e., a 10-element array of asterisk strings). That's left on the pipeline, and output is implicit (since the default Write-Output for an array is newline-separated, we get that for free -- thanks to @Joey for the clarification).

Older, 14 bytes

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

Full program. Loops from 0 to 9 through a ForEach-Object loop |%{...}. Each iteration, we use string multiplication to create a length-10 string of *. Those resulting strings are left on the pipeline, and output at the end is implicit (since the default Write-Output for an array is newline-separated, we get that for free -- thanks to @Joey for the clarification).

AdmBorkBork

Posted 2016-08-04T09:29:21.627

Reputation: 41 581

5I like it, because powershell can get so verbose. Yet this is elegant and short. – dwana – 2016-08-04T13:25:13.523

Well, technically the array is never passed through a ToString, it's unrolled and passed element by element to Write-Output. In contexts where the array is converted to a string, you get its elements space-separated. – Joey – 2016-08-09T14:46:08.060

@Joey Ah, fair, that's a better way to put it. I'll edit the wording (and my answer template ;-)). – AdmBorkBork – 2016-08-09T14:58:13.093

1I may be biased here because I'm involved with a PowerShell implementation so I had to learn a lot of what actually goes on inside the interpreter ;) – Joey – 2016-08-09T15:00:03.550

25

V, 7 bytes

10é*10Ä

Try it online!

About as straightforward as an answer can be.

Explanation:

10      "10 times:
  é*    "insert an asterisk
    10Ä "make 10 copies of the current line

Non-competing version (5 bytes):

10O±*

Explanation:

10O     " Insert the following on the next ten lines:
   ±    "   10 copies of
    *   "   an asterisk

This didn't work when the challenge was posted because of a bug.

James

Posted 2016-08-04T09:29:21.627

Reputation: 54 537

Point of order: é and Ä are multibyte characters (at least in utf-8, as you have them here) so this program is 9 bytes long. – rob – 2016-08-04T19:35:11.483

6@rob They are encoded in utf-8 here, because that's just the way the browser works. V uses "Latin1" encoding, where they are E9 and C4 respectively. – James – 2016-08-04T19:41:40.700

21

Jellyfish, 12 10 bytes

Thanks to Zgarb for saving 2 bytes.

P$'*
 &;10

Try it online!

Explanation

Using more conventional notation, this program represents the following expression:

P( $( &;(10), '* ) )

&; takes a single value and creates a pair with two times that value, so &;(10) gives us [10 10]. Then $ is reshape which forms a 10x10 grid of asterisks. Finally, P prints the array in "matrix format" which prints each string on its own line.

Martin Ender

Posted 2016-08-04T09:29:21.627

Reputation: 184 808

20

HTML & CSS, 104 60 bytes

p::after{content:"**********"
<p><p><p><p><p><p><p><p><p><p>

I'm unsure if the byte count is correct (as I'm not counting the <style> tags for CSS. The HTML could also be shortened if I used a HTML preprocessor, but I'm unsure if that's breaking rules

Thanks to manatwork and Business Cat.

See my Jade entry of 36 bytes

ʰᵈˑ

Posted 2016-08-04T09:29:21.627

Reputation: 1 426

You can leave out the self closing /s and write all tags in the same line. But better change the tags to <p> as it is shorter even if you need to add p{margin:0}. – manatwork – 2016-08-05T13:28:32.537

You can also get rid of the space after div::after, and you can leave out the closing brace after the content, if JSFiddle is any indication.

– Business Cat – 2016-08-05T16:16:25.217

@manatwork & Business Cat - thanks guys – ʰᵈˑ – 2016-08-05T16:18:17.783

2This is not valid css. You need the closing bracket! – Richard Hamilton – 2016-08-05T16:37:59.693

25@RichardHamilton valid css and working css are not the same thing – undergroundmonorail – 2016-08-07T08:51:10.287

You can reduce 2 bytes by using :after instead of p::after. (that is valid CSS2 syntax) – Ismael Miguel – 2016-08-09T02:46:37.837

Thanks @IsmaelMiguel but this gives an output not equal to one that is expected - the left hand side isn't a straight edge. – ʰᵈˑ – 2016-08-09T07:56:33.593

@ʰᵈˑ My method has a bug. Using it, you must remove 2 <p>. This is because <body> and <html> can have an :after pseudo-element, displaying a total of 12 lines. And yes, the styling of the output is different, but saving 2 + 6 bytes is a nice tradeoff. – Ismael Miguel – 2016-08-09T08:22:24.357

@IsmaelMiguel I'm a little new to code-golf submissions. Would the different output style cause this answer to become wrong? – ʰᵈˑ – 2016-08-09T08:45:29.130

@ʰᵈˑ I don't think so, but, you can add it as an alternative below, and leave a comment on the question, asking about this. But, even if the new output is invalid, using p:after works and is 1 byte shorter. – Ismael Miguel – 2016-08-09T08:46:36.753

Your HTML code is not valid, if you put content after that it will be considered as a child of each <p> you written... – ClementNerma – 2016-08-21T20:42:59.333

1@ClementNerma Why should anyone put code after this? – Erik the Outgolfer – 2016-09-13T12:47:13.767

What do you means ? – ClementNerma – 2016-09-13T18:36:07.577

@ClementNerma This is a program, so code won't be added. If it was a snippet, it would indeed be invalid. (And, if it was valid as a snippet, it would have still been invalid, because snippets are forbidden by default.) Also, Code Golf isn't about writing valid, perfect code. It's about writing short code. And, if you didn't know, you can reply to one other person (not two) using @username. For me, it's @EriktheGolfer (I don't like it as @Eri, but it works). – Erik the Outgolfer – 2016-10-01T15:56:03.150

2you can leave off the last > I believe – 12Me21 – 2017-02-06T14:47:04.067

This is not valid HTML&CSS. It happens to work with major browser but not with stricter ones. – YSC – 2017-04-27T09:50:07.037

@YSC See https://codegolf.stackexchange.com/questions/88653/print-a-10-by-10-grid-of-asterisks/88871?noredirect=1#comment217115_88871 - what are the stricter ones? Works with the latest version of Google Chrome / Mozilla Firefox / Edge

– ʰᵈˑ – 2017-04-27T09:53:09.773

@ʰᵈˑ I agree: valid != working. And who doesn't hate to hear "but it works"? This is a working solution, not a valid one. – YSC – 2017-04-27T13:48:01.040

16

Python 2, 22 21 bytes

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

shooqie

Posted 2016-08-04T09:29:21.627

Reputation: 5 032

print(("*"*10+'\n')*10) worked for me. – piepi – 2016-08-07T03:31:43.943

6@piepi That's why you're usually better off golfing in Python 2 - you don't need parentheses when calling print. – shooqie – 2016-08-07T07:41:05.073

@shooqie You can't beat a Python3 solution using Python2. Python2 and Python3 are different languages. You also wouldn't compare the Python2 solution to a specialized golf language like Pyth. – Alfe – 2019-10-14T13:41:10.593

16

APL, 9 bytes

Works on all APLs ever made.

10 10⍴'*'

10 10 ten rows and ten column

 cyclically repeating

'*' a star

TryAPL online!

Adám

Posted 2016-08-04T09:29:21.627

Reputation: 37 779

It's worth noting that this solution is not Dyalog-specific; it also works with GNU APL. – Arc676 – 2017-06-15T01:20:51.017

3@Arc676 True. In fact, it works on all APLs ever made. – Adám – 2017-06-15T01:26:28.850

argh, I need just one more byte... I almost beat you with the "format" trick: ∘.⊢⍨⍕⍨,⍨5 – ngn – 2018-02-06T07:50:40.487

@ngn That's wonderfully horrible! – Adám – 2018-02-06T08:59:10.443

16

MATLAB, 14 bytes

repmat('*',10)

PieCot

Posted 2016-08-04T09:29:21.627

Reputation: 1 039

I don't have MATLAB to test this, so I'm unsure if this has spaces between the *s. – Erik the Outgolfer – 2016-10-01T15:59:16.913

@EriktheGolfer clearly not :) – PieCot – 2016-10-01T19:41:50.747

mat suggests a matrix, that's why I asked. – Erik the Outgolfer – 2016-10-02T06:23:23.593

2@EriktheGolfer excuse me, I was rude. Mat, in fact, refers to a matrix, but in this case is a matrix of char, that is an array of strings (every row is like a string). So, the outupt matrix is printed one row for line, without spaces between elements of the same row. – PieCot – 2016-10-02T15:07:35.567

14

Java 7, 63 bytes

void f(){for(int i=0;i++<10;)System.out.println("**********");}

Just for kicks. I can't seem to find any tricks to make this shorter. Trying to add logic for a 100-loop or returning a String instead of printing just ends up worse.

Geobits

Posted 2016-08-04T09:29:21.627

Reputation: 19 061

1You can shave it off by one byte if you declare i as a class variable (it defaults to 0): int i;void f(){for(;i++<10;)System.out.println("**********");} – shooqie – 2016-08-04T09:51:16.657

1

That would break reusability unless I did i=0 somewhere in the function, negating the savings.

– Geobits – 2016-08-04T09:54:44.847

3+1 Seems you're indeed right that this is the shortest.. Recursive is 65 bytes: int i=10;void f(){System.out.println("**********");if(i-->0)g();}; One by one recursive is 67 bytes: int i=99;void f(){System.out.print(i%10<1?"*\n":"*");if(i-->0)g();}; Using String-constructor with char-array is 82 bytes: void g(){System.out.print(new String(new char[10]).replace("\0","**********\n"));}; and a String.format is 81 bytes: void g(){System.out.print(String.format("%010d",0).replace("0","**********\n"));}. Ah well, we tried. ;) – Kevin Cruijssen – 2016-08-04T11:10:32.793

2But does it count without having to add the class declaration itself? What is the shortest java7 full program that can do this? – jsbueno – 2016-08-04T12:54:37.530

Writing a method instead of a full working program is permitted as far as I'm concerned. Shortest way to write a full program would be to include the loop in the main method, which is considerably longer (you need to include public static void main(String[]A) and wrap it in a class. – shooqie – 2016-08-04T16:11:32.000

Or a lambda expression would also work and be a bit shorter – Daniel M. – 2016-08-05T02:52:53.293

@DanielM. That would work in Java 8, but I specifically use 7 because I feel Java's way of handling lambdas doesn't jibe with my idea of "fair" for golfing purposes. – Geobits – 2016-08-05T03:00:39.193

@Geobits Fair enough – Daniel M. – 2016-08-05T03:02:07.373

If you static import System.out you can shave another 7 characters off.. not sure if that's allowed :) – Kylar – 2016-08-07T15:43:01.873

@Kylar: How would you do that? – shooqie – 2016-08-07T18:43:33.110

1You have to count the import statement, so it wouldn't work for savings here. – Geobits – 2016-08-07T19:09:54.233

Yeah I didn't know if it would help. – Kylar – 2016-08-07T20:44:45.690

Recursive is actually the shortest:

void f(int x){System.out.println("**********");if(x-->1)f(x);}

Beats this answer by only 1 byte. – Hypino – 2016-11-09T17:05:31.753

@Hypino Only if you add an argument to the function which isn't given in the challenge. I read it as "given no input, print this text". – Geobits – 2016-11-09T17:07:21.360

@Geobits I actually don't see anywhere in the challenge that says anything about input being not allowed. But I'll take your word for it. – Hypino – 2016-11-09T17:09:51.383

I mean to say, that's my reading of it. I'll hold myself to it. – Geobits – 2016-11-09T17:10:57.413

14

Ruby, 15 characters

puts [?**10]*10

Sample run:

bash-4.3$ ruby -e 'puts [?**10]*10'
**********
**********
**********
**********
**********
**********
**********
**********
**********
**********

manatwork

Posted 2016-08-04T09:29:21.627

Reputation: 17 865

Can you explain ?**10? It does indeed create a string of ten asterisks, but I'm unclear how... – erich2k8 – 2016-08-09T00:05:34.407

3

The ? is the character literal notation, so ?* == '*'. The 2nd * is the String.* method, so ?**10 == '*'.*(10).

– manatwork – 2016-08-09T07:26:46.527

Afraid I still don't understand why ? is the literal notation of anything, but perhaps some questions are better left unanswered. ;) – erich2k8 – 2016-08-10T09:09:44.120

Sorry, I can't find any reference on this. Is simply the Ruby syntax, which allows various string literal notations plus one in case the string is 1 character long: a ? mark followed by the character, without requiring a closing pair of the ? mark.

– manatwork – 2016-08-10T09:53:17.120

1

I found it in the reference here: https://ruby-doc.org/core-2.3.0/doc/syntax/literals_rdoc.html There is also a character literal notation to represent single character strings, which syntax is a question mark (?) followed by a single character or escape sequence that corresponds to a single codepoint in the script encoding:

– erich2k8 – 2016-08-11T22:53:11.663

14

Notepad, 34 31 keystrokes

**********
^A^C↓^V^A^C↓^V^V^V^V

^ denotes Ctrl-<following character> keypress, ↑↓ are up and down keys, respectively.

Props to Crypto for 3 saved keystrokes.

Micah Dombrowski

Posted 2016-08-04T09:29:21.627

Reputation: 165

2You should use keystrokes to count this. – Leaky Nun – 2016-08-04T16:08:35.580

Ctrl-↑ isn't doing anything for me – acrolith – 2016-08-04T16:16:03.240

Are you including the newline after typing the ten asterisks? When starting from the line below, Ctrl-↑ should select the entire line above, newline included. – Micah Dombrowski – 2016-08-04T16:24:36.743

@MicahDombrowski yes, I am. replacing Ctrl-↑ with Ctrl-A works for me. – acrolith – 2016-08-04T17:03:47.603

1That's Shift+Up. Ctrl+Up is something else. – Neil – 2016-08-04T18:53:14.307

131 keystrokes **********↵^A^C↓^V^A^C↓^V^V^V^V – Crypto – 2016-08-05T05:52:05.770

@Neil Derp, yeah. My finger was hitting Shift, but I kept thinking Ctrl. – Micah Dombrowski – 2016-08-05T05:57:44.370

@Crypto Nice... – Micah Dombrowski – 2016-08-05T05:57:56.587

@Mego KC challenge don't have to be answered in programming languages. – mınxomaτ – 2016-08-05T14:07:03.237

126 keystrokes *****^A^C^V^V↵^A^C^V^A^C^V^V^V^V^V – Andy – 2016-08-08T17:24:21.687

523 keystrokes **^A^C^V^V^V^V^V↵^A^C^V^V^A^C^V^V^V^V^V – Andy – 2016-08-08T17:26:27.107

@Andy Ctrl counts as a keypress. That last one is 39. – mbomb007 – 2016-08-09T22:06:11.630

@mbomb007 so then doesn't shift also count for the typing of the asterisks? It would be 41, then, and the answer posted would be 41 as well. – Andy – 2016-08-10T12:57:21.690

@Andy Hmm...may have a point there. I suppose it's a good question as to whether each 'usage' of a modifier key counts, or just each press of it, when you can hold it down over multiple 'uses'. If that makes sense. – Micah Dombrowski – 2016-08-12T19:17:37.417

1You can also use <kbd> tags to represent the keys to press – Sunny Patel – 2016-08-23T16:16:11.807

1@Andy Asterisk can be typed using the numpad for a single key press. – mbomb007 – 2016-09-20T19:40:07.650

This is beautiful! – xyz123 – 2017-10-08T06:28:48.890

13

Emojicode, 54 bytes

i⏩0 10**********

Explanation:

                         The beginning of program.
     i ⏩ 0 10            This is called a "range".
                          It basically starts with i=0 and increments until i=10, then exits. 
         **********      is printing class.
                          The s make the characters they surround string literals. 
                          End of range
                          End of program

betseg

Posted 2016-08-04T09:29:21.627

Reputation: 8 493

2I count 54 utf-8 bytes. – Conor O'Brien – 2016-08-29T02:46:07.523

This language hates WIndows 7... – John Dvorak – 2016-12-27T16:11:09.910

10

R, 27 29 bytes

cat(rep('\r**********\n',10))

An alternate answer (34 bytes) is: cat(rep('**********',10),sep='\n')

Mamie

Posted 2016-08-04T09:29:21.627

Reputation: 171

This adds an extra space at the beginning of all lines except the first (see here ).

– plannapus – 2016-08-04T16:14:11.720

Thanks, it works adding \r. – Mamie – 2016-08-04T19:48:17.020

1

Another alternative, too many (37) bytes: cat(matrix('*',10,10),fill=10,sep='') r-fiddle

– Jonathan Carroll – 2016-08-09T04:48:24.000

Another alternative, also 29 bytes: write(rep("*",100),"",10,,"") – Giuseppe – 2018-02-13T16:14:45.663

Dropping \nfrom the above works for 27 bytes:

– JayCe – 2018-05-25T16:07:08.693

26 bytes if you hardcode the carriage return. – J.Doe – 2018-09-18T07:31:10.150

1And write(rep("**",50),1,5,,"") is 27 bytes and avoids the first carriage return. – J.Doe – 2018-09-18T08:57:37.430

10

05AB1E, 7 bytes

TF'*T×,

Explanation

TF      # 10 times do:
  '*T×  # repeat asterisk 10 times
      , # print with newline

Try it online

Emigna

Posted 2016-08-04T09:29:21.627

Reputation: 50 798

1т'*×Tô» is another completely different one lol. – Magic Octopus Urn – 2018-02-08T15:28:35.050

TLú'*ζ» using the zip-filler was another idea... bad one though. – Magic Octopus Urn – 2018-02-08T15:40:14.460

9

PHP, 32 bytes

for(;$i++<10;)echo"**********
";

(variant 32 bytes - was written with echo)

<?=str_repeat("**********
",10);

(variant 33 bytes)

<?=str_pad("",110,"**********
");

(variant 33 bytes)

for(;$i++<110;)echo$i%11?"*":"
";

(variant 35 bytes)

for(;$i++<10;)printf("%'*10s
",'');

(variant 38 bytes)

<?=($a=str_repeat)($a("*",10)."
",10);

Crypto

Posted 2016-08-04T09:29:21.627

Reputation: 862

3The second one can be golfed to 32 bytes as well: <?=str_repeat("**********↵",10); – insertusernamehere – 2016-08-04T13:41:12.470

1As you already have a nice collection of alternatives, here is another for fun: echo chunk_split(str_repeat("*",100),10); The longest so far, just in my vision this is the PHP way to do it. – manatwork – 2016-09-01T07:37:52.837

Can be a byte shorter with WIN-1252 encoding: for(;++$i<111;)echo$i%11?~Õ:~õ; or for(;++$i<11;)echo~ÕÕÕÕÕÕÕÕÕÕõ; – aross – 2016-09-29T15:50:12.553

Another modulo variant for 33 bytes: for(;$i++<110;)echo"*↵"[$i%11<1];. And to add a 37 bytes solution to that collection: for(;$i++<110;)echo chr($i%11?42:10);. – Titus – 2017-06-09T08:50:19.130

8

MATL, 8 bytes

'*'10tX"

Try it online!

'*'   % Push '*' (string containing an asterisk)
10t   % Push 10 twice
X"    % Repeat the string 10×10 times. Implicitly display

Luis Mendo

Posted 2016-08-04T09:29:21.627

Reputation: 87 464

8

Brainfuck, 46 43 bytes

+[[---<]+[-->]<]<<[--<<++..........-->>>.<]

Try it online! Requires an interpreter with a tape that is open on the left and has 8-bit cells.

The first part of this program +[[---<]+[-->]<] sets up the tape like so:

[255, 250, 245, ... 15, 10, 5, 0, 250, 240, 230, ..., 40, 30, 20, 10, 0]
                                                                      ^

This gives a 40 for outputting asterisks (*, ASCII 42), a 20 to use as a loop counter, and a 10 to use for outputting newlines.

Sp3000

Posted 2016-08-04T09:29:21.627

Reputation: 58 729

7

JavaScript (ES6), 37 bytes

console.log(`**********
`.repeat(10))

A straightforward answer.

ASCII-only

Posted 2016-08-04T09:29:21.627

Reputation: 4 687

5Cant you save 6 by using alert ? – Kevin L – 2016-08-04T12:45:37.403

1Arguably you could save 13 bytes by removing the console.log() and specifying REPL in the title. – Patrick Roberts – 2016-08-04T23:56:05.813

6

R, 35 33 32 bytes

Ô R, you're so verbose sometimes.

for(i in 1:10)cat(rep("*",10),"\n")

Interestingly, the cat function has no value (it provides NULL to STDOUT), so you can't do somethig like rep(cat(rep))), which would have been funnier !

EDIT :
New solution proposed by @LeakyNun, -2 bytes.

for(i in 1:10)cat("**********\n")

EDIT : Shortening it just by -1 byte, by @user5957401

for(i in 0:9)cat("**********\n")

Frédéric

Posted 2016-08-04T09:29:21.627

Reputation: 2 059

3for(i in 1:10)"**********\n" – Leaky Nun – 2016-08-04T10:41:55.907

1@LeakyNun : Simplicity is the key ! I had cat nonetheless, otherwise it produces nothing. – Frédéric – 2016-08-04T10:44:53.963

cat(rep("**********\n",10)) – Leaky Nun – 2016-08-05T03:56:59.060

@LeakyNun It wouldn't produce the desired output: see here. The default separator in cat is a space, hence this output.

– plannapus – 2016-08-05T07:14:46.627

6

Cheddar, 21 20 bytes

print('*'*10+'
')*10

Yet another straightforward answer.

ASCII-only

Posted 2016-08-04T09:29:21.627

Reputation: 4 687

4Use a literal newline to save 1 byte – Leaky Nun – 2016-08-04T10:51:22.750

2Make it a function using -> instead of print maybe? – Downgoat – 2016-08-04T19:00:59.097

6

Haskell, 29 bytes

putStr$[0..9]>>"**********\n"

<list1> >> <list2> makes (length <list1>) copies of <list2>.

nimi

Posted 2016-08-04T09:29:21.627

Reputation: 34 639

5

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

user65167

Posted 2016-08-04T09:29:21.627

Reputation:

In this form it gives me an error, maybe '(1) instead of 1 ? – Renzo – 2017-09-28T18:44:05.720

@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. – None – 2017-09-30T15:19:49.197

1You are right, I tried it in CCL and in TIO, where it does not work. But, it works in SBCL. – Renzo – 2017-09-30T19:13:27.993

5

TSQL, 24bytes

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

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

Paul

Posted 2016-08-04T09:29:21.627

Reputation: 151

Welcome to PPCG! – Martin Ender – 2018-02-07T16:04:24.543

Nice trick! Added it to the Tips for golfing in T-SQL thread.

– BradC – 2018-09-20T15:58:37.633

5

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.

Martin Ender

Posted 2016-08-04T09:29:21.627

Reputation: 184 808

5

J, 10 9 bytes

1 byte thanks to @Adám.

10 10$'*'

Online interpreter.

Explanation

10 10 specifies the dimension to the operator $ which builds an array with the specified dimensions.

Leaky Nun

Posted 2016-08-04T09:29:21.627

Reputation: 45 011

1Also 9 bytes: '*'$~,~10 – Conor O'Brien – 2016-08-04T18:26:36.030

5

Mathematica, 24 bytes

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

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

Martin Ender

Posted 2016-08-04T09:29:21.627

Reputation: 184 808

5

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

Destructible Lemon

Posted 2016-08-04T09:29:21.627

Reputation: 5 908

57 bytes – Leaky Nun – 2016-08-04T11:05:17.877

48 bytes – Leaky Nun – 2016-08-04T11:06:31.423

47 bytes – Leaky Nun – 2016-08-04T11:08:54.177

11points for trying though, right..? ;_; – Destructible Lemon – 2016-08-04T11:13:34.843

also post the answer yourself – Destructible Lemon – 2016-08-04T11:14:47.630

Just post my answer. – Leaky Nun – 2016-08-04T11:14:48.253

5

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

Brad Gilbert b2gills

Posted 2016-08-04T09:29:21.627

Reputation: 12 713

2I've recently discovered that \* (a Capture containing one Whatever) stringifies to the asterisk, at one less byte than '*'. – smls – 2017-03-03T07:18:02.077

5

Julia, 23 22 bytes

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

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

plannapus

Posted 2016-08-04T09:29:21.627

Reputation: 8 610

Try changing your code to function output. – Mama Fun Roll – 2016-08-12T23:06:38.693

5

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

Business Cat

Posted 2016-08-04T09:29:21.627

Reputation: 8 927

2A cat posting in DOG language... interesting, could have sworn you were sworn enemies of the household – ʰᵈˑ – 2016-08-09T07:59:40.280

@ʰᵈˑHe's learning the enemy language to become a spy. – None – 2016-08-09T18:03:47.007

@Midnightas ahaha yes! – ʰᵈˑ – 2016-08-10T08:24:52.680

5

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)

datagod

Posted 2016-08-04T09:29:21.627

Reputation: 151

1Save 1 byte by using PRINT instead of SELECT – BradC – 2018-01-30T21:30:59.290

5

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

Sherlock9

Posted 2016-08-04T09:29:21.627

Reputation: 11 664

Congratulations! – Leaky Nun – 2016-08-05T13:45:37.873

5

Unary, 3584048336806633376708256331142263836115215 bytes

Can't post it here for obvious reasons.

But it's literally just 3584048336806633376708256331142263836115215 zeroes.

acrolith

Posted 2016-08-04T09:29:21.627

Reputation: 3 728

4

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

Post Rock Garf Hunter

Posted 2016-08-04T09:29:21.627

Reputation: 55 382

162 bytes – Jo King – 2018-02-06T09:28:41.867

@JoKing Nice! I'll add that as soon as I have a chance to fully digest all of your changes. – Post Rock Garf Hunter – 2018-02-06T14:12:54.370

1

Sorry, but 60 bytes

– Jo King – 2018-02-06T22:13:28.923

@JoKing Ok I've updated the answer. Thanks – Post Rock Garf Hunter – 2018-02-06T22:37:25.920

4

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

Jo King

Posted 2016-08-04T09:29:21.627

Reputation: 38 234

4

Python 2, 21 Bytes

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

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

Steven H.

Posted 2016-08-04T09:29:21.627

Reputation: 2 841

9Yay I inspired someone! – Destructible Lemon – 2016-08-04T09:46:42.943

Unfortunately, it only ties with the other Python 2 solution. :( – Steven H. – 2016-08-04T09:48:44.360

Well, at least it is relevant in Python 2 – Destructible Lemon – 2016-08-04T09:49:58.973

Same length: exec"print'*'*10;"*10 – mbomb007 – 2016-09-20T19:43:27.470

4

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.

Martin Ender

Posted 2016-08-04T09:29:21.627

Reputation: 184 808

1'*A*N]A* is 8 bytes. – Lynn – 2016-08-04T11:55:33.267

4

///, 25 bytes

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

Try it online!

A simple replace command.

Leaky Nun

Posted 2016-08-04T09:29:21.627

Reputation: 45 011

4It's screaming! – mınxomaτ – 2016-08-05T14:08:36.497

4

><>, 28 bytes

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

Try it online!

Leaky Nun

Posted 2016-08-04T09:29:21.627

Reputation: 45 011

4

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.

Dennis

Posted 2016-08-04T09:29:21.627

Reputation: 196 637

You finally found a use for the default value of ³. – Leaky Nun – 2016-08-04T17:12:32.947

Here and in Fizz Buzz. – Dennis – 2016-08-04T17:14:39.013

Check it out Dennis...(and what a nice little wrapper you've made!) – Jonathan Allan – 2016-08-07T19:58:58.210

I'm guessing Y wasn't added yet when this was created? If so, now it's -1 byte. – AdmBorkBork – 2018-06-06T01:26:35.320

@AdmBorkBork It was added 8 days after the challenge was posted. :/ – Dennis – 2018-06-06T02:16:15.187

4

Befunge, 39 bytes

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

Try it here!

user55852

Posted 2016-08-04T09:29:21.627

Reputation:

3This is 39 bytes; you don't need to count the trailing newline – Justin – 2016-08-04T17:54:33.180

Thanks, I guess my text editor put a trailing newline somewhere and added to the file size. – None – 2016-08-04T18:02:20.497

Shorter version by switching the movement direction to be left instead of right: (36 bytes) http://ideone.com/GZi1PG

– Justin – 2016-08-04T18:03:08.960

4

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

Mego

Posted 2016-08-04T09:29:21.627

Reputation: 32 998

4

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.

Seeseemelk

Posted 2016-08-04T09:29:21.627

Reputation: 61

1On which interpreter does this print output? – Leaky Nun – 2016-08-06T04:02:38.500

@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. – Seeseemelk – 2016-08-08T10:08:55.487

4

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.

Ben N

Posted 2016-08-04T09:29:21.627

Reputation: 1 623

4

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

Rɪᴋᴇʀ

Posted 2016-08-04T09:29:21.627

Reputation: 7 410

3

Charcoal, 4 bytes (non-competing)

The language is newer than the question.

G+α*

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

DLosc

Posted 2016-08-04T09:29:21.627

Reputation: 21 213

2Updated to work in the latest version and an alternate solution. – totallyhuman – 2017-09-03T23:01:17.390

3

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.

James

Posted 2016-08-04T09:29:21.627

Reputation: 54 537

3

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.

A.B.

Posted 2016-08-04T09:29:21.627

Reputation: 131

2Nice answer! Welcome to the site :) – James – 2017-12-20T21:10:02.200

3

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

famous1622

Posted 2016-08-04T09:29:21.627

Reputation: 451

3

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

Jo King

Posted 2016-08-04T09:29:21.627

Reputation: 38 234

3

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

Destructible Lemon

Posted 2016-08-04T09:29:21.627

Reputation: 5 908

I think you're missing parentheses: print(("*"*9+"*\n")*10) – shooqie – 2016-08-04T09:46:47.907

I think you're missing my update – Destructible Lemon – 2016-08-04T09:48:43.187

I mean your 21-byte solution gives a wrong output. – shooqie – 2016-08-04T09:52:55.030

I'm not sure chronologically which came first the comment or my edit anymore – Destructible Lemon – 2016-08-04T10:25:25.273

I didn't even know about that stderr trick, neat! – sagiksp – 2017-02-17T06:11:43.063

3

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){} )

steenbergh

Posted 2016-08-04T09:29:21.627

Reputation: 7 772

1Maybe put a link to QBIC, for those who aren't familiar with a language? – user48538 – 2016-08-04T09:57:19.733

@zyabin101 I've added a link. – steenbergh – 2016-08-04T10:42:03.653

3

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

Richard Bailey

Posted 2016-08-04T09:29:21.627

Reputation: 131

for(var i=0;i++<10;)Console.Write("**********\n"); is shorter, also, you need a full program or function. – ASCII-only – 2016-08-04T11:08:10.860

@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! – Richard Bailey – 2016-08-04T11:12:40.433

2class 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) – ASCII-only – 2016-08-04T11:21:36.610

@MarsUltor, makes sense - ty! Will keep that in mind when trying to answer the next one. – Richard Bailey – 2016-08-04T11:48:58.100

Welcome to Programming Puzzles & Code Golf! If you want more information on what's acceptable, there's plenty of info on our defaults on meta. And a lot of friendly people in [chat].

– trichoplax – 2016-08-04T12:58:53.863

1You 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. – auhmaan – 2016-08-04T17:23:03.943

@auhmaan ty! Will do – Richard Bailey – 2016-08-04T17:33:24.493

static class Program{static void Main(){string s = "**********\n";foreach(char c in s)System.Console.Write(s);}} – WonderWorker – 2016-08-08T07:40:11.637

2It's a shame Enumerable.Repeat() is so many bytes... C# could move up a lot of these with a shorthand for that function. – Joel Coehoorn – 2016-08-08T19:28:37.037

@Knickerless-Noggins Using var c would be shorter than char c, as would replacing string s with var s. – Zev Spitz – 2016-08-09T14:00:29.027

@Knickerless-Noggins But using foreach doesn't work because the string s is 11 characters not 10. – Zev Spitz – 2016-08-09T14:07:26.200

@Zev Spitz Aww, and there I was thinking I was being really clever too :) – WonderWorker – 2016-08-10T10:28:19.197

@Knickerless-Noggins It was really clever. But you might use WriteLine instead of Write, then the string would be 10 characters instead of 11. – Zev Spitz – 2016-08-10T10:32:36.113

3

Cheddar, 24 bytes

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

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

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

Then, vfuse joins by newline.

Leaky Nun

Posted 2016-08-04T09:29:21.627

Reputation: 45 011

3

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!

Dom Hastings

Posted 2016-08-04T09:29:21.627

Reputation: 16 415

1Keywords may touch the preceding digits. – manatwork – 2016-08-04T12:27:19.203

@manatwork Ahhh... I always forget that works, expecially as for0.. doesn't! Thanks! – Dom Hastings – 2016-08-04T12:29:53.663

1I literally typed out the same program :) – simbabque – 2016-08-04T14:14:43.713

3

><>, 35 bytes

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

Try it online!

owacoder

Posted 2016-08-04T09:29:21.627

Reputation: 1 556

3

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)

Dylan Meeus

Posted 2016-08-04T09:29:21.627

Reputation: 220

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 – 2016-08-04T12:52:10.890

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 – 2016-08-04T12:56:41.280

Replace the for loop with i=10;while(i--) to save 2 bytes. – kamoroso94 – 2016-08-04T22:56:53.647

2for(i=10;i--;) is even shorter – Patrick Roberts – 2016-08-04T23:58:51.097

3

Racket, 43 36 bytes

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

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

Winny

Posted 2016-08-04T09:29:21.627

Reputation: 1 120

1Can be shorter with just (i 10) rather than (i (range 10)). – rnso – 2016-09-06T23:11:57.593

3

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.

Anuj Tripathi

Posted 2016-08-04T09:29:21.627

Reputation: 211

Welcome to PPCG! I would say you need to count those spaces in your bytecount, since they are required to execute your code – applejacks01 – 2016-08-04T15:30:57.027

@applejacks01 Thanks for your input. I have modified it. – Anuj Tripathi – 2016-08-04T15:32:46.587

2Couldn't you just do Select top 10 '**********' from systypes? – pinkfloydx33 – 2016-08-06T14:41:28.167

Didn't see there was already a TSQL answer. You can do it in 24 bytes by just using Print and "Go 10" – Paul – 2018-02-12T11:25:33.693

3

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.

Delioth

Posted 2016-08-04T09:29:21.627

Reputation: 221

1Ah, 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. – Delioth – 2016-08-04T17:45:18.010

3

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

TuxCrafting

Posted 2016-08-04T09:29:21.627

Reputation: 4 547

3

><>, 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

Sp3000

Posted 2016-08-04T09:29:21.627

Reputation: 58 729

3

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.

Business Cat

Posted 2016-08-04T09:29:21.627

Reputation: 8 927

I think you're missing a HERE IS MY INVITATION i between lines 6 and 7. – ceilingcat – 2017-09-04T03:54:33.863

2

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.

MickyT

Posted 2016-08-04T09:29:21.627

Reputation: 11 735

2

Lua, 34 bytes

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

Josh

Posted 2016-08-04T09:29:21.627

Reputation: 1 021

2

Google Sheets, 31 23 bytes

Code:

In cell A1 (12 bytes):

=REPT(B1,10)

In cell B1 (11 bytes):

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

Result:

enter image description here

Previous Attempt #1 (31 bytes):

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

Previous Attempt #2 (also 31 bytes):

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

Grant Miller

Posted 2016-08-04T09:29:21.627

Reputation: 706

2

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
   R                 Return to stack1
    #*               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

Skidsdev

Posted 2016-08-04T09:29:21.627

Reputation: 9 656

Please tag the answer with non-competing. – Leaky Nun – 2017-06-08T08:09:04.740

15 bytes – Leaky Nun – 2017-06-16T08:00:31.987

2

Javascript (REPL), 27 bytes, Old is 32 bytes. Thanks to @Peter

('**********\n').repeat(10)

NTCG

Posted 2016-08-04T09:29:21.627

Reputation: 151

1Welcome to PPCG! Please note that we count REPL submissions differently from full-program solutions, so this should be marked as "Javascript (REPL)". – Mego – 2018-02-13T02:32:28.513

@Mego Thank you, I will remember this! – NTCG – 2018-02-13T02:49:18.380

('**********\n').repeat(10) is shorter :) – Peter – 2018-02-13T21:27:04.607

Welcome to PPCG :) Note that this solution already exists: https://codegolf.stackexchange.com/a/88660/58974. However, you can remove the brackets around the string and use a template literal with a literal newline to save 3 bytes: https://tio.run/##y0osSyxOLsosKNHNy09J/Z@cn1ecn5Oql5OfrvE/QQsOuBL0ilILUhNLNAwNNP9r/gcA

– Shaggy – 2018-02-15T11:54:23.487

2

Befunge-93 (PyFunge), 28 bytes

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

Try it online!

MildlyMilquetoast

Posted 2016-08-04T09:29:21.627

Reputation: 2 907

2

Kotlin (script), 32 bytes

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

Try it online!

Run this locally as a standalone program by

  • installing Kotlin
  • saving the source to a .kts file
  • run with kotlinc -script myfile.kts

This does not seem to work on TIO, for whatever reason, which is why I had to include the header/footer.

snail_

Posted 2016-08-04T09:29:21.627

Reputation: 1 982

You could run this as a standalone program using the -script command line switch on kotlin. This doesn't work in TIO/kotlinc though. – snail_ – 2018-05-25T19:01:21.533

I wasn't aware this is possible. If you want to link the script version on TIO, you could do it this way.

– ovs – 2018-05-25T19:35:29.010

{print("**********\n".repeat(10))} – mazzy – 2018-07-02T08:18:53.087

2

Kotlin, 62 bytes

fun main(a:Array<String>){for(i in 0..9)println("**********")}

Try it online!

JohnWells

Posted 2016-08-04T09:29:21.627

Reputation: 611

your golfed version 37 bytes: {for(i in 0..9)println("**********")}. -3 byte version {print("**********\n".repeat(10))} ))) – mazzy – 2018-07-02T08:15:16.090

2

Java (OpenJDK 8), 61 bytes

static{for(int i=0;i++<10;)System.out.println("**********");}

Try it online!

Nitish

Posted 2016-08-04T09:29:21.627

Reputation: 21

2

05AB1E, 9, 8 bytes

Tƒ,TF'*+

my first golfing answer so any tips are welcome

Try it online!

Tomb

Posted 2016-08-04T09:29:21.627

Reputation: 21

1That's a grid of 10x9, not 10x10 – mbomb007 – 2018-07-02T14:34:05.720

didn't notice that, fixed it @mbomb007 – Tomb – 2018-07-02T14:41:37.307

2

MathGolf, 6 bytes

⌂♀*♂/n

Try it online!

Explanation

⌂       Push "*"
 ♀*     Multiply by 100
   ♂/   Divide into chunks of 10
     n  Join with newline

With an output control flag this could be 5 bytes, but I don't have that yet.

maxb

Posted 2016-08-04T09:29:21.627

Reputation: 5 754

Out of curiosity, why is there a single-byte builtin to push the * character? Or are there builtins for *, +, -, and / and some kind of eval functionality for a mathematical expression in string format? – Kevin Cruijssen – 2018-09-20T15:26:14.703

2When I made the language, I wanted one single printable character to satisfy printing challenges where any character is valid. Luckily enough, I chose the asterisk! I also have a space character as a single command. – maxb – 2018-09-20T19:01:01.387

2

Keg, 10 bytes

(
|(
|\*)
)

Explanation

(\n|           Start for loop iterating 10 times
    (\n|       Start for loop iterating 10 times
        \*     Push an asterisk
          )    End loop
           \n  Push a newline

Try it online!

user85052

Posted 2016-08-04T09:29:21.627

Reputation:

Apparently the final ) is not needed, only the newline in front of it. At least for the TIO version. – manatwork – 2019-10-14T14:20:03.873

2

Rust, 49 bytes

fn main(){print!("{}","**********\n".repeat(10))}

My first code golf answer!

InxaneNinja

Posted 2016-08-04T09:29:21.627

Reputation: 328

1

Welcome to the site! You might want to add a link to Try It Online with your code, so other people can test your program.

– mabel – 2020-01-22T14:06:08.993

2

Python 3, 29 23 bytes

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

Thanks to orlp for shaving off 6 bytes.

helloworld922

Posted 2016-08-04T09:29:21.627

Reputation: 2 503

1We require either a full program or a function. An expression is not sufficient. – orlp – 2016-08-04T09:35:43.693

Yes, I'm referring to your second paragraph. – orlp – 2016-08-04T09:36:50.490

1print((10*"*"+"\n")*10) is shorter. – orlp – 2016-08-04T09:37:10.380

darnit we had the same answer :( – Destructible Lemon – 2016-08-04T09:50:45.933

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 – 2016-08-04T13:50:41.007

@GáborFekete exit only works on the repl. – orlp – 2016-08-04T14:08:47.827

@orlp So how does that violate any specification? – Gábor Fekete – 2016-08-04T14:13:44.067

@GáborFekete Python REPL is a different programming language. We define languages by their implementation. – mbomb007 – 2016-09-20T19:47:42.997

2

Golisp, 34 bytes

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

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

TuxCrafting

Posted 2016-08-04T09:29:21.627

Reputation: 4 547

Congratulations! – Leaky Nun – 2016-08-04T10:29:51.970

@LeakyNun For what? – TuxCrafting – 2016-08-04T10:30:33.613

For developing a language. – Leaky Nun – 2016-08-04T10:30:41.297

@LeakyNun Just look at my GitHub repos... – TuxCrafting – 2016-08-04T10:35:11.033

7I didn't say "for developing your first language" – Leaky Nun – 2016-08-04T10:35:31.703

2

SpecBAS - 18 bytes

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

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

Brian

Posted 2016-08-04T09:29:21.627

Reputation: 1 209

2

C#, 79 bytes

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

TheLethalCoder

Posted 2016-08-04T09:29:21.627

Reputation: 6 930

This won't run without static void right? – pay – 2016-08-04T15:49:35.523

@pay has void already not sure if it needs static will check later when I have chance – TheLethalCoder – 2016-08-04T15:59:36.093

2

golflua, 22 characters

~@i=0,9 w"**********"$

Sample run:

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

manatwork

Posted 2016-08-04T09:29:21.627

Reputation: 17 865

2

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!

Rohan Jhunjhunwala

Posted 2016-08-04T09:29:21.627

Reputation: 2 569

119 bytes off – Leaky Nun – 2016-08-27T20:46:43.717

2

Notepad++, ??? keystrokes

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

Ismael Miguel

Posted 2016-08-04T09:29:21.627

Reputation: 6 797

If http://codegolf.stackexchange.com/a/88747/14732 is valid (and has upvotes), this is more than perfectly valid.

– Ismael Miguel – 2016-08-04T20:27:30.493

1@Mego As long as that one exists, this one will exist as well – Ismael Miguel – 2016-08-05T07:47:55.180

2

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.

Dennis

Posted 2016-08-04T09:29:21.627

Reputation: 196 637

2

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

Konamiman

Posted 2016-08-04T09:29:21.627

Reputation: 291

-1 byte: 1FORR=0TO9:?"**********":NEXT – mazzy – 2018-07-02T09:55:39.043

2

Clojure, 38 bytes

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

Simple enough

Michael M

Posted 2016-08-04T09:29:21.627

Reputation: 101

I'm afraid, that should be 38 bytes. Currently it prints only 8 x 8. – manatwork – 2016-08-05T13:17:32.297

You are completely right. I keep posting wrong cases this whole day. – Michael M – 2016-08-05T13:52:19.087

2

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.

owlswipe

Posted 2016-08-04T09:29:21.627

Reputation: 121

I think 10.times{puts'*'*10} works as well and is shorter. – Aaron Christiansen – 2016-08-07T08:26:41.737

2

Scheme, 51 Bytes

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

Alan Third

Posted 2016-08-04T09:29:21.627

Reputation: 147

2

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

»("*"Ҁ+ѿ)Ҁ

Non-competing because I added a few things.

Shorter version with v0.5:

13 bytes / 9 characters:

»("*"ҀƜ)Ҁ

acrolith

Posted 2016-08-04T09:29:21.627

Reputation: 3 728

The repository was deleted. – None – 2019-11-07T10:07:20.783

2

Xtend, 33 bytes

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

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

charlie

Posted 2016-08-04T09:29:21.627

Reputation: 171

2

Deadfish ~, 24 bytes

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

Destructible Lemon

Posted 2016-08-04T09:29:21.627

Reputation: 5 908

1

SmileBASIC, 19 bytes

?("*"*10+" "*40)*10

SB has a 50 character wide console, so printing 40 spaces after the 10 asterisks will bring the cursor to the beginning of the next line

12Me21

Posted 2016-08-04T09:29:21.627

Reputation: 6 110

1

Tcl, 25 bytes

time {puts **********} 10

Try it online!

sergiol

Posted 2016-08-04T09:29:21.627

Reputation: 3 055

1

Carrot, 10 9 bytes, non-competing

*^*9^
^*9

Try it online! (copy & paste only)

*^                //pushes "*" to the stack
*9                //add 9 more copies of itself
                  //stack = "**********"
^\n^              //append a newline to it
*9                //add 9 more copies of the resulting string
                  //implicit output

user41805

Posted 2016-08-04T09:29:21.627

Reputation: 16 320

1

Japt, 9 bytes

Ao ç*pA)·

Test it online! This is, in fact, competing.

How it works

Ao ç*pA)·  // Implicit: A = 10
Ao         // Create the range [0..10).
   ç*pA)   // Fill with "*".repeat(A).
        ·  // Join with newlines. Implicitly print.

ETHproductions

Posted 2016-08-04T09:29:21.627

Reputation: 47 880

Can be 7 bytes these days!

– Shaggy – 2018-02-02T17:45:51.127

1

tinylisp, 62 bytes

(d A(q((n *)(i n(i(disp *)0(A(s n 1)*))*))))
(A 9(q **********

Try it online!

We define a function A with two parameters: n is the number of iterations, and * is a row of asterisks (it will always be ten of them, but it saves bytes to pass that as an argument). If n is truthy (nonzero), we display the asterisk row (with trailing newline) and recurse with n minus 1. If n is falsey (zero), we simply return the asterisk row.

Calling the function with n = 9 results in 9 disp calls; the return value of the function is then displayed, giving us our 10th row.

DLosc

Posted 2016-08-04T09:29:21.627

Reputation: 21 213

1

Syms 1.3, 17 bytes (noncompeting)

{*}10;*{
}~+10;*>

Explanation:

{*}10;*{\n}~+10;*>
{*}                 Pushes "*"
   10;*             Repeats it 10 times.
       {\n}         Pushes \n.
           ~+       Adds it to the end of "*"*10.
             10;*   Repeats it 10 times.
                 >  Outputs.

CalculatorFeline

Posted 2016-08-04T09:29:21.627

Reputation: 2 608

2 bytes can be saved with 1.4's single char string $. – CalculatorFeline – 2017-06-22T15:32:43.543

1

R 34 bytes

While not being elegant at all, it makes what expected in not that many bytes...

cat(rep("**********",10),sep="\n")

Masclins

Posted 2016-08-04T09:29:21.627

Reputation: 914

2write(matrix('*',10,10),'',10,,'') is the same number of bytes with a slightly different approach. – Giuseppe – 2017-06-07T19:28:52.997

1

LibreLogo, 21 bytes

Code:

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

Result:

enter image description here

Grant Miller

Posted 2016-08-04T09:29:21.627

Reputation: 706

1

MATLAB / Octave, 23 bytes

Code:

m=[eye(10) ''];m(:)='*'

Try It Online!

Result:

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

Grant Miller

Posted 2016-08-04T09:29:21.627

Reputation: 706

You can replace '*' by 42 to save a byte. Or use [ones(10)+41 ''] – Luis Mendo – 2018-01-08T16:26:09.613

1

Triangular (non-competing) , 28 bytes

A\(A@1].p-p..pA@...](/*76-1<

Try it online!

Expanded version:

       A 
      \ ( 
     A @ 1 
    ] . p - 
   p . . p A 
  @ . . . ] ( 
 / * 7 6 - 1 < 

Commands executed, excluding directional commands:

A(1-A(1-67*@p]A@pp]

Leaky Nun

Posted 2016-08-04T09:29:21.627

Reputation: 45 011

How does this work? – caird coinheringaahing – 2017-06-17T15:01:30.157

1

Kotlin, 41 bytes

Submission

fun f()=(0..9).map{println("**********")}

Test

fun f()=(0..9).map{println("**********")}

fun main(args: Array<String>) {
  f()
}

TryItOnline

Link

jrtapsell

Posted 2016-08-04T09:29:21.627

Reputation: 915

I believe lambda body is enough - 33 bytes – mazzy – 2018-07-02T08:38:20.390

1

Java 8, 73 62 bytes

o is a String passed to a Consumer

o->System.out.print("**********".replace("*", "**********\n"))

Roberto Graham

Posted 2016-08-04T09:29:21.627

Reputation: 1 305

o->System.out.print("**********".replace("*", "**********\n")) – Nevay – 2017-09-28T14:19:01.517

1

R: 33 bytes

write.matrix(matrix("*",10,10))

This does assume that you've loaded the MASS library.

xyz123

Posted 2016-08-04T09:29:21.627

Reputation: 123

1

Powershell, 78 bytes

$h=@();$v=@();1..10|% $_{$h+="*"};$i=0;Do{$v+=$h-join'';$i++}while($i-ne10);$v

Code explode:

$numbers = 1..10
$horArray = @()
$verArray = @()

Foreach ($number in $numbers){
    $horArray += "*"
}

$i = 0
Do {
    $verArray += $horArray -join ''
    $i++
}
while ($i -ne 10)
$verArray

Ally Wilson

Posted 2016-08-04T09:29:21.627

Reputation: 9

1

Befunge, 33 bytes

55+:v
_v#:<,"*"-1
^_1-:!#@_55+:,1

Try It Online

How it works

55+:v
....<... Initialises the stack with two 10s as counters.
........ The first is for the outer loop, and the second is the inner

.....
_v#:<... Checks whether the inner counter is 0
._......

.....           If so, decrement the outer counter
_..........       If the outer counter is 0, exit the program
^_1-:!#@_55+:,1   Else print a newline and reset the outer loop counter

.....
.....,"*"-1 Else, decrement the inner counter and print an *
........... And run the inner loop again

Jo King

Posted 2016-08-04T09:29:21.627

Reputation: 38 234

1

Befunge-98, 19 15 bytes

a1_@#:-,ka:k8*'

Try It Online

First time using 98 instead of 93. Both the k and ' commands are immensely useful.

Jo King

Posted 2016-08-04T09:29:21.627

Reputation: 38 234

1

Forth (gforth), 36 34 bytes

: f 9 for ." **********" cr next ;

Try it online!

-2 bytes thanks to @bubbler

Explanation

 10 0            \ put 10 and 0 on the stack
 do              \ begin a loop from 0 to 10 (0 inclusive 10 exclusive)
 ." **********"  \ print the string literal ********** (the initial space is required because forth words are space separated, and ." is not an exception)
 cr              \ print out a new line character
 loop            \ end the loop

reffu

Posted 2016-08-04T09:29:21.627

Reputation: 1 361

Using for..next loop is 2 bytes shorter: Try it online!

– Bubbler – 2019-10-12T08:13:38.567

1

Io, 32 bytes

10repeat("*"repeated(10)println)

Try it online!

iovoid

Posted 2016-08-04T09:29:21.627

Reputation: 411

1

Canvas, 5 bytes

*A×A*

Try it online!

With notes (not valid code, as Canvas does not support comments):

          Print the following (implicit)
*         The string "*"
 A×      Duplicated 10 times horizontally
    A*  Duplicated 10 times vertically

hakr14

Posted 2016-08-04T09:29:21.627

Reputation: 1 295

1

Julia, 23 bytes

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

Explanation:

print(                ) # Print
      (           )     # A string consisting of 
       "*"^10           # "*" duplicated 10 times
             *"\n"      # then concatenated to a newline
                   ^10  # which is then duplicated 10 times

eaglgenes101

Posted 2016-08-04T09:29:21.627

Reputation: 577

1

Japt -R, 5 bytes

AÆAî*

Test it

Shaggy

Posted 2016-08-04T09:29:21.627

Reputation: 24 623

1

Japt -R, 5 bytes

AÆAç*

Try it online!

Unpacked & How it works

Ao@Aç*

Ao@    Map range(10) with a function that returns...
Aç*      "*" repeated 10 times.
       `-R` flag joins the result array with "\n"
       Implicit output

Bubbler

Posted 2016-08-04T09:29:21.627

Reputation: 16 616

1

Q'Nial7, 15 bytes

10 10reshape'*'               #create atom '*', reshape to 10 by 10 matrix

M L

Posted 2016-08-04T09:29:21.627

Reputation: 2 865

1

Python 2, 20 bytes

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

I didn't know you could remove the space between print and the string.

juniorRubyist

Posted 2016-08-04T09:29:21.627

Reputation: 875

1

Z80Golf, 14 bytes

00000000: 0a4f 3e2a 46ff 10fd 7eff 0d20 f576       .O>*F...~.. .v

Try it online!

Disassembly

start:
  ld a, (bc)  ; 0a
  ld c, a     ; 4f
loop1:
  ld a, '*'   ; 3e 2a
  ld b, (hl)  ; 46
loop2:
  rst $38     ; ff
  djnz loop2  ; 10 fd
  ld a, (hl)  ; 7e
  rst $38     ; ff
  dec c       ; 0d
  jr nz, loop1  ; 20 f5
  halt        ; 76

Golfing nested loops

Since a is the parameter to putchar, I used b and c for loop counters. The loop constructs are

  ld b, ... ; 1 or 2 bytes
loop:
  (loop content)
  djnz loop ; 2 bytes

and

  ld c, ... ; 1 or 2 bytes
loop:
  (loop content)
  dec c     ; 1 bytes
  jr nz, loop ; 2 bytes

This combination of 2-level nested loops is optimal in Z80Golf.

Reusing the first instruction as data

The first byte 0a is located at memory address $0000. Since hl is always zero in this program, we can use the one-byte instruction ld r, (hl) whenever we need the constant 0a, instead of the two-byte ld r, $0a.

In this particular challenge, the byte $0a has three uses: the outer loop, the inner loop, and the newline character. The byte as an instruction is not particularly useful, so we save two bytes here.

Bubbler

Posted 2016-08-04T09:29:21.627

Reputation: 16 616

1

Matlab, 17 bytes

@()repmat('*',10)

Try it Online

DimChtz

Posted 2016-08-04T09:29:21.627

Reputation: 916

1

MBASIC, 32 bytes

1 WIDTH 10:PRINT STRING$(100,42)

RUN
**********
**********
**********
**********
**********
**********
**********
**********
**********
**********

No loop. Just printing 100 asterisks into a 10 character wide terminal to force line wraps.

There's no MBASIC on TIO, so I've linked the reference manual.

wooshinyobject

Posted 2016-08-04T09:29:21.627

Reputation: 171

1

Shakespeare Programming Language, 387 bytes

,.Ajax,.Ford,.Act I:.Scene I:.[Exeunt][Enter Ajax and Ford]Ford:You be twice the sum ofa cat twice twice the sum ofa cat a big big cat.Speak thy.Speak thy.Speak thy.Speak thy.Speak thy.Speak thy.Speak thy.Speak thy.Speak thy.Speak thy.You be twice the sum ofa cat a big big cat.Speak thy.Ajax:You be the sum ofyou a cat.Be you nicer the sum ofa cat a big big big cat?If notlet usScene I.

Try it online!

JosiahRyanW

Posted 2016-08-04T09:29:21.627

Reputation: 2 600

352 bytes – Jo King – 2018-09-27T17:24:10.400

1

q, 12 bytes

10 10#get"*" / a 10x10 matrix

Thaufeki

Posted 2016-08-04T09:29:21.627

Reputation: 421

10 10#(*) should have the same effect. But I'm not sure if spaces are allowed between asterisks. – ngn – 2018-09-28T01:24:19.390

1

Gol><>, 9 bytes

aFa:R`*|H

There is a trailing newline, but the specs say it is okay. Below is a version that doesn't have a trailing new line, but adds on 2 extra bytes.

aFaR`*a|~rH

Try it online!

KrystosTheOverlord

Posted 2016-08-04T09:29:21.627

Reputation: 681

1

R 33 bytes

cat(rep('**********',10),sep='
')

Try it online

I believe this is shorter than the other R answers on this question.

CT Hall

Posted 2016-08-04T09:29:21.627

Reputation: 591

I believe this is shorter than yours, but Mamie's answer on the first page (sorted by oldest) is something like 26 bytes if the comments are to be believed.

– Giuseppe – 2019-02-19T22:14:38.277

Ah, I'd missed that one, thanks @Giuseppe. – CT Hall – 2019-02-19T22:31:22.950

1

C# (.NET Core), 53 bytes

Brand new to code golf, is this type of format allowed to be used (Usage of the header section / footer section)?

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

Try it online!

Authentically Shy

Posted 2016-08-04T09:29:21.627

Reputation: 11

Welcome to PPCG, and Great First Answer – Taylor Scott – 2019-02-19T22:46:25.507

You can get it down to 49 bytes by moving the i++ into the conditional expression, and moving the block body into the increment statement: for(int i=0;i++<10;Console.Write("**********\n")); (try it online)

– mgthomas99 – 2019-02-20T14:47:43.013

1

This is not valid since it's neither a function (lambdas count) nor is it a full program. With a few adjustments though, 42

– ASCII-only – 2019-02-20T16:29:54.837

@mgthomas99 btw that's 50 bytes, and it makes no difference whether the write is inside or outside – ASCII-only – 2019-02-20T16:30:57.003

1

CSS only, 157 109 bytes

Inspired by hd answer, probably 1:1 reproduced from OP question (except background color)

body:after,body:before{white-space:pre;content:'**********\A**********\A**********\A**********\A**********\A'

Kamil Kiełczewski

Posted 2016-08-04T09:29:21.627

Reputation: 531

1103 bytes: *,:after{margin:0;white-space:pre;content:'**********\A**********\A**********\A**********\A**********\A (FireFox only, save it inside <style>...</style> in a totally empty file), the :after matches every element's after (in this case html and body) and * is used to remove the body margin. – Night2 – 2019-10-15T05:43:55.057

1

Perl 5, 18 Bytes

say'*'x10for 1..10

Requires the -E flags, as in:

perl -E "say'*'x10for 1..10"

booshlinux

Posted 2016-08-04T09:29:21.627

Reputation: 81

1

PHP, 26 bytes

Just used a compressed string. Has raw output of gzdeflate and contains unprintable binary data, so the code itself and direct TIO link cannot be posted here, but here is a hex dump of it:

000000  3c 3f 3d 67 7a 69 6e 66 6c 61 74 65 28 22 d3 d2  <?=gzinflate("..
000010  82 01 2e 2d 9a 33 01 22 29 3b                    ...-.3.");

Save it as a binary file then execute it like this: php asterisks.php

TIO which uses bash to run this file: Try it online!

Night2

Posted 2016-08-04T09:29:21.627

Reputation: 5 484

1

APL (Dyalog Classic), 11 bytes

⎕←10 10⍴'*'

Try it online!

Explanation

⎕←          ⍝ Output
   10 10⍴'*' ⍝ The asterisk reshaped into a 10 by 10 grid

user85052

Posted 2016-08-04T09:29:21.627

Reputation:

1

JAPT, 12 bytes

'*
pA)+R
VpA

Japt sets vars automatically, so '* sets U to "*" pA)+R prints U out A(10) times. And adds a new line (+R). All this is set to V. VpA prints V out A times

In Regular JS is

U = "*";
V = (U.p(A)) + R;
V.p(A)

Elijah Shope

Posted 2016-08-04T09:29:21.627

Reputation: 11

1

naz, 44 40 bytes

1x1f6a7m9o1o4d1o0m0x1f1f1f1f1f1f1f1f1f1f

This is another one of those cases where a truly recursive definition would actually use more bytes than just repeating the f instruction.

Edit: Saved 4 bytes by using division instead of subtraction.

Explanation (with 0x commands removed)

1x1f                   # Function 1
    6a7m9o1o           # Output 10 asterisks
            4d1o       # Output a newline
                0m     # Reset the register
1f1f1f1f1f1f1f1f1f1f   # Call function 1 ten times

sporeball

Posted 2016-08-04T09:29:21.627

Reputation: 461

1

W d, 7 4 bytes

°♣∩x

Uncompressed

T:s*E

Explanation

T     % Push a 10 onto the stack
 :    % Copy the top of stack
  s*  % Generate 10 asterisks
    E % Foreach in the range 1 .. 10,
      % Print 10 asterisks following a newline

user85052

Posted 2016-08-04T09:29:21.627

Reputation:

1

Scratch 3.0, 4 blocks/65 bytes

SB Syntax:

when gf clicked
delete all of[o v
repeat(10
add[**********]to[o v

Picture:

enter image description here

Try it online Scratch!

I'm quite proud of the block count here, because it matches the byte counts of the winning answers. But SB Syntax ruined things for me. (´• ╭╮ •`)

Lyxal

Posted 2016-08-04T09:29:21.627

Reputation: 5 253

1

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 #\*))))

Steven H.

Posted 2016-08-04T09:29:21.627

Reputation: 2 841

1

Batch, 41 bytes

@for /l %%i in (0,1,9)do @echo **********

Neil

Posted 2016-08-04T09:29:21.627

Reputation: 95 035

You can shave off 1 byte by removing the first @ – SomethingDark – 2016-08-06T03:44:42.427

@SomethingDark But then it would print for /l %%i in (0,1,9)do @echo **********... – Neil – 2016-08-06T09:39:06.957

It didn't when I tested it – SomethingDark – 2016-08-06T09:39:56.803

@SomethingDark You mean as an immediate command? As it's a single line, you might be on to something there. – Neil – 2016-08-06T09:45:11.143

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 – 2016-08-06T09:46:56.180

@SomethingDark It definitely echoes the command back to me when it's in a script. – Neil – 2016-08-06T09:49:44.583

Hmm, so it does.Not sure what I was doing before. – SomethingDark – 2016-08-06T09:54:48.223

@SomethingDark I don't think an immediate command would be allowed as it counts as a REPL environment (which is slightly different from the environment of a batch script). – Neil – 2016-08-06T17:47:12.173

1

Pyke, 6 bytes

TVT\**

Try it here!

       - (T = 10)
TV     - repeat(10):
  T\** -  10*"*"

Blue

Posted 2016-08-04T09:29:21.627

Reputation: 26 661

1

Frink, 40 39 Bytes

for r=0 to 9
  println[repeat["*",10]]

-1 Byte @LeakNun

Frink User

Posted 2016-08-04T09:29:21.627

Reputation: 21

4You can probably use 0 to 9 – Leaky Nun – 2016-08-04T11:18:31.410

1

BASH, 46 bytes

for((n=0;n<10;n++));do echo "**********"; done

Joe

Posted 2016-08-04T09:29:21.627

Reputation: 281

1Or for n in {0..9};{ echo "**********";} – manatwork – 2016-08-04T12:43:29.830

Or seq -f%10g 10|tr -c \\n \* in Bash + coreutils. – manatwork – 2016-08-04T14:52:51.777

1

C++, 75 bytes

#include<cstdio>
int main(){for(int i=0;i<10;++i)std::puts("**********");}

arnsong

Posted 2016-08-04T09:29:21.627

Reputation: 31

2Why the downvote? – arnsong – 2016-08-04T13:00:45.083

I believe this was an automatic downvote from the community user. Your post was auto-flagged as low quality (since it only contained code) and Leaky Nun's edit caused an automatic unowned downvote. See http://meta.stackexchange.com/q/236883

– FryAmTheEggman – 2016-08-04T13:03:02.017

Got it. Bummer. – arnsong – 2016-08-04T13:09:43.397

I -1'ed it because you simply took Matthew Roh's answer and applied the suggestions from his comments. So no own effort at all!

– Zaibis – 2016-08-04T13:15:38.333

2That's actually not true. I don't think it's fair to assume. – arnsong – 2016-08-04T13:55:20.913

1You can save 1 byte by changing the for-loop to: for(int i=0;++i<11;) – Kevin Cruijssen – 2016-08-04T14:07:28.303

2Use int main(i) and remove the int i=0. Then, replace i<10;++i with i++<10;. -7 – Erik the Outgolfer – 2016-08-04T14:58:37.020

1

Maple 30 bytes

printf(cat("**********\n"$10))

DSkoog

Posted 2016-08-04T09:29:21.627

Reputation: 560

1

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.

Joel Trauger

Posted 2016-08-04T09:29:21.627

Reputation: 111

See http://codegolf.stackexchange.com/a/88695/11259

– Digital Trauma – 2016-08-04T15:17:25.807

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 – 2016-08-04T15:59:07.300

1

Sprects, 22 bytes

#eeep#eppp#pqqq*
#q***

Note: The interpreter uses U+0020 instead of U+0010.

Erik the Outgolfer

Posted 2016-08-04T09:29:21.627

Reputation: 38 134

1

T-SQL, 50 bytes

print replicate(replicate('*',10)+char(10),10)

alroc

Posted 2016-08-04T09:29:21.627

Reputation: 111

1not an T-SQL expert but wouldn't 'print replicate('**********'+char(10),10)' be shorter? – dwana – 2016-08-05T08:25:49.347

1

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.

Chris Bouchard

Posted 2016-08-04T09:29:21.627

Reputation: 111

1

EXCEL, 26 bytes.

=REPT("**********[ae]",10)

Can go into any cell.

user56309

Posted 2016-08-04T09:29:21.627

Reputation:

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 – 2017-05-04T13:03:42.037

1

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

Ismael Miguel

Posted 2016-08-04T09:29:21.627

Reputation: 6 797

1

PostgreSQL, 39 bytes

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

dwana

Posted 2016-08-04T09:29:21.627

Reputation: 531

1

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!

Leaky Nun

Posted 2016-08-04T09:29:21.627

Reputation: 45 011

1

jq, 24 18 characters

(16 characters code + 2 characters command line option.)

range(10)|"*"*10

Thanks to:

  • Leaky Nun for suggesting to use string multiplication (-6 characters)

Sample run:

bash-4.3$ jq -nr 'range(10)|"*"*10'
**********
**********
**********
**********
**********
**********
**********
**********
**********
**********

On-line test (Passing -r through URL is not supported – check Raw Output yourself.)

manatwork

Posted 2016-08-04T09:29:21.627

Reputation: 17 865

range(10)|"*"*10 – Leaky Nun – 2016-08-05T10:58:21.990

Thank you, @LeakyNun. No idea why I left with the idea that string*number not works. (array*string is the one that not works.) – manatwork – 2016-08-05T11:02:35.917

1

Awk, 37 35 characters

BEGIN{for(OFS="*";++i<NF=11;)print}

Thanks to:

  • Cabbie407 for combining the OFS and loop-based solutions (-2 characters)

Sample run:

bash-4.3$ awk 'BEGIN{for(OFS="*";++i<NF=11;)print}'
**********
**********
**********
**********
**********
**********
**********
**********
**********
**********

manatwork

Posted 2016-08-04T09:29:21.627

Reputation: 17 865

1I managed to shorten it by 2 bytes by combining both approaches BEGIN{for(OFS="*";++i<NF=11;)print} – Cabbie407 – 2016-08-12T19:13:06.350

Wow! Great catch, @Cabbie407. Thank you. – manatwork – 2016-08-13T10:12:59.217

1

C#, 52 50 49 bytes

49 bytes : 'for(int i=0;i++<10;)Console.Write("**********\n")' (Thanks to Csharpie)

50 bytes : for(int i=0;i<10;i++)Console.Write("**********\n")

52 bytes : for(int i=0;i<10;i++)Console.WriteLine("**********")

Close with 70 bytes : Console.WriteLine(String.Concat(Enumerable.Repeat("**********\n",10)))

edit : Test here : Online C# Interactive compiler.

P.S : C# Interactive is there in Visual Studio/Roslyn for a long time, no one said the answer needs to compile into an executable, or that C# is limited to .NET's verbose BCL functions or that C# is limited to Windows. csi.exe would just be same in functionality as other (interpreted) languages' interpreters do (like PowerShell), which is the beauty of C#.

Prajay Basu

Posted 2016-08-04T09:29:21.627

Reputation: 11

You might want to include a link to an online interpretter/compiler so we can test your code. e.g.

– Post Rock Garf Hunter – 2016-08-05T13:10:46.207

This would work almost the same as csi.exe included in Roslyn, although the behavior might not be the same for all cases. – Prajay Basu – 2016-08-05T13:25:38.303

You can shorten it down a bit for(int i=0;i<10;i++) can be written as for(int i=0;i++<10;) – CSharpie – 2016-08-08T19:38:31.883

1

Go, 84 characters

package main;import"fmt";func main(){for j:=0;j<10;j++{fmt.Println("**********");}}

Sample run:

bash$ go build && ./golf
**********
**********
**********
**********
**********
**********
**********
**********
**********
**********

Tom Scanlan

Posted 2016-08-04T09:29:21.627

Reputation: 11

Print ten asterisks without using a loop – Leaky Nun – 2016-08-05T15:26:11.647

removed inner loop per @LeakyNun – Tom Scanlan – 2016-08-06T02:10:31.860

1

Underload, 22 bytes

(*****):*(
)*:*::*:**S

MegaTom

Posted 2016-08-04T09:29:21.627

Reputation: 3 787

1

MarioLANG, 101 99 95 bytes

Saved 2 bytes thanks to Martin Ender.

Try it Online!

+
++++)+<......(<
++====".======"
+>)+(()>...(.
+====(-=====) -
+++++[!))++ )[!
======#=======#

The left half sets the tape to 10 40 10

The second half increases the 40 to 42, then prints the 42 (*) 10 times, and a newline, and repeats that 10 times.

Business Cat

Posted 2016-08-04T09:29:21.627

Reputation: 8 927

Link? – – – – – – Leaky Nun – 2016-08-05T17:01:29.620

@LeakyNun Sorry I completely forgot. Edited it in. – Business Cat – 2016-08-05T17:06:30.840

1

Gibberish, 29 bytes

56ea1[[**********]eo1su1fu]gw

Explanation:

56ea1[[**********]eo1su1fu]gw |
56                            | push 5 and 6
  e                           | switch to first instruction set
   a                          | add a, b
    1                         | push 1
     [[**********]eo1su1fu]   | push string
                           g  | switch to set 3
                            w | while a is 1 execute string as code
      [**********]            | push ten asterisks
                  e           | switch to set 1
                   o          | print a
                    1s        | subtract one
                      u       | duplicate a
                       1      | push 1
                        f     | switch to set 2
                         u    | pop a, b push 1 if a > b else push 0

acrolith

Posted 2016-08-04T09:29:21.627

Reputation: 3 728

1

Neoscript, 39 bytes

each _=0:[]:9console:log("**********");

TuxCrafting

Posted 2016-08-04T09:29:21.627

Reputation: 4 547

1

VBA, 31 bytes

for i=0to 9:?"**********":next

in the VBA Immediate window. I couldn't find any byte-saving tricks beyond this. My best non-loop version was 45 bytes:

?replace("..........",".","**********"&vblf)

Joffan

Posted 2016-08-04T09:29:21.627

Reputation: 832

1

Vitsy, 13 bytes

I'm late to the party. :c

a\[aa\['*']Z]

Try it online!

Addison Crump

Posted 2016-08-04T09:29:21.627

Reputation: 10 763

1

PHP 46 bytes

<?php
for($i=-2;++$i<9;)echo "**********\n";?>

I think this don't needs explanation.

Roman Gräf

Posted 2016-08-04T09:29:21.627

Reputation: 2 915

1

Swift, 35 Bytes

for _ in 0...9{print("**********")}

Alexander - Reinstate Monica

Posted 2016-08-04T09:29:21.627

Reputation: 481

1

Brachylog, 15 bytes

9ye,"*":9jw@Nw\

Try it online!

Explanation

This exploits backtracking to loop; we create ten useless choice points at the beginning so that it writes ten times the string "**********\n".

9ye,         Pick a number between 0 and 9 (there are thus 10 choice points here)
"*":9j       Concatenate "*" 9 times to itself
w@Nw         Write that string and write a line break
\            False (trigger backtracking: pich another one of the ten numbers)

Fatalize

Posted 2016-08-04T09:29:21.627

Reputation: 32 976

1

Convex, 10 bytes

A'**{A*N}%

Try it online!

GamrCorps

Posted 2016-08-04T09:29:21.627

Reputation: 7 058

1

Fortran, 68 51 49 bytes

Skimmed off 17 bytes, because who needs indents and spaces?

-2 bytes thanks to @Joffan

As a tribute to senior and the fact there was no Fortran answer yet. Well, now I know why: this is a pretty hard language to golf! Just one or two indents already take up more bytes than the shortest answer here :)).

program T
do i=0,9
print*,('*',j=0,9)
end do
end

Try it! (ideone)

I tried golfing it down by introducing a nested 'implied' do loop, but the newline character wasn't available until Fortran 2003. Also, it's insanely verbose...

MH.

Posted 2016-08-04T09:29:21.627

Reputation: 261

Loops using 0,9 limits skim off another couple? And make the positive case for not using '**********' :-) – Joffan – 2016-08-19T20:14:01.537

Thanks! Not sure how I didn't think of that. Must've had a temporary brain meltdown :/ – MH. – 2016-08-19T21:00:41.393

@MH. I know I'm late, but program T print'(10(A))',('*',j=0,99) end is 41 bytes long and doesn't print a leading space :-) – Phelype Oleinik – 2019-10-15T02:58:22.300

1

Grocery List, 72 bytes

G

number ten
v
z
v
P
s
u
c
l
number ten
l
b
c
p
u
n
s
e
x
u
c
p
b
n
s
e

Try it online

Business Cat

Posted 2016-08-04T09:29:21.627

Reputation: 8 927

1

LaTeX, 122 110 105 bytes

-12 bytes thanks to @Leaky Nun
-5 bytes by changing package & document type

Or, if I'm allowed to skip the document class definition & setup, and just count the package import and for-loop code: 55 bytes.

I still need to check if there's another package that has a shorter loop syntax, but for now, this simply uses pgffor (from tikz) and a foreach:

\documentclass{book}\usepackage{tikz}\begin{document}\foreach\n in{0,...,9}{**********\par}\end{document}

Ungolfed:

\documentclass{book}
\usepackage{tikz}
\begin{document}
\foreach\n in{0,...,9}{**********\par}
\end{document}

Output (w/ free page number :) ): enter image description here

MH.

Posted 2016-08-04T09:29:21.627

Reputation: 261

1********** is shorter than \foreach\n in{0,...,9}{*} – Leaky Nun – 2016-08-14T13:54:56.923

Good point! Not sure how I missed that... Must've been too focused on getting the nested loop going :) Thanks! – MH. – 2016-08-14T14:10:31.987

\\ is shorter than \par – Leaky Nun – 2016-08-14T14:11:14.540

True, but then the result is no longer a proper grid as the first line will be indented. – MH. – 2016-08-14T14:27:05.560

1

TI-Basic, 21 bytes

For(I,0,9
Disp "**********
End

Timtech

Posted 2016-08-04T09:29:21.627

Reputation: 12 038

1

GolfScript, 27 bytes

0{"**********\n"\1+.10<}do;

Try it online!

Explanation

0              # Push 0 onto the stack: counter
{
"**********\n" # Push 10 '*' and a newline character
\              # Moves the counter onto the stack
1+             # Increments the counter
.10<           # Check if it's smaller than 10
}do;           # Repeat until counter equals 10

FedeWar

Posted 2016-08-04T09:29:21.627

Reputation: 271

1

You know, you can just do this

– Leaky Nun – 2016-08-28T19:26:11.293

I'm a newbie, I didn't know, thank you! – FedeWar – 2016-08-28T19:27:51.347

Another byte saved – Leaky Nun – 2016-08-28T19:28:54.127

12 bytes now – Leaky Nun – 2016-08-28T19:29:13.827

Wow, I still have a lot to learn. – FedeWar – 2016-08-28T19:30:35.553

@LeakyNun You don't need the [. – Dennis – 2016-08-28T19:37:40.450

@Dennis Wow, I still have a lot to learn. – Leaky Nun – 2016-08-28T19:46:31.690

1

GNU sed, 27 bytes

s/^/**********/;h;H;G;H;g;G

To add to the diversity of languages used, I present a sed solution. The code works as follows, indicating the number of sets of 10 asterisks in pattern space and then in hold space:

s/^/**********/        # 10 asterisks are added to pattern space      (1 0)
h                      # overwrites hold space with pattern space     (1 1)
H                      # appends pattern space to hold space          (1 2)
G                      # appends hold space to pattern space          (3 2)
H                      #                                              (3 5)
g                      # overwrites pattern space with hold space     (5 5)
G                      # after G, pattern space is printed on exit   (10 5)

seshoumara

Posted 2016-08-04T09:29:21.627

Reputation: 2 878

1

Thue, 30 bytes

%::=~**********
::=
%%%%%%%%%%

Try it online!


Thue, 53 bytes

%::=,*,*
>*::=>[
>,::=>]]
[::=~
]::=~*****
::=
>%%%%%

Uses the convention that "when a string is sent to the output stream, no newline is printed at the end, except if the string is empty, in which case a newline is all that is printed." This is not followed by the TIO interpreter.

MegaTom

Posted 2016-08-04T09:29:21.627

Reputation: 3 787

1

S.I.L.O.S, 41 bytes

Never used S.I.L.O.S before, can probably be golfed more.

EDIT: Looks like there was already a S.I.L.O.S answer, but it didn't show up on the leaderboard. But I'll keep this answer because it's shorter.

a=10
lblb
printLine **********
a-1
if a b

Try it online!

acrolith

Posted 2016-08-04T09:29:21.627

Reputation: 3 728

1

BrainFuck, 68 Bytes

++[>+++++<-]++[>>>+++++<<<-]++++++[>>+++++++<<-]>[>..........>.<<-]

BrainFuck is fun, this is me practicing my skills.

Mitchell Humphrey

Posted 2016-08-04T09:29:21.627

Reputation: 348

0

memes, 17 bytes

d5+5’{p

Needs ********** as input, therefore +10.

d      Don't print result
5+5    10 times
’      loop
{p     Print input

devRicher

Posted 2016-08-04T09:29:21.627

Reputation: 1 609

0

C++ 83 bytes 82 Thanks to matthew roh!

#include <iostream>
int main(){for(int i;i++<10;){std::cout<<"**********"<<"\n";}}

Try Me Online!

GCaldL

Posted 2016-08-04T09:29:21.627

Reputation: 21

Maybe i++<10 would help? – Matthew Roh – 2017-02-06T07:06:19.637

Unfortunately It seems to returns an invalid syntax error :\ – GCaldL – 2017-02-09T01:57:05.003

Hm? It works for me. – Matthew Roh – 2017-02-09T07:27:17.210

Amateur Mistake... As the last argument in a for statement I didn't expect ; was required etc. for(int i;i<10;i++) returns an error expected ')' before ';' when written as for(int i;i<10;i++;) – GCaldL – 2017-02-09T23:29:02.000

0

8th, 28 bytes

( "*" 10 s:* . cr ) 10 times

Chaos Manor

Posted 2016-08-04T09:29:21.627

Reputation: 521

0

Scala, 23 bytes

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

Almost the same as python solution.

Aria Ax

Posted 2016-08-04T09:29:21.627

Reputation: 321

0

Perl, 22 bytes

print"**********\n"x10

Kjetil S.

Posted 2016-08-04T09:29:21.627

Reputation: 1 049

0

QC 41 bytes

&FF002A2A2A2A2A2A2A2A2A2A0D0AFF##########

&FF00 Write hex to memory at address 00 until FF is reached
2A2A2A2A2A2A2A2A2A2A0D0AFF 10 asterisks with a new line and the terminator at the end
########## Print contents of memory 10 times until first 00 is reached

Could be made shorter if loops were used.

cookie

Posted 2016-08-04T09:29:21.627

Reputation: 271

0

Z80 TI-83+, 53 bytes

.nolist
#include "ti83plus.inc"
#define    ProgStart    $9D95

.list
.org    ProgStart - 2
    .db    t2ByteTok, tAsmCmp
    bcall(_homeup)
    ld A, 0
    ld (PenCol), A
Do:
    inc A
    ld hl, msg
    bcall(_PutS)
    bcall(_NewLine)
    cp 10
    jr NZ, Do
    ret
msg:
    .db "**********", 0
.end
.end

Compiled with SPASM.

Conor O'Brien

Posted 2016-08-04T09:29:21.627

Reputation: 36 228

0

Sinclair ZX81/Timex TS1000/1500

Simple enough I think

Method 1, 55 bytes (listing):

 1 LET A=0
 2 PRINT "**********"
 3 LET A=A+1
 4 GOTO 2+((A=9)*3)

Method 2, 30 bytes (listing)

 1 FOR I=0 TO 9
 2 PRINT "**********"
 3 NEXT I

Shaun Bebbers

Posted 2016-08-04T09:29:21.627

Reputation: 1 814

The ZX81 has a 1-byte ** (which is shift and H); this will save 5 bytes from each listing and might even be a bit quicker. ** is used for to the power of. – Shaun Bebbers – 2017-02-17T12:29:05.850

0

Japt, 9 bytes

Ao@'*pA÷

Try it online!

Non-competitive solutions using the new flag features in Japt:

-R flag.

-x flag.

-Sx flags.

-P flag.

Oliver

Posted 2016-08-04T09:29:21.627

Reputation: 7 160

0

Syms, 24 bytes

{*}10;*[[[[[[[[[{~>[)}[)

The interpreter as provided errors immediately, but changing line 2 to if True: fixes it. (Is this allowed? Seems like it.)

Explanation:

{*}10;*[[[[[[[[[{~>[)}[)
{*}                       Add '*' to the stack.
   10;*                   Repeat it 10 times.
       [[[[[[[[[          Duplicate 9 times (there are now 10 copies on the stack)
                {~>[)}    Swap, output, duplicate, run (prints element below tos (top of stack) and then executes tos, stack is now (copies, this))
                      [)  Duplicate and run (causes infinite loop, exits when '*'*10 copies run out)

CalculatorFeline

Posted 2016-08-04T09:29:21.627

Reputation: 2 608

0

Cardinal, 41 bytes

%++=tt*=>"*******" v
        ^~?-~,"***"<

Try it online!

fəˈnɛtɪk

Posted 2016-08-04T09:29:21.627

Reputation: 4 166

25 bytes – Jo King – 2018-09-18T10:24:30.417

0

Python 3 (35 bytes)

for x in range(1,11):print("*"*10)

hubacub

Posted 2016-08-04T09:29:21.627

Reputation: 161

range(10) works. – CalculatorFeline – 2017-03-02T22:13:04.320

0

OIL, 55 44 41 bytes, noncompeting

Annotated here for better understanding; remove everything after each ‌# in each line to make it work.

**********# asterisk storage
10#if what's in
14#line 14 (marked with $)
1#is identical to 10 (line 1)
13#jump to line 13 (marked with &)
6#else to line 6; the next line
4#print what's in line 0; 10 asterisks

11#print a newline
8#increment line 14 (marked with $)
14
6#jump to the beginning (line '' == line 0)

3#exit &
0#counter $

L3viathan

Posted 2016-08-04T09:29:21.627

Reputation: 3 151

0

RProgN 2, 8 bytes, Noncompeting

Noncompeting because Language Postdates challenge

°{°`**}*

I decided to take another stab at this, with a much better version of RProgN.

Explained

°{°`**}*
°      *    # Run the contained function Ten (Which ° is a constant for) times.
 {°  *}     # Repeat the referenced string 10 times.
   `*       # Asterisk Literal.
            # This results in 10 strings of 10 `*`s on the stack, which prints as expected.

Try it online!

ATaco

Posted 2016-08-04T09:29:21.627

Reputation: 7 898

0

OCTAVE, 36 bytes

strrep(num2str(ones(10,10)),"1","*")

Makes a 10 by 10 matrix of ones, converts these to strings and then changes the ones to *'s.

Michthan

Posted 2016-08-04T09:29:21.627

Reputation: 323

0

05AB1E, 7 bytes

'*т×Tô»

Try it online!

An alternate solution to the 05AB1E one already provided.

Explanation:

'*т×Tô» 
'*      Push an asterisk
  т×    Repeat the asterisk 100 times: "***********..."
    Tô  Split it into pieces of 10.
      » Join with newlines.
        Implicit print.

Comrade SparklePony

Posted 2016-08-04T09:29:21.627

Reputation: 5 784

0

q/kdb+, 19 13 bytes

Solution:

-1(2#10)#"*";

Example:

q)-1(2#10)#"*";
**********
**********
**********
**********
**********
**********
**********
**********
**********
**********

Explanation:

-1(2#10)#"*"; / solution
         "*"  / the asterisk
        #     / take or reshape
  (2#10)      / list (10;10), 10 rows, 10 columns
-1           ; / print to stdout

streetster

Posted 2016-08-04T09:29:21.627

Reputation: 3 635

0

Syms 1.4, 12 bytes (noncompeting)

$
$*10*+10*>

Try it online!

CalculatorFeline

Posted 2016-08-04T09:29:21.627

Reputation: 2 608

0

C#, 96 bytes

static class P{static void Main(){for(int i=1;i<11;i++)System.Console.WriteLine("**********");}}

Try it online

Deepak Kumar

Posted 2016-08-04T09:29:21.627

Reputation: 11

1Welcome to PPCG! Firstly, you should specify the language and byte count; secondly, this isn't a full program or function, so doesn't meet the standard requirements; thirdly, you can save a bunch of bytes by removing unnecessary whitespace and changing the comparison symbol, like so: for(int i=1;i<11;i++)Console.WriteLine("**********\n"); – F1Krazy – 2017-06-09T07:54:50.210

If this is C#, read this post to learn what your answer should be like. Also, have a look at the other answers to see what the standard format is (header with language name and bytecount, then code...).

– Dada – 2017-06-09T08:15:48.400

0

Micro, 15 bytes

"*"10*10c+10*:/

raddish0

Posted 2016-08-04T09:29:21.627

Reputation: 91

incidentally, the ascii code for newline is 10, so: 10c – raddish0 – 2017-06-09T12:34:33.163

0

Check, 15 bytes

Non-competing as language postdates the challenge

"*">10:r*R]+R*o

Pushes the string * and repeats it ten times, while also storing 10 in the register. Then adds 10 to the end of the string (a newline), then repeats the whole thing 10 times.

Esolanging Fruit

Posted 2016-08-04T09:29:21.627

Reputation: 13 542

Forgot to do that, sorry. – Esolanging Fruit – 2017-06-15T01:12:42.690

0

k, 12 bytes

`0:10 10#"*"

Try it online.

Explanation:

   10 10#"*" /make 10 by 10 matrix of asterisk characters
`0:          /output each row as a line

zgrep

Posted 2016-08-04T09:29:21.627

Reputation: 1 291

0

Perl 5, 66 bytes

$x = 1x10;$x =~ s/\d/*/g;for($i = 1; $i <=10; $i++){print "$x\n";}

Try it online!

xyz123

Posted 2016-08-04T09:29:21.627

Reputation: 123

2You can remove literally all the whitespace – Jo King – 2019-02-19T23:59:02.310

0

Excel VBA, 11 Bytes

Anonymous VBE immediate window function that outputs a 10x10 grid of * to the ActiveSheet object

[A1:J10]="*

Taylor Scott

Posted 2016-08-04T09:29:21.627

Reputation: 6 709

0

Pyth, 6 bytes

Bet there's going to be a shorter Charcoal answer

VT*T"*

Explanation:

VT     Ten times
 *T"*  Output ten asterisks followed by a newline

Try it online!

Stan Strum

Posted 2016-08-04T09:29:21.627

Reputation: 436

---nope :|--- yep

– ASCII-only – 2017-09-07T01:55:48.820

@ASCII-only why am i alive – Stan Strum – 2017-09-07T02:11:47.950

0

4, 56 bytes

4, 5, 6!

3.600426011060310604018016021080250010202049503101010494

Try it online!

For explanation see verbose mode in the tio link - quite straightforward initialization of cells and nested 10x10 loop.

Uriel

Posted 2016-08-04T09:29:21.627

Reputation: 11 708

0

dzaima

Posted 2016-08-04T09:29:21.627

Reputation: 19 048

0

Google Sheets, 22 Bytes

Anonymous worksheet function that takes no input and outputs a 10 x 10 grid of *s to the calling worksheet cell.

=REPT("**********
",10

Taylor Scott

Posted 2016-08-04T09:29:21.627

Reputation: 6 709

0

Symbolic Python, 41 bytes

_=-~(_==_)
_=_**-~_+_
_=("*"*_+"""
""")*_

Try it online!

Explanation

  • _=-~(_==_) sets the value of _ to True, which is interchangeable with 1
  • _=_**-~_+_ performs 2**3+2, resulting in 10, and stores this in _
  • "*"*_ constructs a row, and +"""\n""" appends a newline.
  • This is multiplied by _, 10, to create the square.
  • At the end of execution, the value left in _ is printed.

FlipTack

Posted 2016-08-04T09:29:21.627

Reputation: 13 242

0

SNOBOL4 (CSNOBOL4), 56 50 bytes

O	OUTPUT =DUPL('*',10)
	X =LT(X,9) X + 1 :S(O)
END

Try it online!

Giuseppe

Posted 2016-08-04T09:29:21.627

Reputation: 21 077

0

ABCR, 36 bytes

)))))))BAAAAA4*xAb)))B(7OOOOOOOOOOP(x

Pushes 42 (the character code for *) to queue A, 10 (\n) to B, and then for each value from 9 to 0 print out ten copies of A as a character and one copy of B.

Steven H.

Posted 2016-08-04T09:29:21.627

Reputation: 2 841

0

Acc!!, 68 bytes

Count i while i-10 {
	Count v while v-10 {
		Write 42
	}
	Write 10
}

Try it online!

FantaC

Posted 2016-08-04T09:29:21.627

Reputation: 1 425

0

dc, 41 bytes

[1-d0!>C]sR[42Pd10%0=NlRx]sC[10P]sN100lRx

Try it online!

I know there's dc answer, just wanna do it without dumping stack)

cab404

Posted 2016-08-04T09:29:21.627

Reputation: 141

0

Python 3, 43 34 31 28 bytes

for i in[1]*10:print(10*'*')

Saved 9 bytes thanks to Simon

Saved 3 bytes thanks to Wheat Wizard

Just sprints ten asterisks and in a loop.

Mercury Platinum

Posted 2016-08-04T09:29:21.627

Reputation: 161

There is no need to print \n since each print starts with a new line. Also you can shorten 10*'*'. If you swap to Python 2, you can save another byte by removing a bracket. 31 bytes

– Simon – 2018-02-06T08:18:03.183

30 bytes – Simon – 2018-02-06T08:22:08.210

You can use something other than a range for example [1]*10 – Post Rock Garf Hunter – 2018-02-06T22:45:10.667

If you do [1]*10 you don't need the space after in. – Post Rock Garf Hunter – 2018-02-12T03:55:09.360

0

FALSE, 34 33 26 23 bytes

11[1-$]["**********
"]#

12Me21

Posted 2016-08-04T09:29:21.627

Reputation: 6 110

0

Momema, 44 bytes

a000b0-9 42 0+1*0b=+-10*0-9 10 1+1*1a=+-10*1

Try it online!

Explanation

                                                                     #  b = 0
a   0        #  label a0: jump past label a0 (no-op)                 #  do {
0   0        #            [0] = 0                                    #    a = 0
b   0        #  label b0: jump past label b0 (no-op)                 #    do {
-9  42       #            output chr 42                              #      print '*'
0   +1*0     #            [0] = 1 + [0]                              #      a += 1
b   =+-10*0  #  label b1: jump past label b((1 + !!([0] - 10)) % 2)  #    } while (a - 10 != 0)
-9  10       #            output chr 10                              #    print '\n'
1   +1*1     #            [1] = 1 + [1]                              #    b += 1
a   =+-10*1  #  label a1: jump past label a((1 + !!([1] - 10)) % 2)  #  } while (b - 10 != 0)

Esolanging Fruit

Posted 2016-08-04T09:29:21.627

Reputation: 13 542

0

Micrsocript II, 13 bytes

{"*"s10*P}s9*

SuperJedi224

Posted 2016-08-04T09:29:21.627

Reputation: 11 342

0

Whitespace, 91 bytes

[S S S T    T   S S T   S S N
_Push_100][N
S S N
_Create_Label_LOOP][S S S T N
_Push_1][T  S S T   _Subtract][S N
S _Duplicate][N
T   T   S N
_If_negative_Jump_to_Label_EXIT][S S S T    S T S T S N
_Push_42_*][T   N
S S _Print_as_character][S N
S _Duplicate][S S S T   S T S N
_Push_10][T S T T   _Modulo][N
T   S T N
_If_0_Jump_to_Label_NEWLINE][N
S N
N
_Jump_to_Label_LOOP][N
S S T   N
_Create_Label_NEWLINE][S S S T  S T S N
_Push_10][T N
S S _Print_as_character][N
S N
N
_Jump_to_Label_LOOP]

Letters S (space), T (tab), and N (new-line) added as highlighting only.
[..._some_action] added as explanation only.

Try it online (with raw spaces, tabs and new-lines only).

Explanation in pseudo-code:

Integer i = 100
Start LOOP:
  i = i - 1
  If(i < 0)
    Exit program
  Print "*"
  If(i modulo-10 == 0)
    Print new-line
  Go to next iteration of LOOP

Kevin Cruijssen

Posted 2016-08-04T09:29:21.627

Reputation: 67 575

0

Charm, 50 bytes

f := 10 repeat i
[ [ " * " pstring ] f newline ] f

Try it online!

Funnily enough, this doesn't use loops at all, just repeated code.

LyricLy

Posted 2016-08-04T09:29:21.627

Reputation: 3 313

0

C, gcc 36 bytes

recursive solution. One downside is you need to pass 2 when you call the function to get 10 rows. f(a){a<puts("**********")?f(a+1):0;}

This alternative addresses that issue and you don't have to call the function from main since main is now the recursive function:

main(a){a<puts("**********")-1?main(a+1):0;}

gcc also resolves #include "stdio.h" missing and variable a is implicitly set to an int and initialized to 0.

Geo

Posted 2016-08-04T09:29:21.627

Reputation: 91

3You're not supposed to take input, I believe. – NoOneIsHere – 2018-05-26T01:56:04.150

The second one addresses that. The second one is the entire .c file and takes no arguments when you run the executable. – Geo – 2018-05-26T02:04:19.420

2I see. You need to make that clear then(put the correct code in a code block under the header). – NoOneIsHere – 2018-05-26T02:07:14.780

2The solution you have at the top is an entirely invalid solution, so chuck it and just leave the valid one. – LyricLy – 2018-05-26T04:55:18.370

Try it online! – Taylor Scott – 2018-07-02T15:16:00.177

0

PHP, 60 45 Bytes

Try it online (original answer)

Try it online (saved 15 Bytes thanks to @Titus)

Code (Original)

<?=strtr(str_repeat(base_convert("1ku",36,2),10),["
","*"]);

Code (Titus suggestions)

<?=strtr(str_repeat(11111111110,10),10,"*\n");

About the edit

The change is, using str_repeat(base_convert("1ku",36,10),10) actually uses more bytes than str_repeat(11111111110,10) and the use of string for replacements on strtr instead of an array.

Explanation, Why "1ku"?`

The solution is repeat the string "**********", lets take the base 2 number 11111111110

base 10 = 2046
base  2 = 11111111110
base 36 = 1ku

Basically is repeat a compressed string, and with strtr replace each 1 with a "*" and 0 with a \n

Francisco Hahn

Posted 2016-08-04T09:29:21.627

Reputation: 591

Why don´t You just take a string with the bits instead of the packed number, and use strings instead of array for translation? 45 bytes: <?=strtr(str_repeat(11111111110,10),10,"*\n"); (decbin(2046) is one byte longer than that.) Nice idea though. – Titus – 2018-06-02T11:46:38.360

1(and while you´re at it, you can fix **strtr** to strtr ;-) – Titus – 2018-06-02T11:48:31.453

I just realize that yeah, it's less bytes by using 11111111110 instead of base_convert("1ku", 36,10), i was trully focused on compress the string rather than check the byte count, gonna edit the answer, ty @Titus – Francisco Hahn – 2018-06-02T18:14:34.170

0

Prolog (SWI), 62 59 55 54 bytes

t.
b:-between(0,9,_).
?-b,(b,write(*),1=0;t),nl,1=0;t.

Try it online!

ASCII-only

Posted 2016-08-04T09:29:21.627

Reputation: 4 687

0

Pari/GP, 31 bytes

for(i=1,10,print("**********"))

Try it online!

alephalpha

Posted 2016-08-04T09:29:21.627

Reputation: 23 988

0

Python 3, 28 bytes

print(*['*'*10]*10,sep='\n')

Try it online!

Scott Norton

Posted 2016-08-04T09:29:21.627

Reputation: 101

0

Python 2, 21 bytes

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

Try it online!

Chas Brown

Posted 2016-08-04T09:29:21.627

Reputation: 8 959

0

Glee, 17 bytes

('*'%%10\)%%10,,\

Explanation:

('*'                          create '*'
    %%10                      reshape to length 10
        \)                    monadic segment with CRLF
          %%10                reshape to sequence length 10
              ,,\             expose with LF separators

M L

Posted 2016-08-04T09:29:21.627

Reputation: 2 865

0

Python 3, 22 bytes

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

Felt like entering a Python 3 program too.

juniorRubyist

Posted 2016-08-04T09:29:21.627

Reputation: 875

0

Ahead, 21 18 bytes

~oK:k9*'N@k=11:+1~

Try it online!

snail_

Posted 2016-08-04T09:29:21.627

Reputation: 1 982

0

Powershell, 12 bytes

@('*'*10)*10

Explanation

  '*'*10      create a string with 10 '*'
@('*'*10)     create an array with one element of string with 10 '*'
@('*'*10)*10  repeat elements of this array 10 times

mazzy

Posted 2016-08-04T09:29:21.627

Reputation: 4 832

There is solution from AdmBorkBork.

– mazzy – 2018-07-02T10:03:04.290

0

ORK, 185 bytes

When this program starts:
I have a scribe called W
W is to write "**********\n**********\n**********\n**********\n**********\n**********\n**********\n**********\n**********\n**********"

Try it online!

ORK does everything (even I/O and basic math) with objects. As far as this question goes, looping does not have to be one of them.

JosiahRyanW

Posted 2016-08-04T09:29:21.627

Reputation: 2 600

0

ESOPUNK, 167 78 77 bytes

MARK L
@REP 10
COPY 42 #STDO
@END
COPY 10 #STDO
TEST X = 9
ADDI X 1 X
FJMP L

I haven't been bothered to implement the preprocessor, but this should work when I do.

SIGSTACKFAULT

Posted 2016-08-04T09:29:21.627

Reputation: 585

would it be possible to do an inner repetition? i.e. @REP 10 / @REP 10 / COPY 42 #STDO / @END / COPY 10 #STDO / @END – ETHproductions – 2018-09-28T17:55:19.007

(also, does this language exist online anywhere?) – ETHproductions – 2018-09-28T17:56:17.180

@ETHproductions Nesting @rep is explicitly not allowed in the game's docs. Link added in header. – SIGSTACKFAULT – 2018-09-28T18:34:01.740

0

Julia 1.0, 23 bytes

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

Try it online!

gggg

Posted 2016-08-04T09:29:21.627

Reputation: 1 715

You can change the \n for a literal newline – H.PWiz – 2018-12-23T13:54:21.577

0

A0A0, 145 bytes

A0A0
A0C3G1G1G1G1G1G1G1G1G1G1G1A0
A0P42P42P42P42P42P42P42P42P42P42G3P10A0
A0A1G-3G-3G-3G-3G-3G-3G-3G-3G-3G-3G-3A0
G-3
G-2G-2G-2G-2G-2G-2G-2G-2G-2

The top five lines are for the loop construction. A0A0 deletes instructions whenever it runs them, so those lines ensure that the loop keeps running. On line 3 are ten P42 instructions which print * (42 is the ascii code for an asterisk). The P10 instruction prints a new line.

The bottom line acts as a counter. For every execution of the loop it jumps to there and then jumps back to the loop. This consumes an instruction on that line. There are exactly nine instructions, so when it tries to go there when it has already printed ten lines the program will halt execution (since an empty line swill stop execution in A0A0).

user83174

Posted 2016-08-04T09:29:21.627

Reputation:

0

Pascal (FPC), 57 bytes

var i:word;begin for i:=0to 9do writeln('**********')end.

Try it online!

This is probably the best one as I don't see how this can be improved in 9 characters or less which could be gained by removing *s.

AlexRacer

Posted 2016-08-04T09:29:21.627

Reputation: 979

0

Premier, 8 bytes

'*U*N+U*

Try it online!

The boring way.

Explanation

'*U*N+U*     full program
'*           push "*"
  U          push 10
   *         repeat
    N+       append newline
      U      push 10
       *     repeat

Premier, 14 bytes

QnN
**********

Try it online! This second approach uses Premier's implicit data iteration. It iterates over each character in the data (the second line), and executes the program (the first line) for each character. The data QnN pushes the data (Q), outputs it (n), then pushes a newline (N), to be implicitly outputted. This iterates 10 times, printing a 10x10 grid of asterisks.

Conor O'Brien

Posted 2016-08-04T09:29:21.627

Reputation: 36 228

0

Stax, 4 bytes

╪n│╔

Run and debug it

recursive

Posted 2016-08-04T09:29:21.627

Reputation: 8 616

0

MathGolf, 7 bytes

♂⌂*n+♂*

Explanation

♂⌂*     Push asterisk multiplied by 10("**********")
   n    Append a newline
    +   Concatenate the two strings
     ♂* Multiply the string by 10
implicit output

Try it online!

user85052

Posted 2016-08-04T09:29:21.627

Reputation:

0

Python 3, 23 bytes

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

Try it online!

In this case, the obvious answer is best. I tried some other ways, but all were equal or longer in length.
Let me know if you have any answers to add.

23 bytes (alternative)

print(10*f"{10*'*'}\n")

24 bytes

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

25 bytes

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

29 bytes

print("\n".join(10*[10*"*"]))

32 bytes

for _ in range(10):print(10*"*")

43 bytes

print(*(10*"*"for _ in range(10)),sep="\n")

Matthew Jensen

Posted 2016-08-04T09:29:21.627

Reputation: 713

0

Ruby, 15 bytes

puts [?**10]*10

Try it online!

Prints a trailing newline.

?* is the single character *

Explanation

puts [?**10]*10

      ?*        : literal '*' string
        *10     : repeated 10 times ('**********')
     [     ]    : as an element in an array
            *10 : which is also repeated 10 times
puts            : prints each element of the array appended with a newline.

IMP1

Posted 2016-08-04T09:29:21.627

Reputation: 510

0

Husk, 9 bytes

C10*100"*

Try it online!

Length 100 string chopped into 10 pieces.

user85052

Posted 2016-08-04T09:29:21.627

Reputation:

0

C++, 76 bytes

I don't know if this could be golfed further, but just.

#include <iostream>
void a(){for(int i=0;i++<10;)std::cout<<"**********\n";}

user54200

Posted 2016-08-04T09:29:21.627

Reputation:

No, I tried that. – None – 2016-08-04T10:30:02.087

3You can save a few bytes by using puts from cstdio instead of cout (save in header name, function name, plus line terminator for free). Also one byte by making i global (which gets zero initialized for free). – Mat – 2016-08-04T12:23:40.440

This isn't a whole program (no main) so do you need the include? – Jerry Jeremiah – 2018-07-02T00:07:59.700

0

Javascript (using external library - Enumerable) (41 bytes)

_.From("**********\n").Cycle(120).Write()

Link to lib: https://github.com/mvegh1/Enumerable/

Code explanation: This runs right in the console. Load the string into the library, which parses it to a char array enumerable. Create a new enumerable from that sequence, which is generated by cycling from start to finish 120 times (because the string length is 12, and we want 10 of them..12*10=120). I.e [1,2,3].Cycle(10) would be 1,2,3,1,2,3,1,2,3,1. Finally, join everything into a string with "" as delimiter

enter image description here

applejacks01

Posted 2016-08-04T09:29:21.627

Reputation: 989

OH, .length lied to me ahah...I thought it would count "" and "n" as separate characters..fixed! – applejacks01 – 2016-08-04T17:58:56.103

Next time use https://mothereff.in/byte-counter

– Patrick Roberts – 2016-08-05T00:01:04.300

@PatrickRoberts Got it, thanks! – applejacks01 – 2016-08-05T00:07:31.570

0

C# - 88 bytes

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

pay

Posted 2016-08-04T09:29:21.627

Reputation: 101

You can reduce this a bit by using a for look, putting int i inside it for(int i=10;i-->0;) (There is never a reason to use a straight while loop in C# code golf, a for loop is never more expensive) – VisualMelon – 2016-08-04T17:24:41.023

I know, but then I would have been copying and pasting an already existing answer. – pay – 2016-08-04T17:28:00.450

0

Ruby, 18 bytes

puts (?**10+$/)*10

Alternative version (+3 bytes)

10.times {puts ?**10}

Ungolfed (first version)

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

dkudriavtsev

Posted 2016-08-04T09:29:21.627

Reputation: 5 781

Second part of 3aw5TZetdf's Perl tip works in Ruby too.

– manatwork – 2016-08-04T17:43:20.890

0

Perl, 24 bytes

print((("*"x10).$/)x10);

Dancrumb

Posted 2016-08-04T09:29:21.627

Reputation: 163

0

Swift 2, 45 Bytes

func a(){for _ in 0...9{print("**********")}}

Jojodmo

Posted 2016-08-04T09:29:21.627

Reputation: 1 569

0

Wolfram, 22 bytes

Grid[Table["*",10,10]]

Travelling Particle

Posted 2016-08-04T09:29:21.627

Reputation: 1

2Welcome to PPCG! I can't test right now, but I don't think this is a full program (it only displays correctly when used in Mathematica's notebook front end, which constitutes a snippet by this community's standards). If you put this in a source file and call it with wolfram -script file.m I don't think it'll print anything. I think the shortest way to get around that would be Print@@@Table["*",10,10]. Still, nice solution! :) – Martin Ender – 2016-08-04T20:11:30.350

You are correct. Also, your solution works and is 24 bytes long. – Travelling Particle – 2016-08-04T20:29:45.677

0

R

matrix(rep("*",100), nrow = 10)

Probably faster way in R, but fun utilization of matrix

Explanation

rep: repeats first argument as many times as second argument.

matrix: creates matrix from vector (first argument), and nrow is the number rows desired in matrix.

cgage1

Posted 2016-08-04T09:29:21.627

Reputation: 101

1Hi, and welcome to PPCG! However, we require all code to be golfed, which this isn't. Please golf it. – Rɪᴋᴇʀ – 2016-08-05T00:07:26.207

1To make it print the actual desired output you would need to loop cat over it, one way or another. In addition, because of vector recycling, matrix("*",nr=10,nc=10) or array("*",c(10,10)) would be more concise to get the same matrix as the one you generate. – plannapus – 2016-08-05T07:12:14.360

You are right in all regards. This works :for(i in 1:10){for (j in 1:10){cat("*");if(j == 10){cat("\n")}}} – cgage1 – 2016-08-05T16:54:48.553

0

JAISBaL 3.0.1, 9 bytes (non-competing)

h**A10«

Verbose:

# \# enable verbose parsing #\
ten            \# [0] push ten onto the stack #\
push1 *        \# [1] push * onto the stack #\
mul            \# [2] multiply the top two values of the stack #\
dupmany 10     \# [3] duplicate the top value of the stack 10 times #\
popoutallln    \# [4] pop off every value in the stack and print each one with a new line #\

Conventional 10 byte version (using actual for loops):

˖˖S*˄P

Verbose:

# \# enable verbose parsing #\
ten                 \# [0] push ten onto the stack #\
for                 \# [1] start for loop #\
    ten             \# [2] push ten onto the stack #\
    for             \# [3] start for loop #\
        print1 *    \# [4] print * #\
    end             \# [5] end current language construct #\
    ln              \# [6] print a new line #\

This is non-competing because JAISBaL has received a huge amount of updates yesterday and today, and I'm not sure whether or not these instructions were available or did the same thing, furthermore, all the instructions ids have changed...


intepreter

Socratic Phoenix

Posted 2016-08-04T09:29:21.627

Reputation: 1 629

0

Javascript, 45 bytes

for(i=0;i<10;i++) {console.log('**********')}

even better, ES6 Javascript, 38 bytes

console.log('**********\n'.repeat(10))

open console and copy paste to test

svarog

Posted 2016-08-04T09:29:21.627

Reputation: 131

0

Python 3 (22 bytes)

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

niyasc

Posted 2016-08-04T09:29:21.627

Reputation: 101

23 bytes - I believe '\n' is two bytes of code, but if you measured with len it will have said 22. – Jonathan Allan – 2016-08-07T06:16:53.733

0

3var, 27 26 bytes

1 byte thanks to Business Cat

iisiia+<*>aaaF[PPPPPPPPPPO]
aaamaiis*>iiF[PPPPPPPPPPO]

I don't how do nested loops marked by F.

Try it online!

Leaky Nun

Posted 2016-08-04T09:29:21.627

Reputation: 45 011

26 bytes aaamaiis*>iiF[PPPPPPPPPPO] – Business Cat – 2016-08-05T20:12:48.780

@BusinessCat Thanks, do you know why this and this produce different results?

– Leaky Nun – 2016-08-06T04:05:31.770

I don't know. I don't see anything in the docs about needing to put loops on a new line, though they do in their examples. Maybe it's an interpreter error? – Business Cat – 2016-08-06T05:03:41.220

0

Japt, 10 bytes

'*pA +R pA

Prints * ten times, then \n, then repeat from the beginning ten times.

Demo.

nicael

Posted 2016-08-04T09:29:21.627

Reputation: 4 585

0

Arcyóu, 21 bytes

(* "**********\n" 10)

Try it online!

Leaky Nun

Posted 2016-08-04T09:29:21.627

Reputation: 45 011

0

Gema, 31 characters

\A=@repeat{10;**********\n}@end

Sample run:

bash-4.3$ gema '\A=@repeat{10;**********\n}@end'
**********
**********
**********
**********
**********
**********
**********
**********
**********
**********

manatwork

Posted 2016-08-04T09:29:21.627

Reputation: 17 865

Can you provide a link to anywhere? – Leaky Nun – 2016-08-05T11:01:16.803

Linkified the title, but I know about no on-line interpreter. :( – manatwork – 2016-08-05T11:06:54.000

0

Groovy, 23 characters

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

Sample run:

bash-4.3$ groovy -e 'print(("*"*10+"\n")*10)'
**********
**********
**********
**********
**********
**********
**********
**********
**********
**********

manatwork

Posted 2016-08-04T09:29:21.627

Reputation: 17 865

0

Lua, 30 bytes

Full program outputting via its return value.

return("**********\n"):rep(10)

Katenkyo

Posted 2016-08-04T09:29:21.627

Reputation: 2 857

I'm afraid this is not a full program, just a snippet. It produces no output by its own, relies on Lua REPL's functionality. – manatwork – 2016-08-05T12:11:50.740

1@manatwork it is a full program, and is also outputting by itself. All lua program are encapsulated in function inside the VM, thus they can all return a value and it is a legit way of outputing – Katenkyo – 2016-08-06T00:35:17.907

@manatwork Oh also, you just have to read this to know it's legit.

– Katenkyo – 2016-08-06T08:11:49.377

Are you referring to the “... if and only if the challenge requires an integer as output, obviously.” part? – manatwork – 2016-08-06T09:05:40.137

@manatwork this part only refer to the case you use an exit code, because an exit code is always an integer. I was refering to "If functions can output using their return values, it makes sense that programs should be able to do the same", which is what I've done: using the return value of my program – Katenkyo – 2016-08-06T10:28:03.183

But that whole answer is only valid for integer return values, hence the "iff" at the very start. You cannot pick a single sentence from it and pretend the preconditions don't apply to it, therefore making your answer valid. – Joey – 2016-08-09T14:47:55.633

@Joey ok, let's add a new answer to this meta in this case. – Katenkyo – 2016-08-09T21:39:05.690

Katenkyo: That still ignores the fact that programs can have only integer return values in all operating systems I know of. Things don't work that way. Case in point here, your program simply does nothing observable because returning from the main program will simply exit and physically cannot return the string you gave it as expression. – Joey – 2016-08-10T06:57:50.500

0

Bc, 26 characters

for(;i++<10;)"**********
"

Sample run:

bash-4.3$ bc <<< 'for(;i++<10;)"**********
"'
**********
**********
**********
**********
**********
**********
**********
**********
**********
**********

manatwork

Posted 2016-08-04T09:29:21.627

Reputation: 17 865

0

Haskell, 34 bytes

putStr$[0..9]>>([0..9]>>"*")++"\n"

λ> putStr$[0..9]>>([0..9]>>"*")++"\n"
**********
**********
**********
**********
**********
**********
**********
**********
**********
**********

Rodrigo de Azevedo

Posted 2016-08-04T09:29:21.627

Reputation: 177

Since the question stipulates you have to print the text your likely need a main=. I'd also point out that "*********\n" is shorter than ([0..9]>>"*")++"\n". – Post Rock Garf Hunter – 2018-07-02T00:21:30.967

1

@CatWizard No need for main. Your proposal is already taken.

– Rodrigo de Azevedo – 2018-07-02T00:24:12.767

@CatWizard I am running GHCi on my terminal. Isn't that allowed? – Rodrigo de Azevedo – 2018-07-02T00:39:22.153

GHCi is allowed. It is generally considered a different language from Haskell. If other people are not using main and no one has done anything I think you will fine though. – Post Rock Garf Hunter – 2018-07-02T00:42:42.850

@CatWizard I added a demo so that readers know this is to be used in an interpreter. – Rodrigo de Azevedo – 2018-07-02T00:46:57.500

0

JavaScript (115 106 81 chars)

o='';
for(i=0;i<10;i++){l='';for(j=0;j<10;j++){l+='*';}o+=l+"\n";}
console.log(o);

Richard Hamilton

Posted 2016-08-04T09:29:21.627

Reputation: 101

make the program all one line, instead of using "\n", just use a literal newline by hitting enter inside two empty quotes. that should save you 4 bytes. Also, do you need a semicolon after `l+='*'? – Bald Bantha – 2016-08-08T01:38:53.453

0

ListSharp, 73 bytes

[FOREACH NUMB IN 1 TO 10 AS k]
{
STRG p=p+"**********"+<newline>
}
SHOW=p

downrep_nation

Posted 2016-08-04T09:29:21.627

Reputation: 1 152

0

Mumps, 26 Bytes.

F J=0:1:9 W "**********",!

As loops are fairly efficient (space-wise) in Mumps, I thought I'd see if the loop within a loop was shorter, but it was not; weighing in at 31 bytes:

F I=0:1:9{F J=0:1:9{W "*"} W !}

The braces are allowable loop delimiters in the InterSystems Cache version of Mumps that I use; at times they may save a byte or two golfing, but mostly they're just handy to have nested loops in a one-line routine.

zmerch

Posted 2016-08-04T09:29:21.627

Reputation: 541

0

Befunge '98, 31 bytes

a>:|>1++:9`#@_a,
v*'[^
>,v1
-v>

MegaTom

Posted 2016-08-04T09:29:21.627

Reputation: 3 787

0

Factor, 30

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

So verbose...

fede s.

Posted 2016-08-04T09:29:21.627

Reputation: 945

0

Fourier, 22 bytes

10(10(~X42aX^~X)aN^~N)

Try it on FourIDE!

Beta Decay

Posted 2016-08-04T09:29:21.627

Reputation: 21 478

0

MSM, 19 bytes

.;;.;...;.;;.;..␍**

where is a newline.

. concatenates the two rightmost characters and ; appends a copy of the rightmost element to the end, so the first commands .;;.;... create one line **********␍ and the next commands ;.;;.;.. make 10 lines out of it.

nimi

Posted 2016-08-04T09:29:21.627

Reputation: 34 639

0

Oracle SQL 11.2, 44 bytes

SELECT'**********'FROM v$bh WHERE rownum<11;

Jeto

Posted 2016-08-04T09:29:21.627

Reputation: 1 601

0

Pip, 7 bytes

LtP'*Xt

Straightforward: Loop 10 times. Print string of 10 asterisks each time. Kinda disappointed that the simple way was the shortest...

DLosc

Posted 2016-08-04T09:29:21.627

Reputation: 21 213

0

Jade & CSS, 41 36 bytes

- for (x=0;x++<10;)
  **********<br>

Jade is a HTML pre-processor. I'm unsure if using this is breaking any rule or if I have to include something else in the byte count. This also beats my previous entry of 60 bytes.

See it on Codepen: http://codepen.io/409/pen/ZOPgdJ

Thanks to Business Cat for saving 5 bytes.

ʰᵈˑ

Posted 2016-08-04T09:29:21.627

Reputation: 1 426

You can save 1 byte by doing x++<11; instead of x<11;x++. I think you can also omit the var. Also this makes a 10x11 grid, you need to change the 11 to 10. – Business Cat – 2016-08-18T12:45:37.407

Hey, thanks for the improvements @BusinessCat – ʰᵈˑ – 2016-08-18T13:10:24.507

0

Lua, 29 Bytes. Non-competing

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

Forgot to make this print, and with print, it's identical to another answer. So I'm not competing, instead of trying to think up an entirely new short approach.

ATaco

Posted 2016-08-04T09:29:21.627

Reputation: 7 898

This is snippet which prints nothing. Unless the challenge explicitly specifies, the solutions are expected to be either full program of function which either print or return the result. If you make it print, will be duplicate of Seeseemelk's answer, posted 13 days earlier.

– manatwork – 2016-08-19T08:00:06.643

Didn't notice the specification to print. Although this is my own work, it does work out to be identical to the other lua answer. Redacting my competing status. – ATaco – 2016-08-21T23:25:10.487

0

Groovy, 23 characters

10.times{println'*'*10}

M. Justin

Posted 2016-08-04T09:29:21.627

Reputation: 151

Please use code block markup (indent each line with 4 spaces or enclose it between <pre> and </pre> tags) for your code, so scripts like Code Golf UserScript Enhancement Pack can insert the length beside the code.

– manatwork – 2016-08-22T07:24:04.503

@manatwork Done. I'm new here; had no idea that was a thing. – M. Justin – 2016-08-22T07:26:31.387

0

Bash + coreutils + X11 term - 7 keystrokes

Exact keys to hit:

  • <Alt>+1
  • 0
  • 0
  • * (<Shift>+8)
  • <Return>

Requirements:

  • Your terminal window must be exactly 10 characters wide.
  • Your terminal prompt (PS1) should be empty.
  • Your working dir must be empty.

Andrew Dunai

Posted 2016-08-04T09:29:21.627

Reputation: 321

We count submissions like this in keystrokes, not bytes. So this would be 2 more keystrokes because of alt and shift. – Rɪᴋᴇʀ – 2016-12-27T16:04:45.330

0

Stata, 49 bytes

loc i=1
wh `i'<11 {
di "**********"
loc i=`i'+1
}

Output

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

f1rstguess

Posted 2016-08-04T09:29:21.627

Reputation: 181

0

ISOLADOS, 131 bytes

ISOLAADOOOOOOOOOOOS ISOLAAAAAAADOS ISOLAADOOOOOOOOOOS ISOLAAADOOOS ISOLAAAAAAAADOS ISOLAADOOOOOOOOOOS ISOLAAADOOOS ISOLAAAAAAAAADOS

ISOLAADOOOOOOOOOOOS    push 11
ISOLAAAAAAADOS         chr(a + 31)
ISOLAADOOOOOOOOOOS     push 10
ISOLAAADOOOS           push a * b
ISOLAAAAAAAADOS        push [a]
ISOLAADOOOOOOOOOOS     push 10
ISOLAAADOOOS           push a * b
ISOLAAAAAAAAADOS       join list by new lines

acrolith

Posted 2016-08-04T09:29:21.627

Reputation: 3 728

0

Racket 36 bytes

(for((j 10))(displayln"**********"))

rnso

Posted 2016-08-04T09:29:21.627

Reputation: 1 635

0

Groovy 46 Bytes

(1..10).collect{''.center(10,'*')}.join('\n')

https://groovyconsole.appspot.com/script/5102912250314752

Magic Octopus Urn

Posted 2016-08-04T09:29:21.627

Reputation: 19 422

0

SX, 21 bytes

和(0,10):我('*'*10)

Actually: this compiles (technically, it just becomes Python) directly to Python. It is the same as:

for i in range(0,10):print('*'*10)

XiKuuKy

Posted 2016-08-04T09:29:21.627

Reputation: 369

The SX code is 21 bytes long, and please split your answer in multiple answers for multiple submissions – TuxCrafting – 2016-09-12T08:37:28.410

Generally is better to post solutions in different languages in different answers, so they can be upvoted / downvoted separately. For example your Ruby solution is essentially identical with John Ramos's Ruby answer, so that may attract some downvotes.

– manatwork – 2016-09-12T08:38:37.773

11 bytes off: print(("*"*10+"\n")*10) – TuxCrafting – 2016-09-12T08:39:09.163

@TùxCräftîñg, that would be duplicate of helloworld922's Python 3 answer (or if you make it Python 2, then duplicate of shooqie's answer).

– manatwork – 2016-09-12T08:53:33.010

I'm so sorry. I didn't even read any of the answers. I just answered. I'll delete my answers for Python and Ruby. – XiKuuKy – 2016-09-12T12:39:25.680

0

Prolog (SWIPl), 64 / 69 bytes (depending on how to count)

-1*_.
A*0:-writeln(*),C is A-1,C*9.
A*B:-write(*),C is B-1, A*C.

Query with

9*9.

Online Example

Try it online, but take note that since writeln/1 has a bug in Swish, causing it to print a new line before as well as after. I've replaced it with write/1,nl/0 which should be (according to documentation) its equivalent. This raised the byte count of the example.

On the Byte Count

I'm not sure how to count the query, but if it is to be counted towards the total byte count, it's 5 bytes (including an Enter).

SQB

Posted 2016-08-04T09:29:21.627

Reputation: 681

0

D2, 11 bytes

!7;//.|a:|a

Explanation:

!7 is expanded to 7 +, so it set the current cell to 7.
; switch to the second shift state (7 is *) /code|digit repeat code digit times (digit is base 36).
. print the character in the current shift state (so here, * is printed).
: print a newline in shift mode 2.

TuxCrafting

Posted 2016-08-04T09:29:21.627

Reputation: 4 547

0

Crystal, 21 bytes

puts ("*"*10+"\n")*10
How does it work?
"*" * 10            = "**********" 
"**********" + "\n" = "**********\n"
"**********\n" * 10 = "**********\n**********\n[...]"

Zatherz

Posted 2016-08-04T09:29:21.627

Reputation: 111

0

Stuck, 10 Bytes

Very simple implementation here, no tricks ;)

'*10*N+10*

Explanation:

'*           # Enter char mode, puts '*' on the stack
  10*        # Multiply string by 10, puts '**********' on the stack
     N+      # Push a newline to the stack and append to the asterisks
       10*   # Multiply that string by 10 and implicitly print.

Kade

Posted 2016-08-04T09:29:21.627

Reputation: 7 463

-4

HTML, 136 bytes

**********<br>**********<br>**********<br>**********<br>**********<br>**********<br>**********<br>**********<br>**********<br>**********

Streth

Posted 2016-08-04T09:29:21.627

Reputation: 119

1You can use <pre> – Leaky Nun – 2016-08-05T16:45:02.660

I can use <p> too – Streth – 2016-08-05T16:46:35.837

7This answer is valid and allowed, but it's also extremely boring and unimaginative. – James – 2016-08-05T17:08:20.383

Ok, Can I post it in Markdown? – Streth – 2016-08-05T17:08:56.440

2You can easily get this to 114 bytes with <pre> followed by the 109-byte text... – Timtech – 2016-08-27T21:43:03.430

I was hoping to join in on this one but unfortunately do not have the reputation for here yet. I'm not sure if this is an applicable method, but using html/emmet you can get this down to 20 bytes. ({**********}+br)*10

Alternatively p{**********}*10 is 16 bytes. New user to this site, so I'm unsure if the tab character counts. – N.J.Dawson – 2016-09-01T16:12:35.757