答:
Mathematica 1024 chars

```<code>Graph[Partition[
 Riffle[Characters[
 StringTake[ElementData[][[2]], 3] <>
  StringTake[WordData["high", "Antonyms"][[2, 2, 1]], 2] <>
  FromCharacterCode[Power[2, 5]] <>
  StringTake[GraphData[][[Prime@705]], 2] <>
  StringTake[AstronomicalData["Planet"][[1]], {3}] <> "ld"],
Rest@Characters[
  StringTake[ElementData[][[2]], 3] <>
   StringTake[WordData["high", "Antonyms"][[2, 2, 1]], 2] <>
   FromCharacterCode[Power[2, 5]] <>
   StringTake[GraphData[][[Prime[705]]], 2] <>
   StringTake[AstronomicalData["Planet"][[1]], {3}] <> "ld"]],
   2] /. {a_, b_} :> DirectedEdge[a, b],

EdgeLabelStyle -> Power[2, 4],
EdgeLabels -> (Partition[
   Riffle[l =
     Characters[
      StringTake[ElementData[][[2]], 3] <>
       StringTake[WordData["high", "Antonyms"][[2, 2, 1]],
        1 + 1] <> FromCharacterCode[Sqrt[Sqrt[1048576]]] <>
       StringTake[GraphData[][[Prime[705]]], 2] <>
       StringTake[AstronomicalData["Planet"][[1]], {3}] <> "ld"],
    Rest@l], 2] /. {a_, b_} :> DirectedEdge[a, b]) +
Power[{1, 8, 27, 64, 125, 216, 343, 512, 729, 1000},
 1/3] /. {Plus[a_, b_] :> Rule[b, a]},
VertexLabelStyle -> Directive[RGBColor[0, 0, 1], Large],
VertexLabels -> "Name", ImagePadding -> Power[5, 2],
ImageSize -> 2^2*5^2*7]
</code>```

De-bowled (partially)

For those who don't have access to Mathematica's curated data:

```<code> ElementData[][[2]]
 WordData["high", "Antonyms"][[2, 2, 1]]
 GraphData[][[Prime[705]]]
 AstronomicalData["Planet"][[1]]
</code>```

"Helium"

"low"

"WongGraph"

"Mercury"

"Hel" (from "Helium") + "lo" (from "low") + " " (FromCharacterCode[32]) + "Wo" (from "WongGraph") + "r" (from "Mercury") + "ld"

yields the string "Hello World".

The string is split into characters, each of which becomes a vertex in the following graph:

```<code>Graph[{"H" \[DirectedEdge] "e", "e" \[DirectedEdge] "l",
 "l" \[DirectedEdge] "l", "l" \[DirectedEdge] "o",
 "o" \[DirectedEdge] " ", " " \[DirectedEdge] "W",
 "W" \[DirectedEdge] "o", "o" \[DirectedEdge] "r",
 "r" \[DirectedEdge] "l", "l" \[DirectedEdge] "d"},

EdgeLabelStyle -> 16,
EdgeLabels -> {"H" \[DirectedEdge] "e" -> 1, "e" \[DirectedEdge] "l" -> 2, "l" \ [DirectedEdge] "l" -> 3,
"l" \[DirectedEdge] "o" -> 4, "o" \[DirectedEdge] " " -> 5,
" " \[DirectedEdge] "W" -> 6, "W" \[DirectedEdge] "o" -> 7,
"o" \[DirectedEdge] "r" -> 8, "r" \[DirectedEdge] "l" -> 9,
"l" \[DirectedEdge] "d" -> 10},
VertexLabelStyle -> Directive[Blue, Large], VertexLabels -> "Name", ImagePadding -> 25]
</code>```

Title: Hello World in 1024 characters

Body:
In exactly 1024 characters, no more, no less:

Must print Hello World.

Must not use unnecessary whitespace.

Must not use comments.

Judging should favor creativity and/or humor over simple obfuscation when voting up answers.

The earliest I will select an answer is the 11th (Sunday) of November (2012). I'm seeing some awesome entries so far, can't wait to see what else people come up with.

Body:
Mathematica 1024 chars

Graph[Partition[
 Riffle[Characters[
 StringTake[ElementData[][[2]], 3] <>
  StringTake[WordData["high", "Antonyms"][[2, 2, 1]], 2] <>
  FromCharacterCode[Power[2, 5]] <>
  StringTake[GraphData[][[Prime@705]], 2] <>
  StringTake[AstronomicalData["Planet"][[1]], {3}] <> "ld"],
Rest@Characters[
  StringTake[ElementData[][[2]], 3] <>
   StringTake[WordData["high", "Antonyms"][[2, 2, 1]], 2] <>
   FromCharacterCode[Power[2, 5]] <>
   StringTake[GraphData[][[Prime[705]]], 2] <>
   StringTake[AstronomicalData["Planet"][[1]], {3}] <> "ld"]],
   2] /. {a_, b_} :> DirectedEdge[a, b],

EdgeLabelStyle -> Power[2, 4],
EdgeLabels -> (Partition[
   Riffle[l =
     Characters[
      StringTake[ElementData[][[2]], 3] <>
       StringTake[WordData["high", "Antonyms"][[2, 2, 1]],
        1 + 1] <> FromCharacterCode[Sqrt[Sqrt[1048576]]] <>
       StringTake[GraphData[][[Prime[705]]], 2] <>
       StringTake[AstronomicalData["Planet"][[1]], {3}] <> "ld"],
    Rest@l], 2] /. {a_, b_} :> DirectedEdge[a, b]) +
Power[{1, 8, 27, 64, 125, 216, 343, 512, 729, 1000},
 1/3] /. {Plus[a_, b_] :> Rule[b, a]},
VertexLabelStyle -> Directive[RGBColor[0, 0, 1], Large],
VertexLabels -> "Name", ImagePadding -> Power[5, 2],
ImageSize -> 2^2*5^2*7]

De-bowled (partially)

For those who don't have access to Mathematica's curated data:

 ElementData[][[2]]
 WordData["high", "Antonyms"][[2, 2, 1]]
 GraphData[][[Prime[705]]]
 AstronomicalData["Planet"][[1]]

"Helium"

"low"

"WongGraph"

"Mercury"

"Hel" (from "Helium") + "lo" (from "low") + " " (FromCharacterCode[32]) + "Wo" (from "WongGraph") + "r" (from "Mercury") + "ld"

yields the string "Hello World".

The string is split into characters, each of which becomes a vertex in the following graph:

Graph[{"H" \[DirectedEdge] "e", "e" \[DirectedEdge] "l",
 "l" \[DirectedEdge] "l", "l" \[DirectedEdge] "o",
 "o" \[DirectedEdge] " ", " " \[DirectedEdge] "W",
 "W" \[DirectedEdge] "o", "o" \[DirectedEdge] "r",
 "r" \[DirectedEdge] "l", "l" \[DirectedEdge] "d"},

EdgeLabelStyle -> 16,
EdgeLabels -> {"H" \[DirectedEdge] "e" -> 1, "e" \[DirectedEdge] "l" -> 2, "l" \ [DirectedEdge] "l" -> 3,
"l" \[DirectedEdge] "o" -> 4, "o" \[DirectedEdge] " " -> 5,
" " \[DirectedEdge] "W" -> 6, "W" \[DirectedEdge] "o" -> 7,
"o" \[DirectedEdge] "r" -> 8, "r" \[DirectedEdge] "l" -> 9,
"l" \[DirectedEdge] "d" -> 10},
VertexLabelStyle -> Directive[Blue, Large], VertexLabels -> "Name", ImagePadding -> 25]


问:
Print a 10 by 10 grid of asterisks

Background

This is a standard textbook example to demonstrate for loops.

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

Task

You are to print this exact text:

```<code>**********
**********
**********
**********
**********
**********
**********
**********
**********
**********
</code>```

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 code-golf. Shortest answer in bytes wins.

答:
SpecBAS - 18 bytes

```<code>?(("*"*10)+#13)*10
</code>```

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

ContentLicense: CC BY-SA 3.0

Title: Print a 10 by 10 grid of asterisks

Body:
SpecBAS - 18 bytes

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

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


Title: Print a 10 by 10 grid of asterisks

Body:
Background

This is a standard textbook example to demonstrate for loops.

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

Task

You are to print this exact text:

```<code>**********
**********
**********
**********
**********
**********
**********
**********
**********
**********
</code>```

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 code-golf. Shortest answer in bytes wins.

Body:
Ruby, 15 characters

puts [?**10]*10

Sample run:

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


答:
Vim, <s>13</s> 8 bytes

Saved 5 bytes thanks to @Lynn

<s>

```<code>qqi*␛9.o␛q9@q
</code>```

</s>

```<code>10i*␛Y9p
</code>```

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

Title: Print a 10 by 10 grid of asterisks

Body:
Vim, <s>13</s> 8 bytes

Saved 5 bytes thanks to @Lynn

<s>

qqi*␛9.o␛q9@q

</s>

10i*␛Y9p

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


Title: Print a 10 by 10 grid of asterisks

Body:
Brainfuck, 47 bytes

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

Try it online!

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


Title: Print a 10 by 10 grid of asterisks

Body:
C (gcc), 41 39 bytes

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


问:
Turtles All the Way Down
Write a program or function that takes in a positive integer and prints or returns a stack of that many ASCII-art turtles, where each turtle is larger than the one above it.

Specifically, if the input is 1, the output should be:

```<code> __
/,,\o
</code>```

If the input is 2:

```<code>  __
o/,,\
 ____
/,__,\o
</code>```

If the input is 3:

```<code>   __
  /,,\o
  ____
o/,__,\
 ______
/,____,\o
</code>```

If the input is 4:

```<code>    __
  o/,,\
   ____
  /,__,\o
  ______
o/,____,\
 ________
/,______,\o
</code>```

If the input is 5:

```<code>     __
    /,,\o
    ____
  o/,__,\
   ______
  /,____,\o
  ________
o/,______,\
 __________
/,________,\o
</code>```

And so on in the same pattern for larger inputs.

Note that:

The head (the o) of the bottom turtle is always on the right. The heads of the turtles above then alternate back and forth.

No lines may have trailing spaces.

Superfluous leading spaces are not allowed. (i.e. the back of the bottom turtle should be at the start of the line.)

A single optional trailing newline is allowed.

The shortest code in bytes wins.

答:
TSQL, 189 bytes

Now with input acceptance - thanks to @PatrickRoberts

```<code>DECLARE @i INT=##i##,@ INT=0a:PRINT SPACE(@i-@)+REPLICATE('__',@+1)+'
'+SPACE((@i-@-1)/2*2)+IIF((@i-@-1)%2=1,'o/,','/,')+REPLICATE('__',@)+IIF((@i-@-1)%2=0,',\o',',\')SET
@+=1IF @i>@ GOTO a
</code>```

Fiddle

Title: Turtles All the Way Down

Body:
TSQL, 189 bytes

Now with input acceptance - thanks to @PatrickRoberts

DECLARE @i INT=##i##,@ INT=0a:PRINT SPACE(@i-@)+REPLICATE('__',@+1)+'
'+SPACE((@i-@-1)/2*2)+IIF((@i-@-1)%2=1,'o/,','/,')+REPLICATE('__',@)+IIF((@i-@-1)%2=0,',\o',',\')SET
@+=1IF @i>@ GOTO a

Fiddle


Title: Print a 10 by 10 grid of asterisks

Body:
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!


问:
A newly discovered number: bleen!
"The Nobel Prize in mathematics was awarded to a California professor who has discovered a new number! The number is bleen, which he claims belongs between 6 and 7."  --George Carlin

In this challenge, you will print all Integers, inclusive, within the given input range.  Print numbers ascending or descending according to their input order.  That is, for input [n1, n2], print ascending if n1 < n2, descending if n1 > n2.

Since bleen is now an Integer number it may be used as input.  It must also be included in the output, between 6 and 7 where applicable.  Also note that -bleen exists between -7 and -6.

Input

Two Integers [n1, n2] in the range [-10, 10], inclusive, via your programming language's input of choice.

(Input may also contain bleen and -bleen!)

Output

Print all Integers starting at n1 and ending with n2, including the newly discovered bleen between 6 and 7.  Output can be a range of character separated numbers in some form your language supports - that is, comma or space separated.  One trailing space of output is okay.

Examples

```<code>Input:  1 10
Output: 1 2 3 4 5 6 bleen 7 8 9 10

Input:  -9 -4
Output: -9 -8 -7 -bleen -6 -5 -4

Input:  -8 bleen
Output: -8 -7 -bleen -6 -5 -4 -3 -2 -1 0 1 2 3 4 5 6 bleen

Input:  9 1
Output: 9 8 7 bleen 6 5 4 3 2 1

Input:  2 -bleen
Output: 2 1 0 -1 -2 -3 -4 -5 -6 -bleen

Input:  -bleen 0
Output: -bleen -6 -5 -4 -3 -2 -1 0

Input:  bleen bleen
Output: bleen

Input:  2 2
Output: 2
</code>```

Additional notes

You may write a program or function and use any standard method of receiving input and providing output.

You may use any programming language, but standard loopholes are not allowed.

This is code-golf, so the shortest valid answer – measured in bytes – wins.

答:
Scala, 223 bytes

```<code>object B extends App{val b="bleen"
val L=((-10 to -7)++List(s"-$b")++(-6 to 6)++List(b)++(6 to 10)).map(""+_)
val Array(s,e)=args.map(L.indexOf(_))
println((if(s<=e)L.slice(s,e+1)else L.slice(e,s+1).reverse).mkString(" "))}
</code>```

Title: A newly discovered number: bleen!

Body:
Scala, 223 bytes

object B extends App{val b="bleen"
val L=((-10 to -7)++List(s"-$b")++(-6 to 6)++List(b)++(6 to 10)).map(""+_)
val Array(s,e)=args.map(L.indexOf(_))
println((if(s<=e)L.slice(s,e+1)else L.slice(e,s+1).reverse).mkString(" "))}


Title: Turtles All the Way Down

Body:
Write a program or function that takes in a positive integer and prints or returns a stack of that many ASCII-art turtles, where each turtle is larger than the one above it.

Specifically, if the input is 1, the output should be:

```<code> __
/,,\o
</code>```

If the input is 2:

```<code>  __
o/,,\
 ____
/,__,\o
</code>```

If the input is 3:

```<code>   __
  /,,\o
  ____
o/,__,\
 ______
/,____,\o
</code>```

If the input is 4:

```<code>    __
  o/,,\
   ____
  /,__,\o
  ______
o/,____,\
 ________
/,______,\o
</code>```

If the input is 5:

```<code>     __
    /,,\o
    ____
  o/,__,\
   ______
  /,____,\o
  ________
o/,______,\
 __________
/,________,\o
</code>```

And so on in the same pattern for larger inputs.

Note that:

The head (the o) of the bottom turtle is always on the right. The heads of the turtles above then alternate back and forth.

No lines may have trailing spaces.

Superfluous leading spaces are not allowed. (i.e. the back of the bottom turtle should be at the start of the line.)

A single optional trailing newline is allowed.

The shortest code in bytes wins.

Body:
Perl, 92 bytes

91 bytes code +1 for -n.

Requires -E at no extra cost.

for$i(1..$_){say$"x$_._,$v=_ x(--$i*2),_.$/.$"x(--$_-1),$_%2?o:$"x!!$_,"/,$v,\\",$_%2?"":o}

Usage

perl -nE 'for$i(1..$_){say$"x$_._,$v=_ x(--$i*2),_.$/.$"x(--$_-1),$_%2?o:$"x!!$_,"/,$v,\\",$_%2?"":o}' <<< 3
   __
  /,,\o
  ____
o/,__,\
 ______
/,____,\o

Thanks to @Dada for -9 bytes with his re-work!


问:
Finding "sub-palindromes".
The shortest code that finds all unique "sub-palindromes" of a string, that is: any substring with length > 1 that is a palindrome.

eg.1

```<code>input: "12131331"
output: "33", "121", "131", "313", "1331"
</code>```

eg.2

```<code>input: "3333"
output: "33", "333", "3333"
</code>```

ContentLicense: CC BY-SA 2.5

Title: Finding "sub-palindromes".

Body:
J, 48

f=:,@:".
h=:\\.
~.(#~10&<)((]h-:"0&f|.h)#[:f]h)

eg

~.(#~10&<)((]h-:"0&f|.h)#[:f]h) '12131331'
121 131 313 1331 33


问:
Hello World in 1024 characters
In exactly 1024 characters, no more, no less:

Must print Hello World.

Must not use unnecessary whitespace.

Must not use comments.

Judging should favor creativity and/or humor over simple obfuscation when voting up answers.

The earliest I will select an answer is the 11th (Sunday) of November (2012). I'm seeing some awesome entries so far, can't wait to see what else people come up with.

Title: Hello World in 1024 characters

Body:
C, 1024 characters

Here's an adaptation of my answer to another "Hello, world" question:

I'm not sure what's "unnecessary whitespace". I used spaces, indentation and line breaks to make code nicely formatted, but strictly speaking most of it is unnecessary. I did count the whitespace in the 1024 chars.

EDIT: Changed to return! in the first line. Nicer this way, I think.

#include <stdio.h>
int main(int argc, char **argv, char **envp) {
        return!
        putchar(-~-~-~-~-~-~-~-~-~-~!
        putchar(~-~-~-~-~-~-~-~-
        putchar(~-~-~-~-~-~-
        putchar(-~-~-~
        putchar(-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
        putchar(-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
                ~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
        putchar(-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
                ~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
                -~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
                ~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
                -~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
                ~-~
        putchar(-~-~-~
        putchar(
        putchar(-~-~-~-~-~-~-~
        putchar(-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
        putchar(-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
                ~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
                -~-~-~0))))))))))));
}

Another one - Python this time

1024 characters, 944 of them are whitespace, all necessary.

print 11*'%c'%tuple(len(x)+8for x in'                                                                /                                                                                /                                                                                /                                                                                /                                                                                /                        /                                                                               /                                                                                /                                                                                /                                                                                /                                                                                '.split('/'))


问:
Alphabet triangle
You are to print this exact text:

```<code>A
ABA
ABCBA
ABCDCBA
ABCDEDCBA
ABCDEFEDCBA
ABCDEFGFEDCBA
ABCDEFGHGFEDCBA
ABCDEFGHIHGFEDCBA
ABCDEFGHIJIHGFEDCBA
ABCDEFGHIJKJIHGFEDCBA
ABCDEFGHIJKLKJIHGFEDCBA
ABCDEFGHIJKLMLKJIHGFEDCBA
ABCDEFGHIJKLMNMLKJIHGFEDCBA
ABCDEFGHIJKLMNONMLKJIHGFEDCBA
ABCDEFGHIJKLMNOPONMLKJIHGFEDCBA
ABCDEFGHIJKLMNOPQPONMLKJIHGFEDCBA
ABCDEFGHIJKLMNOPQRQPONMLKJIHGFEDCBA
ABCDEFGHIJKLMNOPQRSRQPONMLKJIHGFEDCBA
ABCDEFGHIJKLMNOPQRSTSRQPONMLKJIHGFEDCBA
ABCDEFGHIJKLMNOPQRSTUTSRQPONMLKJIHGFEDCBA
ABCDEFGHIJKLMNOPQRSTUVUTSRQPONMLKJIHGFEDCBA
ABCDEFGHIJKLMNOPQRSTUVWVUTSRQPONMLKJIHGFEDCBA
ABCDEFGHIJKLMNOPQRSTUVWXWVUTSRQPONMLKJIHGFEDCBA
ABCDEFGHIJKLMNOPQRSTUVWXYXWVUTSRQPONMLKJIHGFEDCBA
ABCDEFGHIJKLMNOPQRSTUVWXYZYXWVUTSRQPONMLKJIHGFEDCBA
ABCDEFGHIJKLMNOPQRSTUVWXYXWVUTSRQPONMLKJIHGFEDCBA
ABCDEFGHIJKLMNOPQRSTUVWXWVUTSRQPONMLKJIHGFEDCBA
ABCDEFGHIJKLMNOPQRSTUVWVUTSRQPONMLKJIHGFEDCBA
ABCDEFGHIJKLMNOPQRSTUVUTSRQPONMLKJIHGFEDCBA
ABCDEFGHIJKLMNOPQRSTUTSRQPONMLKJIHGFEDCBA
ABCDEFGHIJKLMNOPQRSTSRQPONMLKJIHGFEDCBA
ABCDEFGHIJKLMNOPQRSRQPONMLKJIHGFEDCBA
ABCDEFGHIJKLMNOPQRQPONMLKJIHGFEDCBA
ABCDEFGHIJKLMNOPQPONMLKJIHGFEDCBA
ABCDEFGHIJKLMNOPONMLKJIHGFEDCBA
ABCDEFGHIJKLMNONMLKJIHGFEDCBA
ABCDEFGHIJKLMNMLKJIHGFEDCBA
ABCDEFGHIJKLMLKJIHGFEDCBA
ABCDEFGHIJKLKJIHGFEDCBA
ABCDEFGHIJKJIHGFEDCBA
ABCDEFGHIJIHGFEDCBA
ABCDEFGHIHGFEDCBA
ABCDEFGHGFEDCBA
ABCDEFGFEDCBA
ABCDEFEDCBA
ABCDEDCBA
ABCDCBA
ABCBA
ABA
A
</code>```

Specs

Extra trailing newlines are allowed at the end of the output.

Extra trailing spaces (U+0020) are allowed at the end of each line, including the extra trailing newlines.

You can use all lowercase instead of all uppercase, but you cannot print partially lowercase partially uppercase.

You can return the text as a function output instead of printing it in a full program.

Scoring

Since this is a triangle, and a triangle has 3 sides, and 3 is a small number, your code should be small in terms of byte-count.

答:
C#, 162 bytes

```<code>void p(){for(int i=1;i<54;i++){var a=Enumerable.Range(65,i>27?54-i:i).Select(n=>(char)n);Console.WriteLine(new string(a.Concat(a.Reverse().Skip(1)).ToArray()));}}
</code>```

Try it online!

Title: Alphabet triangle

Body:
C#, 162 bytes

void p(){for(int i=1;i<54;i++){var a=Enumerable.Range(65,i>27?54-i:i).Select(n=>(char)n);Console.WriteLine(new string(a.Concat(a.Reverse().Skip(1)).ToArray()));}}

Try it online!


答:
C#, 79 bytes

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

Title: Print a 10 by 10 grid of asterisks

Body:
C#, 79 bytes

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


Title: Print a 10 by 10 grid of asterisks

Body:
golflua, 22 characters

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

Sample run:

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


Title: Print a 10 by 10 grid of asterisks

Body:
><>, 35 bytes

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

Try it online!


答:
Javascript: 65 bytes

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

-- 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: <s>42</S> 40 bytes

```<code>i=10;while(i--)console.log("**********")
</code>```

(Saved 2 bytes thanks to @kamoroso94)

Title: Print a 10 by 10 grid of asterisks

Body:
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: <s>42</S> 40 bytes

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

(Saved 2 bytes thanks to @kamoroso94)


Title: Print a 10 by 10 grid of asterisks

Body:
Background

This is a standard textbook example to demonstrate for loops.

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

Task

You are to print this exact text:

```<code>**********
**********
**********
**********
**********
**********
**********
**********
**********
**********
</code>```

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 code-golf. Shortest answer in bytes wins.

Body:
BASH, 46 bytes

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


Title: Print a 10 by 10 grid of asterisks

Body:
><>, 28 bytes

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

Try it online!


Title: Print a 10 by 10 grid of asterisks

Body:
C++, 75 bytes

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


答:
PowerShell, <s>14</s> 12 bytes

```<code>,('*'*10)*10
</code>```

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

```<code>0..9|%{'*'*10}
</code>```

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

Title: Print a 10 by 10 grid of asterisks

Body:
PowerShell, <s>14</s> 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).


问:
Print a Tabula Recta!
The Tabula Recta (sometimes called a 'Vigenere Table'), was created by Johannes Trithemius, and has been used in several ciphers, including all variants of Bellaso's Vigenere cipher and the Trithemius cipher. It looks like this:

```<code>ABCDEFGHIJKLMNOPQRSTUVWXYZ
BCDEFGHIJKLMNOPQRSTUVWXYZA
CDEFGHIJKLMNOPQRSTUVWXYZAB
DEFGHIJKLMNOPQRSTUVWXYZABC
EFGHIJKLMNOPQRSTUVWXYZABCD
FGHIJKLMNOPQRSTUVWXYZABCDE
GHIJKLMNOPQRSTUVWXYZABCDEF
HIJKLMNOPQRSTUVWXYZABCDEFG
IJKLMNOPQRSTUVWXYZABCDEFGH
JKLMNOPQRSTUVWXYZABCDEFGHI
KLMNOPQRSTUVWXYZABCDEFGHIJ
LMNOPQRSTUVWXYZABCDEFGHIJK
MNOPQRSTUVWXYZABCDEFGHIJKL
NOPQRSTUVWXYZABCDEFGHIJKLM
OPQRSTUVWXYZABCDEFGHIJKLMN
PQRSTUVWXYZABCDEFGHIJKLMNO
QRSTUVWXYZABCDEFGHIJKLMNOP
RSTUVWXYZABCDEFGHIJKLMNOPQ
STUVWXYZABCDEFGHIJKLMNOPQR
TUVWXYZABCDEFGHIJKLMNOPQRS
UVWXYZABCDEFGHIJKLMNOPQRST
VWXYZABCDEFGHIJKLMNOPQRSTU
WXYZABCDEFGHIJKLMNOPQRSTUV
XYZABCDEFGHIJKLMNOPQRSTUVW
YZABCDEFGHIJKLMNOPQRSTUVWX
ZABCDEFGHIJKLMNOPQRSTUVWXY
</code>```

I frequently need this, but can't find it anywhere on the internet to copy and paste from. Because the square table is so long, and takes frigging ages to type, your code must be as short as possible.

Rules/Requirements

Each submission should be either a full program or function. If it is a function, it must be runnable by only needing to add the function call to the bottom of the program. Anything else (e.g. headers in C), must be included.

If it is possible, provide a link to a site where your program can be tested.

Your program must not write anything to STDERR.

Standard Loopholes are forbidden.

Your program can output in any case, but it must be printed (not an array or similar).

Scoring

Programs are scored according to bytes, in UTF-8 by default or a different character set of your choice.

Eventually, the answer with the least bytes will win.

Submissions

To make sure that your answer shows up, please start your answer with a headline, using the following Markdown template:

```<code># Language Name, N bytes
</code>```

where N is the size of your submission. If you improve your score, you can keep old scores in the headline, by striking them through. For instance:

```<code># Ruby, <s>104</s> <s>101</s> 96 bytes
</code>```

If there you want to include multiple numbers in your header (e.g. because your score is the sum of two files or you want to list interpreter flag penalties separately), make sure that the actual score is the last number in the header:

```<code># Perl, 43 + 2 (-p flag) = 45 bytes
</code>```

You can also make the language name a link which will then show up in the leaderboard snippet:

```<code># [><>](http://esolangs.org/wiki/Fish), 121 bytes
</code>```

Leaderboard

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

/* Configuration */

var QUESTION_ID = 86986; // 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 = 53406; // 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 = '
' + c.body.replace(OVERRIDE_REG, '') + '
';
    });

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

}```
<pre class="snippet-code-css lang-css prettyprint-override"><code>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;
}</code>```

<link rel="stylesheet" type="text/css" href="//cdn.sstatic.net/codegolf/all.css?v=83c949450c8b">

Leaderboard

	Author	Language	Size

Winners by Language

Language	User	Score

{{PLACE}}	{{NAME}}	{{LANGUAGE}}	{{SIZE}}	Link

{{LANGUAGE}}	{{NAME}}	{{SIZE}}	Link

```

ContentLicense: CC BY-SA 4.0

Title: Print a Tabula Recta!

Body:
Swift, <s>104</s> <s>84</s> <s>81</s> 73 bytes

(0...701).map{print(UnicodeScalar($0%27==26 ?13:65+$0%26),terminator:"")}


答:
Racket, <s>43</s> 36 bytes

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

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

Title: Print a 10 by 10 grid of asterisks


问:
Sort band names

Challenge description

You have a music library with many tracks recorded by many bands, each of which has a name, like Queen, Aerosmith, Sunny Day Real Estate, The Strokes . When an audio player displays your library alphabetically by band name, it usually skips the The part, as many band names start with The, making it easier to navigate through your media collection. In this challenge, given a list (array) of strings, you need to sort it that way (that is, omitting the The word at the beginning of the name). You can either write a method or a full working program.

Sample inputs / outputs

```<code>[Queen, Aerosmith, Sunny Day Real Estate, The Strokes] -> [Aerosmith, Queen, The Strokes, Sunny Day Real Estate]
[The Ramones, The Cure, The Pixies, The Roots, The Animals, Enrique Iglesias] -> [The Animals, The Cure, Enrique Iglesias, The Pixies, The Ramones, The Roots]
[The The, The They, Thermodynamics] -> [The The, Thermodynamics, The They]
</code>```

Notes / Edge cases

Sorting lexicographically is case insensitive, so The Police, The police and the police are all equivalent,

Your algorithm should only omit the first the word, so bands named The The or The The Band are sorted normally by the second the,

A band named The (a three letter word) is sorted normally (no skipping),

Order of two bands having the same name, one of which starts with the (like The Police and Police) is undefined,

You can assume that if a band's name consists of more than one word, they are separated by a single space character. You don't need to handle leading or trailing whitespaces,

All input strings match [A-Za-z0-9 ]*, that is they will consist only of lower- and uppercase letters of English alphabet, digits and space characters,

Remember that this is a code-golf challenge, so make your code as short as possible!

答:
Java 8, 178 bytes

```<code>void q(String[]s){java.util.Arrays.sort(s,(a,b)->(a.toLowerCase().startsWith("the ")?a.substring(4):a).compareToIgnoreCase(b.toLowerCase().startsWith("the ")?b.substring(4):b));}
</code>```

Ungolfed version:

```<code>void sort(String[] bands) {
    java.util.Arrays.sort(bands, (a, b) ->
        (a.toLowerCase().startsWith("the ") ? a.substring(4) : a).compareToIgnoreCase(
            b.toLowerCase().startsWith("the ") ? b.substring(4) : b
        )
    );
}
</code>```

Call as such:

```<code>public static void main(String[] args) {
    String[] bands = {"The Strokes", "Queen", "AC/DC", "The Band", "Cage the Elephant", "cage the elephant"};
    sort(bands); // or q(bands) in the golfed version
    System.out.println(java.util.Arrays.toString(bands));
}
</code>```

Title: Sort band names

Body:
Java 8, 178 bytes

void q(String[]s){java.util.Arrays.sort(s,(a,b)->(a.toLowerCase().startsWith("the ")?a.substring(4):a).compareToIgnoreCase(b.toLowerCase().startsWith("the ")?b.substring(4):b));}

Ungolfed version:

void sort(String[] bands) {
    java.util.Arrays.sort(bands, (a, b) ->
        (a.toLowerCase().startsWith("the ") ? a.substring(4) : a).compareToIgnoreCase(
            b.toLowerCase().startsWith("the ") ? b.substring(4) : b
        )
    );
}

Call as such:

public static void main(String[] args) {
    String[] bands = {"The Strokes", "Queen", "AC/DC", "The Band", "Cage the Elephant", "cage the elephant"};
    sort(bands); // or q(bands) in the golfed version
    System.out.println(java.util.Arrays.toString(bands));
}


答:
MATL, 8 bytes

```<code>'*'10tX"
</code>```

Try it online!

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

Title: Print a 10 by 10 grid of asterisks

Body:
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


Title: Print a 10 by 10 grid of asterisks

Body:
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);


答:
Emacs, <s>10</s> 8 keystrokes

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

Explanation

```<code>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
</code>```

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

Title: Print a 10 by 10 grid of asterisks

Body:
Emacs, <s>10</s> 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.


答:
S.I.L.O.S 45 bytes

All whitespace necessary due to my poor interpreter design.

```<code>a = 10
lbla
printLine **********
a - 1
if a a
</code>```

Try it Online!

Title: Print a 10 by 10 grid of asterisks

Body:
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!


问:
Help the poor Cryptographers - DLP Edition

Introduction and Motivation

I'm mainly active on Cryptography.SE and as such have already stumbled across the question: "How the hell am I supposed tools like cado-nfs to do stuff!?". They are super-complicated tools for a super-complicated task: Factoring large integers and computing large-scale discrete logarithms.

Now I'm standing here (in a metaphoric sense) and I am asking you:

Please give us poor cryptographers a usable tool. :(
This question in particular is about the discrete logarithm problem which was broken by Logjam, is frequently used in the world of online security and you're supposed to solve it (as far as current technology goes)!

Specification

Input

Your input will be three (potentially) large numbers: A generator, a prime and an argument. The integer encoding should be hex or decimal big-endian. Additionally you may require arbitrary generator and prime dependent state (a bunch of pre-calculations and stuff). The generators, primes and arguments for the score evaluation will not be public. But there will be several arguments for one set of generators and primes so caching does make sense here.

Output

The output is supposed to be one (potentially large) integer, the discrete logarithm of the argument to the base of the generator in the field defined by the prime. Additionally you may output intermediate state that will speed-up future calculations.

What to do?

Using any library, tool and language you like (no online-services), hit the lowest time of execution for calculating the (correct) discrete logarithm. The parameters will be:

There will be three pairs of random (safe) prime and an appropriate (small) generator

Each pair will receive three distinct (random) arguments, for the latter two, intermediate state will speed things up significantly

The tests will be run on an AWS EC2 c4.large instance

The tests will use 332-bit (100 decimal digit) primes and arguments

Who wins?

This is fastest-code so the fastest code wins!

Submissions are evaluated earliest three days after lack of activity (these evaluations cost money!) and clearly inefficient submissions will not be evaluated at all.

OS: The submittant has the choice between the default Amazon-provided OSes which are Windows Server (2003 R2 - 2012 R2 Base), Red Hat Enterprise Linux 7.2, SUSE Linux Enterprise Server 12 SP1, Ubuntu Server 14.04 LTS, Debian 8 Jessie (community AMI), CentOS (6 or 7; community AMI) additionally the submittant can link to or provide instructions on using / creating a custom Amazon Machine Image (AMI) for testing

Installation instructions or links to those need to be provisioned.

(Potentially) Helpful resources:

Cado-NFS

The GNFS, the mainly used algorithm for this

答:
Cado-nfs is the right tool to use.

It provides abstract enough way of handling any case, but relies on input specific optimizations that cannot be done by the program anyway.

There is no general (applicable to anything with same efficiency) solution (even theoretical one) for NFS that can be implemented in program at the moment.

Judging by the work done in CADO-nfs, simply coming up with a good enough algorithm for just 100 digit number would take several months of research before any programming can be done.

You should ask around on CADO-nfs forums, there were at least couple of tests mentioning 103-104-digit algorithms, that might be more useful.

If nfs is not a strict requirement, you could mention it in question.
Sadly, I cannot comment yet; and no, I am far from specialist in any of the areas.


答:
MATLAB, 14 bytes

```<code>repmat('*',10)
</code>```

Title: Print a 10 by 10 grid of asterisks

Body:
MATLAB, 14 bytes

repmat('*',10)


Title: Print a 10 by 10 grid of asterisks

Body:
Maple 30 bytes

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


答:
C, 84 bytes

```<code>#include<stdio>
int main(){int i;for(i=0;i<10;i++){printf("**********\n");return 0;}
</code>```

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.

Title: Print a 10 by 10 grid of asterisks

Body:
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.


答:
Perl 6, <s> 19 17 </s> 16 bytes

<s>say '*'x 10 for ^10
put '*'x 10 for ^10
put('*'x 10)xx 10</s>
put(\*x 10)xx 10```

<p>Try it</p>

<h2>Explanation:</h2>

<pre class="lang-perl6 prettyprint-override"><code>put(       # print with trailing newline
  '*' x 10 # ｢*｣ string repeated 10 times
) xx 10    # list repeat the above 10 times
</code>```

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

Title: Print a 10 by 10 grid of asterisks

Body:
Perl 6, <s> 19 17 </s> 16 bytes

<s>say '*'x 10 for ^10
put '*'x 10 for ^10
put('*'x 10)xx 10</s>
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 *.


答:
Bash + coreutils, 19 bytes

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

```<code>yes **********|head
</code>```

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

```<code>yes "**********"|head
</code>```

Title: Print a 10 by 10 grid of asterisks

Body:
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


答:
Sprects, 22 bytes

```<code>#eeep#eppp#pqqq*
#q***
</code>```

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

Title: Print a 10 by 10 grid of asterisks

Body:
Sprects, 22 bytes

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

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


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

```<code>_.From("**********\n").Cycle(120).Write()
</code>```

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

Title: Print a 10 by 10 grid of asterisks

Body:
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


答:
Haskell, 29 bytes

```<code>putStr$[0..9]>>"**********\n"
</code>```

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

Title: Print a 10 by 10 grid of asterisks

Body:
Background

This is a standard textbook example to demonstrate for loops.

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

Task

You are to print this exact text:

```<code>**********
**********
**********
**********
**********
**********
**********
**********
**********
**********
</code>```

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 code-golf. Shortest answer in bytes wins.

Body:
Haskell, 29 bytes

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

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


答:
TSQL, 45 bytes

```<code>SELECT TOP 10 REPLICATE('*',10) FROM systypes
</code>```

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.

Title: Print a 10 by 10 grid of asterisks

Body:
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.


答:
Javascript, cut and paste into console (chrome browser of course) on this page to see the page disappear!</p>

```<code>function pad_with_zeroes(number, length){
var my_string = '' + number;
while (my_string.length < length){
my_string = '0' + my_string;
}
return my_string;
}
var code_tags = document.getElementsByTagName('code');
var hello_world = code_tags[0].innerHTML;
var body_tags = document.getElementsByTagName('body');
var body = 'NULL';
body = body_tags[0];
var html_input = "<div id='div_that_holds_hello_world' style='font-size:50px; color:#987324; width: 900px; height: 900px; text-align: center;'><span id='hello_world_span'>" +hello_world+ "</span></div>";
body.innerHTML = html_input;
var span = document.getElementById('hello_world_span');
var div = document.getElementById('div_that_holds_hello_world');
var j_c = 1;
var i_c = 0;
var setIn = setInterval(function(){
i_c++;
if(i_c%2 == 0){
span.style.display = 'none';
}else{
span.style.display = 'block';
}
if(i_c%50 != 0){
div.style.fontSize = j_c + 'px';
if(i_c < 1000000){
div.style.color = '#'+ pad_with_zeroes(i_c, 6);
}else{
i_c = 0;
}
j_c++;
}else{
j_c = 0;
}
}, 500);
</code>```

Title: Hello World in 1024 characters

Body:
In exactly 1024 characters, no more, no less:

Must print Hello World.

Must not use unnecessary whitespace.

Must not use comments.

Judging should favor creativity and/or humor over simple obfuscation when voting up answers.

The earliest I will select an answer is the 11th (Sunday) of November (2012). I'm seeing some awesome entries so far, can't wait to see what else people come up with.

Body:
Javascript, cut and paste into console (chrome browser of course) on this page to see the page disappear!

function pad_with_zeroes(number, length){
var my_string = '' + number;
while (my_string.length < length){
my_string = '0' + my_string;
}
return my_string;
}
var code_tags = document.getElementsByTagName('code');
var hello_world = code_tags[0].innerHTML;
var body_tags = document.getElementsByTagName('body');
var body = 'NULL';
body = body_tags[0];
var html_input = "<div id='div_that_holds_hello_world' style='font-size:50px; color:#987324; width: 900px; height: 900px; text-align: center;'><span id='hello_world_span'>" +hello_world+ "</span></div>";
body.innerHTML = html_input;
var span = document.getElementById('hello_world_span');
var div = document.getElementById('div_that_holds_hello_world');
var j_c = 1;
var i_c = 0;
var setIn = setInterval(function(){
i_c++;
if(i_c%2 == 0){
span.style.display = 'none';
}else{
span.style.display = 'block';
}
if(i_c%50 != 0){
div.style.fontSize = j_c + 'px';
if(i_c < 1000000){
div.style.color = '#'+ pad_with_zeroes(i_c, 6);
}else{
i_c = 0;
}
j_c++;
}else{
j_c = 0;
}
}, 500);


问:
Is it a pangram?
Write a function or program that takes as its input a string and prints a truthy value if the string is a pangram (a sequence of letters containing at least one of each letter in the English alphabet) and a falsey value otherwise.

Case of letters should be ignored; If the string is abcdefghijklmnopqrstuvwXYZ, then the function should still return a truthy value. Note that the string can contain any other characters in it, so 123abcdefghijklm NOPQRSTUVWXYZ321 would return a truthy value. An empty input should return a falsey value.

Test cases

```<code>AbCdEfGhIjKlMnOpQrStUvWxYz

==> True

ACEGIKMOQSUWY
BDFHJLNPRTVXZ

==> True

public static void main(String[] args)

==> False

The quick brown fox jumped over the lazy dogs. BOING BOING BOING

==> True
</code>```

This is code golf. Standard rules apply. Shortest code in bytes wins.

答:
Haskell, <s>59</s> <s>56</s> <s>53</s> 51 bytes

p s=and[any(`elem`map toEnum[a,a+32])s|a<-[65..90]]
```

<p>Try it online!</p>

<p><strong>Explanation:</strong></p>

<p>Give an input string <code>s</code>, for each <code>a</code> in range 65 to 90 (the ASCII codes for <code>A</code> to <code>Z</code>) it is checked whether any character in <code>s</code> is equal to either <code>a</code> (the upper case character) or <code>a+32</code> (the lower case character), converted to a character by <code>toEnum</code>. This generates a list of booleans. <code>and</code> checks if they're all <code>True</code>. </p>

<p><strong>Old version:</strong></p>

<pre class="lang-hs prettyprint-override"><code>import Data.Char
p s=and[any((==)a.toUpper)s|a<-['A'..'Z']]
</code>```

For every upper case alphabet letter, check whether some letter from s in upper case is equal to it. any(==a)s is the same as elem a s but allows to modify the elements of s before the comparison - in this case, covert them to upper case.

Title: Is it a pangram?

Body:
Haskell, <s>59</s> <s>56</s> <s>53</s> 51 bytes

p s=and[any(`elem`map toEnum[a,a+32])s|a<-[65..90]]

Try it online!

Explanation:

Give an input string s, for each a in range 65 to 90 (the ASCII codes for A to Z) it is checked whether any character in s is equal to either a (the upper case character) or a+32 (the lower case character), converted to a character by toEnum. This generates a list of booleans. and checks if they're all True.

Old version:

import Data.Char
p s=and[any((==)a.toUpper)s|a<-['A'..'Z']]

For every upper case alphabet letter, check whether some letter from s in upper case is equal to it. any(==a)s is the same as elem a s but allows to modify the elements of s before the comparison - in this case, covert them to upper case.


问:
Create output twice the length of the code

The Challenge

Write a complete program that writes twice as many bytes to standard output as the length of the program.

Rules

The program must write ASCII characters to the standard output.

The contents of the output doesn't matter.

The output, measured in bytes, must be exactly twice the length of the program, also measured in bytes, unless you fulfill the bonus.

Any trailing newline is included in the output's byte count.

Bonus

Your program can optionally take a number, n, as input. If so, the output must be exactly n * program length bytes. You can assume that n will always be a positive integer. If no input is provided, n must default to 2.

If you do this,  you can subtract 25 bytes from your score.

Shortest program wins.

Restrictions

No standard loopholes.

The program must be at least 1 byte long.

No adding unnecessary whitespace to the source code to change its length. Similarly, comments don't count.

Unless you fulfill the bonus, the program must accept no input. If you do fulfill the bonus, the integer must be the only input.

Lowest score (program length in bytes - bonus) wins.

The shortest answer for each language wins for that language.

Leaderboards

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

To make sure that your answer shows up, please start your answer with a headline, using the following Markdown template:

```<code># Language Name, N bytes
</code>```

where N is the size of your submission. If you improve your score, you can keep old scores in the headline, by striking them through. For instance:

```<code># Ruby, <s>104</s> <s>101</s> 96 bytes
</code>```

If there you want to include multiple numbers in your header (e.g. because your score is the sum of two files or you want to list interpreter flag penalties separately), make sure that the actual score is the last number in the header:

```<code># Perl, 43 + 2 (-p flag) = 45 bytes
</code>```

You can also make the language name a link which will then show up in the leaderboard snippet:

```<code># [><>](http://esolangs.org/wiki/Fish), 121 bytes
</code>```

var QUESTION_ID=59436,OVERRIDE_USER=41505;function answersUrl(e){return"https://api.stackexchange.com/2.2/questions/"+QUESTION_ID+"/answers?page="+e+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+ANSWER_FILTER}function commentUrl(e,s){return"https://api.stackexchange.com/2.2/answers/"+s.join(";")+"/comments?page="+e+"&pagesize=100&order=desc&sort=creation&site=codegolf&filter="+COMMENT_FILTER}function getAnswers(){jQuery.ajax({url:answersUrl(answer_page++),method:"get",dataType:"jsonp",crossDomain:!0,success:function(e){answers.push.apply(answers,e.items),answers_hash=[],answer_ids=[],e.items.forEach(function(e){e.comments=[];var s=+e.share_link.match(/\-?\d+/);answer_ids.push(s),answers_hash[s]=e}),e.has_more||(more_answers=!1),comment_page=1,getComments()}})}function getComments(){jQuery.ajax({url:commentUrl(comment_page++,answer_ids),method:"get",dataType:"jsonp",crossDomain:!0,success:function(e){e.items.forEach(function(e){e.owner.user_id===OVERRIDE_USER&&answers_hash[e.post_id].comments.push(e)}),e.has_more?getComments():more_answers?getAnswers():process()}})}function getAuthorName(e){return e.owner.display_name}function process(){var e=[];answers.forEach(function(s){var r=s.body;s.comments.forEach(function(e){OVERRIDE_REG.test(e.body)&&(r="
"+e.body.replace(OVERRIDE_REG,"")+"
")});var a=r.match(SCORE_REG);a&&e.push({user:getAuthorName(s),size:+a[2],language:a[1],link:s.share_link})}),e.sort(function(e,s){var r=e.size,a=s.size;return r-a});var s={},r=1,a=null,n=1;e.forEach(function(e){e.size!=a&&(n=r),a=e.size,++r;var t=jQuery("#answer-template").html();t=t.replace("{{PLACE}}",n+".").replace("{{NAME}}",e.user).replace("{{LANGUAGE}}",e.language).replace("{{SIZE}}",e.size).replace("{{LINK}}",e.link),t=jQuery(t),jQuery("#answers").append(t);var o=e.language;/s.lang?1:e.lang<s.lang?-1:0});for(var c=0;c<t.length;++c){var i=jQuery("#language-template").html(),o=t[c];i=i.replace("{{LANGUAGE}}",o.lang).replace("{{NAME}}",o.user).replace("{{SIZE}}",o.size).replace("{{LINK}}",o.link),i=jQuery(i),jQuery("#languages").append(i)}}var ANSWER_FILTER="!t)IWYnsLAZle2tQ3KqrVveCRJfxcRLe",COMMENT_FILTER="!)Q2B_A2kjfAiU78X(md6BoYk",answers=[],answers_hash,answer_ids,answer_page=1,more_answers=!0,comment_page;getAnswers();var SCORE_REG=/<h\d>\s*([^\n,]*[^\s,]),.*?(\-?\d+)(?=[^\n\d<>]*(?:<(?:s>[^\n<>]*<\/s>|[^\n<>]+>)[^\n\d<>]*)*<\/h\d>)/,OVERRIDE_REG=/^Override\s*header:\s*/i;```
<pre class="snippet-code-css lang-css prettyprint-override"><code>body{text-align:left!important}#answer-list,#language-list{padding:10px;width:290px;float:left}table thead{font-weight:700}table td{padding:5px}</code>```

 <link rel="stylesheet" type="text/css" href="//cdn.sstatic.net/codegolf/all.css?v=83c949450c8b">

Leaderboard

	Author	Language	Size

Winners by Language

Language	User	Score

{{PLACE}}	{{NAME}}	{{LANGUAGE}}	{{SIZE}}	Link

{{LANGUAGE}}	{{NAME}}	{{SIZE}}	Link

```

答:
BASH, 19 bytes

54 bytes -25 bonus. Using the variable input for x repeats:

```<code>#!/bin/sh
a=$1;for i in `seq 1 ${a:=2}`;do cat $0;done
</code>```

similar but more readable:

```<code>#!/bin/sh
a=$1
for i in `seq 1 ${a:=2}`; do
 cat $0
done
</code>```

19 bytes for a simple sh script.

```<code>#!/bin/sh
cat $0 $0
</code>```

Body:
BASH, 19 bytes

54 bytes -25 bonus. Using the variable input for x repeats:

#!/bin/sh
a=$1;for i in `seq 1 ${a:=2}`;do cat $0;done

similar but more readable:

#!/bin/sh
a=$1
for i in `seq 1 ${a:=2}`; do
 cat $0
done

19 bytes for a simple sh script.

#!/bin/sh
cat $0 $0


问:
Is this number Loeschian?
A positive integer \$k\$ is a Loeschian number if

\$k\$ can be expressed as \$i^2 + j^2 + i\times j\$ for \$i\$, \$j\$ integers.

For example, the first positive Loeschian numbers are: \$1\$ (\$i=1, j=0\$); \$3\$ (\$i=j=1\$); \$4\$ (\$i=2, j=0\$); \$7\$ (\$i=2, j=1\$); \$9\$ (\$i=-3, j=3\$); ... Note that \$i, j\$ for a given \$k\$ are not unique. For example, \$9\$ can also be generated with \$i=3, j=0\$.

Other equivalent characterizations of these numbers are:

\$k\$ can be expressed as \$i^2 + j^2 + i\times j\$ for \$i, j\$ non-negative integers. (For each pair of integers \$i, j\$ there's a pair of non-negative integers that gives the same \$k\$)

There is a set of \$k\$ contiguous hexagons that forms a tesselation on a hexagonal grid so that corresponding cells are the same distance apart (see illustrations for \$k = 4\$ and for \$k = 7\$). (Because of this property, these numbers find application in mobile cellular communication networks.)

See more characterizations in the OEIS page of the sequence.

The challenge

Given a positive integer, output a truthy result if it is a Loeschian number, or a falsy result otherwise.

The program or function should handle (say in less than a minute) inputs up to \$1000\$, or up to data type limitations.

Code golf. Shortest wins.

Test cases

The following numbers should output a truthy result:

```<code>1, 4, 7, 12, 13, 108, 109, 192, 516, 999
</code>```

The following numbers should output a falsy result:

```<code>2, 5, 10, 42, 101, 102, 128, 150, 501, 1000
</code>```

答:
Jelly, <s>15</s> <s>14</s> <s>13</s> 12 bytes

1 byte thanks to miles.

```<code>²S+P
‘ṗ2’Ç€i
</code>```

Try it online!

Verify the smaller testcases.

A word of advice when testing for large numbers (bigger than 50): don't.

Truthy is a positive number. Falsey is zero.

Explanation

```<code>‘ṗ2’Ç€i   main chain, argument: z
‘ṗ2’      generate all pairs of numbers between 0 and z inclusive
    Ç€    apply the helper link to each pair
      i   find the index of z in the result

²S+P   helper link, argument: [x,y] (a pair of numbers)
²      compute [x*x, y*y]
 S     x*x+y*y
  +P   x*x+y*y+x*y
</code>```

Title: Is this number Loeschian?

Body:
Jelly, <s>15</s> <s>14</s> <s>13</s> 12 bytes

1 byte thanks to miles.

²S+P
‘ṗ2’Ç€i

Try it online!

Verify the smaller testcases.

A word of advice when testing for large numbers (bigger than 50): don't.

Truthy is a positive number. Falsey is zero.

Explanation

‘ṗ2’Ç€i   main chain, argument: z
‘ṗ2’      generate all pairs of numbers between 0 and z inclusive
    Ç€    apply the helper link to each pair
      i   find the index of z in the result

²S+P   helper link, argument: [x,y] (a pair of numbers)
²      compute [x*x, y*y]
 S     x*x+y*y
  +P   x*x+y*y+x*y


答:
HTML, 1412 bytes

```A
ABA
ABCBA
ABCDCBA
ABCDEDCBA
ABCDEFEDCBA
ABCDEFGFEDCBA
ABCDEFGHGFEDCBA
ABCDEFGHIHGFEDCBA
ABCDEFGHIJIHGFEDCBA
ABCDEFGHIJKJIHGFEDCBA
ABCDEFGHIJKLKJIHGFEDCBA
ABCDEFGHIJKLMLKJIHGFEDCBA
ABCDEFGHIJKLMNMLKJIHGFEDCBA
ABCDEFGHIJKLMNONMLKJIHGFEDCBA
ABCDEFGHIJKLMNOPONMLKJIHGFEDCBA
ABCDEFGHIJKLMNOPQPONMLKJIHGFEDCBA
ABCDEFGHIJKLMNOPQRQPONMLKJIHGFEDCBA
ABCDEFGHIJKLMNOPQRSRQPONMLKJIHGFEDCBA
ABCDEFGHIJKLMNOPQRSTSRQPONMLKJIHGFEDCBA
ABCDEFGHIJKLMNOPQRSTUTSRQPONMLKJIHGFEDCBA
ABCDEFGHIJKLMNOPQRSTUVUTSRQPONMLKJIHGFEDCBA
ABCDEFGHIJKLMNOPQRSTUVWVUTSRQPONMLKJIHGFEDCBA
ABCDEFGHIJKLMNOPQRSTUVWXWVUTSRQPONMLKJIHGFEDCBA
ABCDEFGHIJKLMNOPQRSTUVWXYXWVUTSRQPONMLKJIHGFEDCBA
ABCDEFGHIJKLMNOPQRSTUVWXYZYXWVUTSRQPONMLKJIHGFEDCBA
ABCDEFGHIJKLMNOPQRSTUVWXYXWVUTSRQPONMLKJIHGFEDCBA
ABCDEFGHIJKLMNOPQRSTUVWXWVUTSRQPONMLKJIHGFEDCBA
ABCDEFGHIJKLMNOPQRSTUVWVUTSRQPONMLKJIHGFEDCBA
ABCDEFGHIJKLMNOPQRSTUVUTSRQPONMLKJIHGFEDCBA
ABCDEFGHIJKLMNOPQRSTUTSRQPONMLKJIHGFEDCBA
ABCDEFGHIJKLMNOPQRSTSRQPONMLKJIHGFEDCBA
ABCDEFGHIJKLMNOPQRSRQPONMLKJIHGFEDCBA
ABCDEFGHIJKLMNOPQRQPONMLKJIHGFEDCBA
ABCDEFGHIJKLMNOPQPONMLKJIHGFEDCBA
ABCDEFGHIJKLMNOPONMLKJIHGFEDCBA
ABCDEFGHIJKLMNONMLKJIHGFEDCBA
ABCDEFGHIJKLMNMLKJIHGFEDCBA
ABCDEFGHIJKLMLKJIHGFEDCBA
ABCDEFGHIJKLKJIHGFEDCBA
ABCDEFGHIJKJIHGFEDCBA
ABCDEFGHIJIHGFEDCBA
ABCDEFGHIHGFEDCBA
ABCDEFGHGFEDCBA
ABCDEFGFEDCBA
ABCDEFEDCBA
ABCDEDCBA
ABCDCBA
ABCBA
ABA
A``````

Title: Alphabet triangle

Body:
You are to print this exact text:

```<code>A
ABA
ABCBA
ABCDCBA
ABCDEDCBA
ABCDEFEDCBA
ABCDEFGFEDCBA
ABCDEFGHGFEDCBA
ABCDEFGHIHGFEDCBA
ABCDEFGHIJIHGFEDCBA
ABCDEFGHIJKJIHGFEDCBA
ABCDEFGHIJKLKJIHGFEDCBA
ABCDEFGHIJKLMLKJIHGFEDCBA
ABCDEFGHIJKLMNMLKJIHGFEDCBA
ABCDEFGHIJKLMNONMLKJIHGFEDCBA
ABCDEFGHIJKLMNOPONMLKJIHGFEDCBA
ABCDEFGHIJKLMNOPQPONMLKJIHGFEDCBA
ABCDEFGHIJKLMNOPQRQPONMLKJIHGFEDCBA
ABCDEFGHIJKLMNOPQRSRQPONMLKJIHGFEDCBA
ABCDEFGHIJKLMNOPQRSTSRQPONMLKJIHGFEDCBA
ABCDEFGHIJKLMNOPQRSTUTSRQPONMLKJIHGFEDCBA
ABCDEFGHIJKLMNOPQRSTUVUTSRQPONMLKJIHGFEDCBA
ABCDEFGHIJKLMNOPQRSTUVWVUTSRQPONMLKJIHGFEDCBA
ABCDEFGHIJKLMNOPQRSTUVWXWVUTSRQPONMLKJIHGFEDCBA
ABCDEFGHIJKLMNOPQRSTUVWXYXWVUTSRQPONMLKJIHGFEDCBA
ABCDEFGHIJKLMNOPQRSTUVWXYZYXWVUTSRQPONMLKJIHGFEDCBA
ABCDEFGHIJKLMNOPQRSTUVWXYXWVUTSRQPONMLKJIHGFEDCBA
ABCDEFGHIJKLMNOPQRSTUVWXWVUTSRQPONMLKJIHGFEDCBA
ABCDEFGHIJKLMNOPQRSTUVWVUTSRQPONMLKJIHGFEDCBA
ABCDEFGHIJKLMNOPQRSTUVUTSRQPONMLKJIHGFEDCBA
ABCDEFGHIJKLMNOPQRSTUTSRQPONMLKJIHGFEDCBA
ABCDEFGHIJKLMNOPQRSTSRQPONMLKJIHGFEDCBA
ABCDEFGHIJKLMNOPQRSRQPONMLKJIHGFEDCBA
ABCDEFGHIJKLMNOPQRQPONMLKJIHGFEDCBA
ABCDEFGHIJKLMNOPQPONMLKJIHGFEDCBA
ABCDEFGHIJKLMNOPONMLKJIHGFEDCBA
ABCDEFGHIJKLMNONMLKJIHGFEDCBA
ABCDEFGHIJKLMNMLKJIHGFEDCBA
ABCDEFGHIJKLMLKJIHGFEDCBA
ABCDEFGHIJKLKJIHGFEDCBA
ABCDEFGHIJKJIHGFEDCBA
ABCDEFGHIJIHGFEDCBA
ABCDEFGHIHGFEDCBA
ABCDEFGHGFEDCBA
ABCDEFGFEDCBA
ABCDEFEDCBA
ABCDEDCBA
ABCDCBA
ABCBA
ABA
A
</code>```

Specs

Extra trailing newlines are allowed at the end of the output.

Extra trailing spaces (U+0020) are allowed at the end of each line, including the extra trailing newlines.

You can use all lowercase instead of all uppercase, but you cannot print partially lowercase partially uppercase.

You can return the text as a function output instead of printing it in a full program.

Scoring

Since this is a triangle, and a triangle has 3 sides, and 3 is a small number, your code should be small in terms of byte-count.

Body:
HTML, 1412 bytes

<pre>A
ABA
ABCBA
ABCDCBA
ABCDEDCBA
ABCDEFEDCBA
ABCDEFGFEDCBA
ABCDEFGHGFEDCBA
ABCDEFGHIHGFEDCBA
ABCDEFGHIJIHGFEDCBA
ABCDEFGHIJKJIHGFEDCBA
ABCDEFGHIJKLKJIHGFEDCBA
ABCDEFGHIJKLMLKJIHGFEDCBA
ABCDEFGHIJKLMNMLKJIHGFEDCBA
ABCDEFGHIJKLMNONMLKJIHGFEDCBA
ABCDEFGHIJKLMNOPONMLKJIHGFEDCBA
ABCDEFGHIJKLMNOPQPONMLKJIHGFEDCBA
ABCDEFGHIJKLMNOPQRQPONMLKJIHGFEDCBA
ABCDEFGHIJKLMNOPQRSRQPONMLKJIHGFEDCBA
ABCDEFGHIJKLMNOPQRSTSRQPONMLKJIHGFEDCBA
ABCDEFGHIJKLMNOPQRSTUTSRQPONMLKJIHGFEDCBA
ABCDEFGHIJKLMNOPQRSTUVUTSRQPONMLKJIHGFEDCBA
ABCDEFGHIJKLMNOPQRSTUVWVUTSRQPONMLKJIHGFEDCBA
ABCDEFGHIJKLMNOPQRSTUVWXWVUTSRQPONMLKJIHGFEDCBA
ABCDEFGHIJKLMNOPQRSTUVWXYXWVUTSRQPONMLKJIHGFEDCBA
ABCDEFGHIJKLMNOPQRSTUVWXYZYXWVUTSRQPONMLKJIHGFEDCBA
ABCDEFGHIJKLMNOPQRSTUVWXYXWVUTSRQPONMLKJIHGFEDCBA
ABCDEFGHIJKLMNOPQRSTUVWXWVUTSRQPONMLKJIHGFEDCBA
ABCDEFGHIJKLMNOPQRSTUVWVUTSRQPONMLKJIHGFEDCBA
ABCDEFGHIJKLMNOPQRSTUVUTSRQPONMLKJIHGFEDCBA
ABCDEFGHIJKLMNOPQRSTUTSRQPONMLKJIHGFEDCBA
ABCDEFGHIJKLMNOPQRSTSRQPONMLKJIHGFEDCBA
ABCDEFGHIJKLMNOPQRSRQPONMLKJIHGFEDCBA
ABCDEFGHIJKLMNOPQRQPONMLKJIHGFEDCBA
ABCDEFGHIJKLMNOPQPONMLKJIHGFEDCBA
ABCDEFGHIJKLMNOPONMLKJIHGFEDCBA
ABCDEFGHIJKLMNONMLKJIHGFEDCBA
ABCDEFGHIJKLMNMLKJIHGFEDCBA
ABCDEFGHIJKLMLKJIHGFEDCBA
ABCDEFGHIJKLKJIHGFEDCBA
ABCDEFGHIJKJIHGFEDCBA
ABCDEFGHIJIHGFEDCBA
ABCDEFGHIHGFEDCBA
ABCDEFGHGFEDCBA
ABCDEFGFEDCBA
ABCDEFEDCBA
ABCDEDCBA
ABCDCBA
ABCBA
ABA
A</pre>


答:
Javascript (using external library - Enumerable) (83 bytes)

```<code> n=>_.From("abcdefghijklmnopqrstuvwxyz").All(x=>_.From(n.toLowerCase()).Contains(x))
</code>```

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

Code explanation: Load the lowercase alphabet as char array, then test that every single char is contained in the lowercased input

Title: Is it a pangram?

Body:
Write a function or program that takes as its input a string and prints a truthy value if the string is a pangram (a sequence of letters containing at least one of each letter in the English alphabet) and a falsey value otherwise.

Case of letters should be ignored; If the string is abcdefghijklmnopqrstuvwXYZ, then the function should still return a truthy value. Note that the string can contain any other characters in it, so 123abcdefghijklm NOPQRSTUVWXYZ321 would return a truthy value. An empty input should return a falsey value.

Test cases

```<code>AbCdEfGhIjKlMnOpQrStUvWxYz

==> True

ACEGIKMOQSUWY
BDFHJLNPRTVXZ

==> True

public static void main(String[] args)

==> False

The quick brown fox jumped over the lazy dogs. BOING BOING BOING

==> True
</code>```

This is code golf. Standard rules apply. Shortest code in bytes wins.

Body:
Javascript (using external library - Enumerable) (83 bytes)

 n=>_.From("abcdefghijklmnopqrstuvwxyz").All(x=>_.From(n.toLowerCase()).Contains(x))

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

Code explanation: Load the lowercase alphabet as char array, then test that every single char is contained in the lowercased input


答:
MATL, <s>14</s> 13 bytes

```<code>t:0hU&+HM&*+m
</code>```

Try it online! Or verify all test cases.

Outputs 1 or 0.

Explanation

```<code>t:    % Implicitly input number k. Duplicate. Generate vector [1 2 ...k]
0h    % Concatenate a 0. Gives [1 2 ... k 0]
U     % Square, element-wise. Gives [1 4 ... k^2 0]
&+    % Sum of all pairs from this vector. Gives a (k+1)×(k+1) matrix
HM    % Push [1 2 ... k 0] again
&*    % Product of all pairs from this vector. Gives a (k+1)×(k+1) matrix
+     % Add the two matrices
m     % True if k is a member of the resulting matrix. Implicitly display
</code>```

Title: Is this number Loeschian?

Body:
A positive integer \$k\$ is a Loeschian number if

\$k\$ can be expressed as \$i^2 + j^2 + i\times j\$ for \$i\$, \$j\$ integers.

For example, the first positive Loeschian numbers are: \$1\$ (\$i=1, j=0\$); \$3\$ (\$i=j=1\$); \$4\$ (\$i=2, j=0\$); \$7\$ (\$i=2, j=1\$); \$9\$ (\$i=-3, j=3\$); ... Note that \$i, j\$ for a given \$k\$ are not unique. For example, \$9\$ can also be generated with \$i=3, j=0\$.

Other equivalent characterizations of these numbers are:

\$k\$ can be expressed as \$i^2 + j^2 + i\times j\$ for \$i, j\$ non-negative integers. (For each pair of integers \$i, j\$ there's a pair of non-negative integers that gives the same \$k\$)

There is a set of \$k\$ contiguous hexagons that forms a tesselation on a hexagonal grid so that corresponding cells are the same distance apart (see illustrations for \$k = 4\$ and for \$k = 7\$). (Because of this property, these numbers find application in mobile cellular communication networks.)

See more characterizations in the OEIS page of the sequence.

The challenge

Given a positive integer, output a truthy result if it is a Loeschian number, or a falsy result otherwise.

The program or function should handle (say in less than a minute) inputs up to \$1000\$, or up to data type limitations.

Code golf. Shortest wins.

Test cases

The following numbers should output a truthy result:

```<code>1, 4, 7, 12, 13, 108, 109, 192, 516, 999
</code>```

The following numbers should output a falsy result:

```<code>2, 5, 10, 42, 101, 102, 128, 150, 501, 1000
</code>```

Body:
MATL, <s>14</s> 13 bytes

t:0hU&+HM&*+m

Try it online! Or verify all test cases.

Outputs 1 or 0.

Explanation

t:    % Implicitly input number k. Duplicate. Generate vector [1 2 ...k]
0h    % Concatenate a 0. Gives [1 2 ... k 0]
U     % Square, element-wise. Gives [1 4 ... k^2 0]
&+    % Sum of all pairs from this vector. Gives a (k+1)×(k+1) matrix
HM    % Push [1 2 ... k 0] again
&*    % Product of all pairs from this vector. Gives a (k+1)×(k+1) matrix
+     % Add the two matrices
m     % True if k is a member of the resulting matrix. Implicitly display


答:
C# - 88 bytes

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

Title: Print a 10 by 10 grid of asterisks

Body:
C# - 88 bytes

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


答:
PowerShell v2+, <s>63</s> <s>56</s> 55 bytes

```<code>param($k)(0..$k|%{0..($i=$_)|%{$i*($i+$_)+$_*$_}})-eq$k
</code>```

Takes input $k, loops upwards twice (outer loop $i = 0 to $k, inner loop $j = 0 to $i), each iteration generates the result of i*i + j*j + i*j (shortened to i*(i+j) + j*j). Those results are encapsulated in parens, and passed as an array to -eq$k. This acts as a filter to select only elements that equal the input. Outputs a nonzero (the number back) for truthy, or nothing (empty) for falsey. Processes 1000 in about 15 seconds on my machine.

Test Cases

```<code>PS C:\Tools\Scripts\golfing> (1,4,7,12,13,108,109,192,516,999|%{.\loeschian-numbers.ps1 $_})-join','
1,4,7,12,13,108,109,192,516,999

PS C:\Tools\Scripts\golfing> (2,5,10,42,101,102,128,150,501,1000|%{.\loeschian-numbers.ps1 $_})-join','

PS C:\Tools\Scripts\golfing>
</code>```

Title: Is this number Loeschian?

Body:
PowerShell v2+, <s>63</s> <s>56</s> 55 bytes

param($k)(0..$k|%{0..($i=$_)|%{$i*($i+$_)+$_*$_}})-eq$k

Takes input $k, loops upwards twice (outer loop $i = 0 to $k, inner loop $j = 0 to $i), each iteration generates the result of i*i + j*j + i*j (shortened to i*(i+j) + j*j). Those results are encapsulated in parens, and passed as an array to -eq$k. This acts as a filter to select only elements that equal the input. Outputs a nonzero (the number back) for truthy, or nothing (empty) for falsey. Processes 1000 in about 15 seconds on my machine.

Test Cases

PS C:\Tools\Scripts\golfing> (1,4,7,12,13,108,109,192,516,999|%{.\loeschian-numbers.ps1 $_})-join','
1,4,7,12,13,108,109,192,516,999

PS C:\Tools\Scripts\golfing> (2,5,10,42,101,102,128,150,501,1000|%{.\loeschian-numbers.ps1 $_})-join','

PS C:\Tools\Scripts\golfing>


答:
Haskell

```<code>main=putStrLn hello_world
 where hello_world=show H++ello_world
        where ello_world=show E++llo_world
               where llo_world=show L++lo_world
                      where lo_world=show L++o_world
                             where o_world=show O++_world
                                    where _world=show ++world
                                           where world=show W++orld
                                                  where orld=show O++rld
                                                         where rld=show R++ld
                                                                where ld=show L++d
                                                                       where d=show D
data Letter=H|E|L|O||W|R|D
instance Show Letter where
 show H=["Hello, World!"!!0]
 show E=["Hello, World!"!!1]
 show L=["Hello, World!"!!2]
 show O=["Hello, World!"!!4]
 show =["Hello, World!"!!6]
 show W=["Hello, World!"!!7]
 show R=["Hello, World!"!!9]
 show D=["Hello, World!"!!11]
main::IO()
</code>```

1024 characters, including the (necessary, Haskell is indentation-sensitive!) whitespace. (Though you could remove the line breaks entirely, but who wants an unreadable one-liner? Even now, it's hard enough to guess what this program does, what with the lack of comments...)

Title: Hello World in 1024 characters

Body:
Haskell

main=putStrLn hello_world
 where hello_world=show H++ello_world
        where ello_world=show E++llo_world
               where llo_world=show L++lo_world
                      where lo_world=show L++o_world
                             where o_world=show O++_world
                                    where _world=show ++world
                                           where world=show W++orld
                                                  where orld=show O++rld
                                                         where rld=show R++ld
                                                                where ld=show L++d
                                                                       where d=show D
data Letter=H|E|L|O||W|R|D
instance Show Letter where
 show H=["Hello, World!"!!0]
 show E=["Hello, World!"!!1]
 show L=["Hello, World!"!!2]
 show O=["Hello, World!"!!4]
 show =["Hello, World!"!!6]
 show W=["Hello, World!"!!7]
 show R=["Hello, World!"!!9]
 show D=["Hello, World!"!!11]
main::IO()

1024 characters, including the (necessary, Haskell is indentation-sensitive!) whitespace. (Though you could remove the line breaks entirely, but who wants an unreadable one-liner? Even now, it's hard enough to guess what this program does, what with the lack of comments...)


答:
Haskell, 42 bytes

```<code>f k=or[k==i*i+j*j+i*j|i<-[0..k],j<-[0..i]]
</code>```

Usage example: f 501 -> False.

Tries all combinations of i from 0 to k and j from 0 to i . or returns True if the equality k==i*i+j*j+i*j holds for at least one of the combinations.

@flawr found a slightly different version with the same byte count:

```<code>f k|v<-[0..k]=or[(i+j)^2==k+i*j|i<-v,j<-v]
</code>```

Title: Is this number Loeschian?

Body:
Haskell, 42 bytes

f k=or[k==i*i+j*j+i*j|i<-[0..k],j<-[0..i]]

Usage example: f 501 -> False.

Tries all combinations of i from 0 to k and j from 0 to i . or returns True if the equality k==i*i+j*j+i*j holds for at least one of the combinations.

@flawr found a slightly different version with the same byte count:

f k|v<-[0..k]=or[(i+j)^2==k+i*j|i<-v,j<-v]


Title: Is this number Loeschian?

Body:
C (gcc), 71 69 bytes

i,j,r;f(n){for(r=i=n+1;i--;)for(j=n;j--;)r*=n!=i*i+j*j+i*j;return!r;}


答:
C#, <s>84</s> <s>82</s> 81 bytes

```<code>k=>{for(int i=0,j;i<=k;++i)for(j=0;j<=k;)if(i*i+j*j+i*j++==k)return 1;return 0;};
</code>```

A naïve solution. 1 = true, 0 = false

Title: Is this number Loeschian?

Body:
C#, <s>84</s> <s>82</s> 81 bytes

k=>{for(int i=0,j;i<=k;++i)for(j=0;j<=k;)if(i*i+j*j+i*j++==k)return 1;return 0;};

A naïve solution. 1 = true, 0 = false


答:
Retina, <s>66</s> <s>63</s> <s>45</s> <s>43</s> 36 bytes

```<code>^()(\1(?<1>.\1))+(\1(.(?(4).\4)))*$
</code>```

Despite the title saying Retina, this is just a plain .NET regex which accepts unary representations of Loeschian numbers.

Inputs 999 and 1000 take well under a second.

Try it online! (The first line enables a linefeed-separated test suite, and the next two take care of the conversion to unary for convenience.)

Explanation

The solution is based on the classification that the input can be written as i*i + j*(i + j) for positive i and non-negative j (since we don't have to handle input 0), and that n*n is just the sum of the first n odd integers. Golfing this was an interesting exercise in forward references.

A "forward reference" is when you put a backreference inside the group it refers to. Of course that doesn't work when the group is used the first time, since there is nothing to be backreferenced yet, but if you put this in a loop, then the backreference gets the previous iteration's capture each time. This in turn, let's you build up a larger capture with each iteration. This can be used to craft very compact patterns for things like triangular numbers, squares and Fibonacci numbers.

As an example, using the fact that squares are just sums of the first n odd integers, we can match a square input like this:

```<code>(^.|..\1)+$
</code>```

On the first iteration, ..\1 can't work, because \1 doesn't have a value yet. So we start with ^., capturing a single character into group 1. On subsequent iterations, ^. no longer matches due to the anchor, but now ..\1 is valid. It matches two more characters than the previous iteration and updates the capture. This way we match increasing odd numbers, getting a square after each iteration.

Now unfortunately, we can't use this technique as is. After matching i*i, we need to get i as well, so that we can multiply it by j. A simple (but long) way to do this is to make use of the fact that matching i*i takes i iterations, so that we've captured i things in group 1. We could now use balancing groups to extract this i, but like I said that's expensive.

Instead, I figured out a different way to write this "sum of consecutive odd integers" that also yields i in a capturing group at the end. Of course the ith odd number is just 2i-1. This gives us a way to increment the forward reference only by 1 on each iteration. That's this part:

```<code>^()(\1(?<1>.\1))+
</code>```

This () just pushes an empty capture onto group 1 (initialising i to 0). This is pretty much equivalent to the ^.| in the simple solution above, but using | in this case would be a bit trickier.

Then we have the main loop (\1(?<1>.\1)). \1 matches the previous i, (?<1>.\1) then updates group 1 with i+1. In terms of the new i, we've just matched 2i-1 characters. Exactly what we need.

When we're done, we've matched some square i*i and group 1 still holds i characters.

The second part is closer to the simple square matching I showed above. Let's ignore the backreference to 1 for now:

```<code>(.(?(4).\1))*
</code>```

This is basically the same as (^.|..\4)*, except that we can't make use of ^ because we're not at the start of the string. Instead we make use of a conditional, to match the additional .\1 only when we've already used group 4. But in effect this is exactly the same. This gives us j*j.

The only thing that's missing is the j*i term. We combine this with the j*j by making use of the fact that the j*j computation still takes j iterations. So for each iteration we also advance the cursor by i with \1. We just need to make sure not to write that into group 4, because that would mess with matching consecutive odd numbers. That's how we arrive at the:

```<code>(\1(.(?(4).\1)))*
</code>```

Title: Is this number Loeschian?

Body:
Retina, <s>66</s> <s>63</s> <s>45</s> <s>43</s> 36 bytes

^()(\1(?<1>.\1))+(\1(.(?(4).\4)))*$

Despite the title saying Retina, this is just a plain .NET regex which accepts unary representations of Loeschian numbers.

Inputs 999 and 1000 take well under a second.

Try it online! (The first line enables a linefeed-separated test suite, and the next two take care of the conversion to unary for convenience.)

Explanation

The solution is based on the classification that the input can be written as i*i + j*(i + j) for positive i and non-negative j (since we don't have to handle input 0), and that n*n is just the sum of the first n odd integers. Golfing this was an interesting exercise in forward references.

A "forward reference" is when you put a backreference inside the group it refers to. Of course that doesn't work when the group is used the first time, since there is nothing to be backreferenced yet, but if you put this in a loop, then the backreference gets the previous iteration's capture each time. This in turn, let's you build up a larger capture with each iteration. This can be used to craft very compact patterns for things like triangular numbers, squares and Fibonacci numbers.

As an example, using the fact that squares are just sums of the first n odd integers, we can match a square input like this:

(^.|..\1)+$

On the first iteration, ..\1 can't work, because \1 doesn't have a value yet. So we start with ^., capturing a single character into group 1. On subsequent iterations, ^. no longer matches due to the anchor, but now ..\1 is valid. It matches two more characters than the previous iteration and updates the capture. This way we match increasing odd numbers, getting a square after each iteration.

Now unfortunately, we can't use this technique as is. After matching i*i, we need to get i as well, so that we can multiply it by j. A simple (but long) way to do this is to make use of the fact that matching i*i takes i iterations, so that we've captured i things in group 1. We could now use balancing groups to extract this i, but like I said that's expensive.

Instead, I figured out a different way to write this "sum of consecutive odd integers" that also yields i in a capturing group at the end. Of course the ith odd number is just 2i-1. This gives us a way to increment the forward reference only by 1 on each iteration. That's this part:

^()(\1(?<1>.\1))+

This () just pushes an empty capture onto group 1 (initialising i to 0). This is pretty much equivalent to the ^.| in the simple solution above, but using | in this case would be a bit trickier.

Then we have the main loop (\1(?<1>.\1)). \1 matches the previous i, (?<1>.\1) then updates group 1 with i+1. In terms of the new i, we've just matched 2i-1 characters. Exactly what we need.

When we're done, we've matched some square i*i and group 1 still holds i characters.

The second part is closer to the simple square matching I showed above. Let's ignore the backreference to 1 for now:

(.(?(4).\1))*

This is basically the same as (^.|..\4)*, except that we can't make use of ^ because we're not at the start of the string. Instead we make use of a conditional, to match the additional .\1 only when we've already used group 4. But in effect this is exactly the same. This gives us j*j.

The only thing that's missing is the j*i term. We combine this with the j*j by making use of the fact that the j*j computation still takes j iterations. So for each iteration we also advance the cursor by i with \1. We just need to make sure not to write that into group 4, because that would mess with matching consecutive odd numbers. That's how we arrive at the:

(\1(.(?(4).\1)))*


答:
Javascript (using external library - Enumerable) (63 bytes)

```<code>k=>_.Range(0,k+1).Any(i=>_.Range(0,k+1).Any(j=>i*i+j*j+i*j==k))
</code>```

Link to library: https://github.com/mvegh1/Enumerable
Code explanation: Create a range of integers from 0 to k (call this the "i" range), and test if any "i" satisfies a certain predicate. That predicate creates a range from 0 to k (call this the "j" range), and tests if any "j" satisfies a certain predicate. That predicate is the loeschian formula

Title: Is this number Loeschian?

Body:
Javascript (using external library - Enumerable) (63 bytes)

k=>_.Range(0,k+1).Any(i=>_.Range(0,k+1).Any(j=>i*i+j*j+i*j==k))

Link to library: https://github.com/mvegh1/Enumerable
Code explanation: Create a range of integers from 0 to k (call this the "i" range), and test if any "i" satisfies a certain predicate. That predicate creates a range from 0 to k (call this the "j" range), and tests if any "j" satisfies a certain predicate. That predicate is the loeschian formula


答:
Notepad, 34 31 keystrokes

```<code>**********
^A^C↓^V^A^C↓^V^V^V^V
</code>```

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

Props to Crypto for 3 saved keystrokes.

Title: Print a 10 by 10 grid of asterisks

Body:
Background

This is a standard textbook example to demonstrate for loops.

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

Task

You are to print this exact text:

```<code>**********
**********
**********
**********
**********
**********
**********
**********
**********
**********
</code>```

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 code-golf. Shortest answer in bytes wins.

Body:
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.


答:
T-SQL, 50 bytes

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

Title: Print a 10 by 10 grid of asterisks


答:
CJam (16 15 bytes)

```<code>{mF{~\3%2=&},!}
</code>```

Online demo

This is a block (an "anonymous function") which takes input on the stack and leaves 0 or 1 on the stack. It uses the characterisation that a number is Loeschian iff it has no prime factor equal to 2 mod 3 with odd multiplicity.

Thanks to Dennis for a one-byte saving.

Title: Is this number Loeschian?

Body:
CJam (16 15 bytes)

{mF{~\3%2=&},!}

Online demo

This is a block (an "anonymous function") which takes input on the stack and leaves 0 or 1 on the stack. It uses the characterisation that a number is Loeschian iff it has no prime factor equal to 2 mod 3 with odd multiplicity.

Thanks to Dennis for a one-byte saving.


答:
Python, 67 bytes

```<code>lambda k,r=range:any(i*i+j*j+i*j==k for i in r(k+1)for j in r(k+1))
</code>```

https://repl.it/Cj6x

Title: Is this number Loeschian?

Body:
Python, 67 bytes

lambda k,r=range:any(i*i+j*j+i*j==k for i in r(k+1)for j in r(k+1))

https://repl.it/Cj6x


答:
Java 8, 81 bytes

```<code>k->{for(int i=0,j;i<=k;i++)for(j=0;j<=k;)if(i*i+j*j+i*j++==k)return 1;return 0;};
</code>```

simple, naïve implementation. coincidentally same code as C# but uses -> rather than =>.

Title: Is this number Loeschian?

Body:
Java 8, 81 bytes

k->{for(int i=0,j;i<=k;i++)for(j=0;j<=k;)if(i*i+j*j+i*j++==k)return 1;return 0;};

simple, naïve implementation. coincidentally same code as C# but uses -> rather than =>.


答:
Python 2, 56 bytes

```<code>lambda n:any(n==i*i%n+i/n*(i/n+i%n)for i in range(2*n*n))
</code>```

Title: Is this number Loeschian?

Body:
Python 2, 56 bytes

lambda n:any(n==i*i%n+i/n*(i/n+i%n)for i in range(2*n*n))


答:
Ruby, 18 bytes

```<code>puts (?**10+$/)*10
</code>```

Alternative version (+3 bytes)

```<code>10.times {puts ?**10}
</code>```

Ungolfed (first version)

```<code>puts ('*' * 10 + '\n') * 10
</code>```

Title: Print a 10 by 10 grid of asterisks

Body:
Ruby, 18 bytes

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

Alternative version (+3 bytes)

10.times {puts ?**10}

Ungolfed (first version)

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


Title: Print a 10 by 10 grid of asterisks

Body:
Perl, 24 bytes

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


问:
Hofstadter H-sequence

Definition

\$a(0) = 0\$

\$a(n) = n-a(a(a(n-1)))\$ for integer \$n > 0\$

Task

Given non-negative integer \$n\$, output \$a(n)\$.

Testcases

```<code>n     a(n)
0     0
1     1
2     1
3     2
4     3
5     4
6     4
7     5
8     5
9     6
10    7
11    7
12    8
13    9
14    10
15    10
16    11
17    12
18    13
19    13
20    14
10000 6823
</code>```

References

WolframMathWorld

OEIS A005374

答:
C#, 156 bytes

Mine is going to be a bit longer than the other C# answer, but my version can compute up to 10,000 (and higher) without a stack overflow, and can do all integers from 0 to 10,000 in a fraction of a second due to addition of a dictionary.  Most of the answers here can take hours to do integers in the thousands, so my extra bytes also lead to massive speed increases.

Golfed

```<code>Dictionary<int,int> l=new Dictionary<int,int>();int H(int n){int v;if(n==0)return 0;if(l.TryGetValue(n,out v)){}else{v=n-H(H(H(n-1)));l.Add(n,v);}return v;}
</code>```

Ungolfed (with test program)

```<code>using System;
using System.Collections.Generic;

namespace HH
{
    class Program
    {
        static Dictionary<int, int> l = new Dictionary<int, int>();

        static int H(int n)
        {
            int v;
            if (n == 0)
                return 0;
            if (l.TryGetValue(n, out v))
            { }
            else
            {
                v = n - H(H(H(n - 1)));
                l.Add(n, v);
            }
            return v;
        }

        static void Main(string[] args)
        {
            for(int i = 0; i <= 10000; i++)
                Console.WriteLine("{0}: {1}", i, H(i));
            Console.ReadLine();
        }
    }
}
</code>```

Edit: The other C# answer can't compute H(10,000) without a stack overflow, mine can print all numbers from H(1) to H(1,000,000) in a few seconds.  H(1,000,000) is 682,328 if anyone was wondering :P

Title: Hofstadter H-sequence

Body:
C#, 156 bytes

Mine is going to be a bit longer than the other C# answer, but my version can compute up to 10,000 (and higher) without a stack overflow, and can do all integers from 0 to 10,000 in a fraction of a second due to addition of a dictionary.  Most of the answers here can take hours to do integers in the thousands, so my extra bytes also lead to massive speed increases.

Golfed

Dictionary<int,int> l=new Dictionary<int,int>();int H(int n){int v;if(n==0)return 0;if(l.TryGetValue(n,out v)){}else{v=n-H(H(H(n-1)));l.Add(n,v);}return v;}

Ungolfed (with test program)

using System;
using System.Collections.Generic;

namespace HH
{
    class Program
    {
        static Dictionary<int, int> l = new Dictionary<int, int>();

        static int H(int n)
        {
            int v;
            if (n == 0)
                return 0;
            if (l.TryGetValue(n, out v))
            { }
            else
            {
                v = n - H(H(H(n - 1)));
                l.Add(n, v);
            }
            return v;
        }

        static void Main(string[] args)
        {
            for(int i = 0; i <= 10000; i++)
                Console.WriteLine("{0}: {1}", i, H(i));
            Console.ReadLine();
        }
    }
}

Edit: The other C# answer can't compute H(10,000) without a stack overflow, mine can print all numbers from H(1) to H(1,000,000) in a few seconds.  H(1,000,000) is 682,328 if anyone was wondering :P


答:
Julia, <s>23</s> 22 bytes

```<code>print(("*"^10*"
")^10)
</code>```

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

Title: Print a 10 by 10 grid of asterisks

Body:
Julia, <s>23</s> 22 bytes

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

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


答:
Hexagony, 37 35 34 31

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

Expanded:

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

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:

```<code>10 \ / 10
    |
   42
</code>```

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:

```<code>10 \ / 9
    |
   42
</code>```

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:

```<code> 9 \ / 10
    |
   42
</code>```

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.

Title: Print a 10 by 10 grid of asterisks

Body:
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.