TransWikia.com

Triangular code, triangular output

Code Golf Asked on November 28, 2021

For this challenge, submissions should be a program or function shaped like a right triangle, which produces a right triangle of the same size.

What is a right triangle?

For this challenge, a right triangle consists of 1 or more lines, each containing a number of characters (assume all non-newline characters are the same width) equal to that line number:

.
..
...
....

Trailing newlines are allowed.

The challenge:

Your code should form a right triangle, and output a right triangle with the same height made up of any non-newline characters.

As this is code golf, shortest answer in bytes per language wins.

61 Answers

Vyxal, 1 byte

0

Try it Online!

Any digit works.

More interestingly,

Vyxal j, 4 bytes

2
ʁ↵

Try it Online!

2   # 2
 ʁ  # Range 0-1
  ↵ # 10 ** n (vectorised)
    # (j flag) joined by newlines

Using powers of 10.

And finally,

Vyxal, 8 bytes

3
ɾ×
*⁋,

Try it Online!

3      # 3
 ɾ     # 1...3
  ×*   # That many asterisks, for each
    ⁋  # Joined by newlines
     , # Outputted. 

Making an asterisk triangle.

Answered by emanresu A on November 28, 2021

BRASCA, 1 byte

Yep, it's another one of these.

Pick any one of these:

0123456789oOnNlLeEdDhHK+-*^s}r&|_ABmM?!ST<>=Y

Explanation

TL;DR: Most instructions work because an empty stack consists of infinite zeroes.

0-9       - Pushes the digit, implicit output.
oOnN      - Prints the top/bottom of the stack, which is 0x00 because the stack is empty.
lLeEdDhHK - Pushes 10, 13, 26, 32, 48, 65, 97, 100 and 1000 respectively, implicit output.
+-*^s}    - Operate on zeroes because of an empty stack. (ex. + on an empty stack is 0+0).
r         - Pushes a range between 0 and 0, which is just a single 0.
&|_       - Bitwise operators on zeroes because, once again, of an empty stack.
AB        - Registers are 0 by default.
mM        - Shifting an empty stack pushes a 0.
?         - Pushes a random number between 0 and 0.
!         - Pushes the stack length, which is 0.
S         - Concatenates 0 with 0, creating 0.
T         - Sets implicit output to only output the top of the stack, which is empty, so it's a 0.
<>=Y      - Compares 0 with 0 in a bunch of ways.

Answered by SjoerdPennings on November 28, 2021

batch 63 23 bytes

:
T^
YP^
E==^
;%~f0

Outputs the file content.

Note:

  • TIO not available, run it from the command line after turning echo off

Answered by T3RR0R on November 28, 2021

Pxem, Filename: 103 bytes + Content: 0 bytes = 103 bytes

Filename as follows (if your filesystem doesn't support LF, I'm sorry) (also requires to be ASCII-compatible):

x
.p
x.n
.o.n
.o04x
.-.t.z
.c.zxxx
.a.m.m.w
.sx.oab.-
.s.-.c.a.s
.c.o.c.$.mx
.s.s.+.tao.-
.s.m.a.dxxxxx

Content is empty.

Try it online, with rpxem!

Output

x
10
120
xxxx
xxxxx
xxxxxx
xxxxxxx
xxxxxxxx
xxxxxxxxx
xxxxxxxxxx
xxxxxxxxxxx
xxxxxxxxxxxx
xxxxxxxxxxxxx

With comments

Note that every LF is replaced with '?'.

x?.pXX.z # print'x', LF
.a?x.nXX.z # print LF.ord # two-digits
.a?.oXX.z # print LF
.a.n?.sXX.z
.a04x?.-.tXX.z # i = 4
.a.zXX.z # loop
  .a?.c.zxxx?.aXX.z # essentially nop
  .a.m.m.wXX.z # j = i; while j!=0
    .a?.sx.oXX.z # print'x'
    .aab.-?.s.-.cXX.z # j--
  .a.a.s?.c.oXX.z # end-while; print LF
  .a.c.$.mx?.s.s.+.tXX.z # i++
  .aao.-?.s.mXX.z # break if !(14>i)
.a.a.dxxxxx # end-loop; end program

Answered by nrgmsbki4spot1 on November 28, 2021

Factor, 34 26 bytes (7 6 lines)

-8 bytes / 1 line thanks to Bubbler!

 
10
  6
iota
  n^v
stack.

Try it online!

Output:

1
10
100
1000
10000
100000

Answered by Michael Chatiskatzi on November 28, 2021

Excel, 26 bytes

=
7^
(((
ROW(
1:6))
 ))&""

Spreadsheet

Below is 17 bytes but Excel removes the line feeds in the array after I hit enter and the output is right justified.

=
3^
{2;
4;6;
8;10}

Answered by Axuary on November 28, 2021

Java 8, 208 bytes

;
/*
who
they
are*/
public
class//
Main{//h
public //
static//14
void main//
(String[]ar)
{for(int i=0;
i<19;i++){for(
int j=0;j<i+1;j
++)  System.out.
//crucial comment
print('*');System.
out.println();}}}//

Try it online!

A triangular full program.

Answered by hakr14 on November 28, 2021

TeX, 188 bytes

Nothing out of the ordinary, but for completeness:

%
%%
%%%
%%%%
%%%%%
%%%%%%
%%%%%%%
%%%%%%%%
countdef
~=1%%%%%%%
countdef%%
i=26loop%%
advance~1{%%
loopadvance%
i1.ifnumi<~%
repeatendgraf}
ifnum~<18repeat
bye%%%%%%%%%%%%%%

Answered by plante on November 28, 2021

Deadfish~, 1 byte

o

Outputs

0

This is kind of cheating but I can't think of any other way to do it in Deadfish~.

Answered by emanresu A on November 28, 2021

PowerShell Core, 4 bytes

Trivial power (up to 19 lines)

1
10

Try it online!


PowerShell Core, 4 bytes

p–n junction (90 variants)

1
-1

Try it online!


PowerShell Core, 26 bytes

Twinkle, twinkle, little star

,
'*
*'*
6|%{
'*' *
++$ko}

Try it online!


PowerShell Core, 26 bytes

The magic number in nuclear physics and the quark soup of 3 quarks $_

,
1+
2..
6|%{
"$_"*
$_};$_

Try it online!

Answered by mazzy on November 28, 2021

PowerShell Core, 103 53 34 bytes

#
##
$n`
=1;`
$n..`
7|%{(`
$n*=9)}

A Powershell port of the R solution by Robin Ryder, thanks!

Try it online!

Previous attempt 2

Previous attempt 1

Answered by Julian on November 28, 2021

SmileBASIC 4, 3 bytes


?0

0
OK

Answered by BMF on November 28, 2021

Husk, 13 bytes

₁
¶₂
ΘI₃
↑3İ⁰

Try it online!

No comment characters, so every element does something...

₁       # run function on line 1 (next line)
¶₂      # split output of function on line 2 (next line)
ΘI₃     # prepend zero to identity of function on line 3 (next line)
↑3İ⁰    # first 3 elements of powers of 10

Husk, 1 byte

Trivial (but included for completeness)

1

Try it online!

(there are many more like this... all equally uninteresting...)

Answered by Dominic van Essen on November 28, 2021

05AB1E, 1 byte

Any one of 0123456789@NQXY_adg‹›¾ÊËåð will work. They will output one of 0123456789101120000000011 respectively.

Answered by Makonede on November 28, 2021

C Preprocessor, 65 bytes (10 lines)

.
..
...
....
.....
......
.......
........
.........
__TIME__//

Process with GCC/Clang with -E and -P options. (Thanks to Calculuswhiz for suggesting the -P option.)

All the dots are ignored. The predefined __TIME__ macro expands to a string of the form "HH:MM:SS", meaning the last line stays the same length.

Answered by RobertR on November 28, 2021

Excel Online, 53

9 lines

=
T(
12*
34)&
REPT(
0,ROW(
OFFSET(
A1,,,9))
)&TEXT(,)

How It Works

Kind of like my Google Sheets answer, but the bottleneck is the REPT() instead.

Sadly, I cannot break the function name from the open paren. Also, Excel Online does not auto-close, so we're stuck with an extra line. However, some nice things that did help were that Excel Online detects Array Formulas automatically, and it displays Array elements as separate rows, so I get a free line break.

Answered by Calculuswhiz on November 28, 2021

Google Sheets, 134

15 lines

=
T(
(--
CODE
("owo
(^_^;)
orz")))
&RIGHT(,
)&LEFT(,)
&MID(,1,)&
IF(LN(2),)&
ARRAYFORMULA
(JOIN(CHAR(10
),,REPT(0,ROW(
OFFSET(A1,,,15)

How It Works

Stall until we have a long enough line for ARRAYFORMULA, then catch up by generating 15 rows of an increasing number of 0's using REPT() and ROW(OFFSET()) and joining them together with JOIN(). Google Sheets will auto-close the missing parens.

Notes

  • Hey, look! No duplicate literals, no duplicate function calls, and no spaces. I could have strung together a bunch of ""&s, but that would be less entertaining.
  • The bottleneck here is ArrayFormula, so unless there's a way around that, I think we're stuck.

Answered by Calculuswhiz on November 28, 2021

33, 1 byte

o

Try it online!

o prints the value of the accumulator, which defaults to 0.

Bit boring, but what can you do about it.

Answered by TheOnlyMrCat on November 28, 2021

Perl 5, 53 bytes

A triangular quine.

$
_=
q{$
_='$
_='."
q{$_}"
.";eva"
.l;print
###};eval

Try it online!

Answered by Dom Hastings on November 28, 2021

TlanG, 152 bytes, outputs 405 bytes


n*
30'
*30#
1_11_
1*3_1*
4_1*5_1
*6_1*7_1
*8_1*9_1*
10_1*11_1*
12_1*13_1*1
4_1*15_1*16_
1*17_1*18_1*1
9_1*20_1*21_1*
22_1*23_1*24_1*
25_1*26_1*27####

Output has double the amount of lines compared to the code. I hope that gives me some points too. :)

I did this in my own language, but yea, im not coding in any challenge-related things, my language stays the same most of the time, although I do add new commands sometimes, but no hardcoded output.

The output is

1
11
111
1111
11111
111111
1111111
11111111
111111111
1111111111
11111111111
111111111111
1111111111111
11111111111111
111111111111111
1111111111111111
11111111111111111
111111111111111111
1111111111111111111
11111111111111111111
111111111111111111111
1111111111111111111111
11111111111111111111111
111111111111111111111111
1111111111111111111111111
11111111111111111111111111
111111111111111111111111111

Sorry for not having a Try it online, but im not that far with my lang.

Answered by Daniel H. on November 28, 2021

x86 machine code (32-bit), 43 bytes

As symbols in codepage 437:

`
!Q
!j
!Y_j
Q░x≤¬
'YX¬A╢
Ç∙ëq∞Çε
ê7af║█¡├

Hexdump:

600a
21510a
216a010a
21595f6a0a
51b078f3aa0a
275958aa41b60a
80f98971ec80ee0a
88376166badbadc3

A fastcall function which receives the pointer to output buffer in ecx. It fills the buffer with a triangle containing the letter x:

x
xx
xxx
xxxx
xxxxx
xxxxxx
xxxxxxx
xxxxxxxx

Disassembly:

10013FF0 60                   pushad  
10013FF1 0A 21                or          ah,byte ptr [ecx]  
10013FF3 51                   push        ecx  
10013FF4 0A 21                or          ah,byte ptr [ecx]  
10013FF6 6A 01                push        1  
10013FF8 0A 21                or          ah,byte ptr [ecx]  
10013FFA 59                   pop         ecx  
10013FFB 5F                   pop         edi  
10013FFC 6A 0A                push        0Ah  
10013FFE 51                   push        ecx  
10013FFF B0 78                mov         al,78h  
10014001 F3 AA                rep stos    byte ptr es:[edi]  
10014003 0A 27                or          ah,byte ptr [edi]  
10014005 59                   pop         ecx  
10014006 58                   pop         eax  
10014007 AA                   stos        byte ptr es:[edi]  
10014008 41                   inc         ecx  
10014009 B6 0A                mov         dh,0Ah  
1001400B 80 F9 89             cmp         cl,89h  
1001400E 71 EC                jno         again (10013FFCh)  
10014010 80 EE 0A             sub         dh,0Ah  
10014013 88 37                mov         byte ptr [edi],dh  
10014015 61                   popad  
10014016 66 BA DB AD          mov         dx,0ADDBh  
1001401A C3                   ret  

I used various instructions to insert a new-line byte 0A into the machine code:

10013FF1 0A 21                or          ah,byte ptr [ecx]  
10014009 B6 0A                mov         dh,0Ah  
10014010 80 EE 0A             sub         dh,0Ah  

At the end of the program, I needed to pad it with 4 bytes. I used a harmless MOV command instead of 4 NOPs so I could have hexadecimal BADBAD in code.

Answered by anatolyg on November 28, 2021

Stax, 4 bytes

2
mR

Run and debug it at staxlang.xyz!

Nontrivial solution. Prints "x01nx01x02", so you won't see any output, but it's there. One byte is easy but boring.

2     Push 2
mR    For n in [1,2], print [1..n] as a string

Another 4-byter that feels like cheating:

0     Do nothing
|?    Source of program, implicit print.

Answered by Khuldraeseth na'Barya on November 28, 2021

MAWP 0.1, 1 byte

:

Outputs top of stack, which is predefined as 1

Answered by Dion on November 28, 2021

C (gcc), 53 bytes


m
ain
(n){
for(;
9/n;n=
printf(
"%0*dn"
,n,0));;}

Try it online!

C (gcc), 53 bytes


m
ain
(n){
9/n&&
main(
printf(
"%0*dn"
,n,0));;}

Try it online!

Answered by l4m2 on November 28, 2021

Bash, 64 bytes


d
at
e +
d%n%
m%n%j
%n%Y%n
%R%n%:z
%n%7Y%n%
T%n%N%n%F

Try it online!

Not the shortest but kind of fancy. Displays current date in convinient format. Tried to do it locales intependent. Last byte for fancy too.

Answered by marcosm on November 28, 2021

PowerShell, 1 byte

0

Try it online ->
Very similar to other answers, shocked that no one posted this before.

Answered by HaxAddict1337 on November 28, 2021

Zsh, 34 bytes

:
r
ep
eat
 7 {:
s+=A;:
<<<$s;}

Try it online!

After re-joining lines:

:           # ':' is a no-op, just to fill space more visibly than ' '
repeat 7 {
    :
    s+=A
    :
    <<< $s
}

Answered by GammaFunction on November 28, 2021

SQL (Oracle) 88 76 Bytes

;
/*
ABC
DEFG
HIJ*/
SELECT
LPAD(1,
LEVEL,1)
FROM DUAL
CONNECT BY
LEVEL < 12;

Try it out

Output:

1
11
111
1111
11111
111111
1111111
11111111
111111111
1111111111
11111111111

Edit: Thanks @Math Junkie, by following the rules I actually cut off 12 bytes.

Answered by Del on November 28, 2021

dirt, 43 bytes

x
xx
xx|
|'a'
(a*'a
)**{1|
}.*|"11
11111"|x

run with with empty string as input:

>dirt triangle.dirt -i ""
a
aa
aaa
aaaa
aaaaa
aaaaaa
aaaaaaa
aaaaaaaa

Answered by cardboard_box on November 28, 2021

Java 10, 76 bytes (11 rows)

v
->
{//
 var
r="";
long i
=0,s=1;
for(;++i
<12;r+=(s
*=9)+"n")
;return r;}

Inspired by all the other answers.

Try it online.

Answered by Kevin Cruijssen on November 28, 2021

PHP, 43 bytes

;
1;
for
(;$i
++<8;
)echo(
10**$i-
1)."n";

Try it online!

Not that bad for PHP.. displays a triangle of "9"

Answered by Kaddath on November 28, 2021

05AB1E, 1 bytes

0

Try it online.

Not much to say I guess..


If this was instead, we could do something like this (can be made as arbitrary large as you'd want it to, as long as the last three bytes are ₄*»):

1
11
111
1111
11111
111111
1111111
11111111
111111111
1111111₄*»

Try it online.

Explanation:

1n11n111n...  # Push all these numbers one by one to the stack
111...111        # Push the number of the last line
₄*               # Multiply it by 1000 to increase its size by 3
»                # Join everything on the stack by newlines
                 # (after which it is output implicitly as result)

Answered by Kevin Cruijssen on November 28, 2021

Bash, 26 bytes

The dc command turns out to be quite useful in code-golfing.


d
c 
-e{
5..1
0}*p 

Try it online!

Answered by dingledooper on November 28, 2021

Befunge-98 (FBBI), 34 bytes

Outputs $ 9^k, 1 leq k leq 7 $.

v
8v
<v1
v< @
> 9*v
.^ >:
a,:|>1-

Try it online!

The first three lines

v
8v
<v1

push 8 (loop counter) and 1 ($ 9^0 $). The main loop can be written in a single line as

9*1-a,:!#@_:.
9*               multiply by 9
                swap to loop counter
   1-            subtract 1
     a,          output newline
       :!        duplicate and invert loop counter
         #@_     quit if non-zero, continue east otherwise
                swap to 9^k
             :.  duplicate and output 9^k

Try it online!

Answered by ovs on November 28, 2021

HQ9+, 1 byte

Q

Try it online!

Answered by S.S. Anne on November 28, 2021

Jelly, 1 byte

0

Try it online!


The vast majority of atoms can be used for this, printing 0 or 1. The few exceptions are listed as follows: (incomplete, didn't check past in the Atoms page)

  • ³⁴⁵⁹: prints more than one digit

  • ½°: prints 0.0

  • ~: prints -1

  • : prints n

  • ⁸IRḶṬẈ: prints nothing

  • MTZ: errors

  • Ɠƈɠ: interacts with STDIN

Borderline:

Answered by L. F. on November 28, 2021

Python 3, 64 53 bytes

#
##
###
for
i in
range
(1, 9):
 print(
'.' *i )#

Try it online!

Removed a line by pushing two lines into one last one, saved 11 bytes

Answered by Dion on November 28, 2021

Red, 53 bytes

;
t:
"*"
loop
( 9)[
print(
(( t)))
insert((
t))1 + 7]

Try it online!

Red, 76 64 bytes

;
s:
{t:
 "*"
 loop
(10)[p
rint(t)
insert(t
)"*"]}do
trim/all s

Try it online!

Answered by Galen Ivanov on November 28, 2021

Python 3, 53 bytes

#
##
###
for
i in
range(
9):####
 print(#
10**i)###

Try it online! Similar to dingledooper's submission. I was also going to submit:

brainfuck, 1 byte!!

.

Try it online! But S.S.Anne beat me by a couple of hours :)

Answered by RGS on November 28, 2021

C (gcc), 53 bytes

Fixed error pointed out by @S.S. Anne


m
ain
(n){
9<pr
intf(
"%dn",
n*=9)||
main(n);}

Try it online!

Answered by dingledooper on November 28, 2021

Bash + GNU utilities, 43 bytes


s
eq
 -f
'seq
 -s "
" %f' 
$[+8]|sh

Try it online!

I couldn't quite get this down to 7 rows; I needed to pad it by 4 bytes to fill out the 8-row triangle (that's why I have $[+8] in the code instead of just 8).


BSD Challenge!

If you take the same idea as the GNU solution above but use the BSD utility jot instead of seq, it's just one byte too long for a 7-row solution (which would be 34 bytes):

    
    j
    ot
     -w
    'jot
     -s "
    " ' 7|sh
# This is one byte too long for 7 rows :( .

If someone can see how to shave just 1 byte off this BSD version, that would get it down to a 7-row 34-byte solution.

Here's a TIO link to the BSD version if anybody wants to try their hand at eliminating that one last byte! This also works under OS X, if you have a Macintosh.

(Obviously this version, like the GNU version in my main answer above, can be padded to be another 8-row 43-byte solution, but that's not as interesting.)

Answered by Mitchell Spector on November 28, 2021

Erlang (escript), 76 bytes

f
()
->[
%%%%
%%%%%
string
:copies
("!", X)
++"n"||X
<- lists :
seq(1,11)].

Try it online!

Answered by user92069 on November 28, 2021

C# (Visual C# Interactive Compiler), 64 53 43 bytes

;
;;
int
s=1,
i;for
(;i++<
9;Print
(s*=9));

Simply prints the first several powers of 9.

Try it online!

Answered by the default. on November 28, 2021

Io, 43 bytes

A lot more "content" than my previous submissions.


 
  
for(
i,1,8
,(9**i
)     
println)

Try it online!

Answered by user92069 on November 28, 2021

Ruby, 34 bytes

(
##
1..
7)##
.map{
|x|p(#
9**x)}#

Try it online!

Answered by 79037662 on November 28, 2021

Canvas, 1 byte

Boring solution, just like everyone else. :)


Try it here!

Canvas, 4 bytes

Non-trivial attempt.

\
2\

Try it here!

Explanation

\    # Draw a diagonal, with nothing on the stack
      # Errors silently
      # Newline: A character not in the code page.
      # It basically does nothing.
2    # 2: Push 2 onto the stack
  \  # Draw a diagonal with a length of 2
      # Implicit output

Answered by user92069 on November 28, 2021

Clojure, 103 89 76 bytes

(
;;
;;;
loop
[i 9]
(when(
* i;;;;
99999999
)(println
i)(recur(*
i 9))));;;;

Try it online!

Prints the first 11 powers of 9. Exits with an ArithmeticException: integer overflow when trying to multiply $9^{12}$ by $99999999$.

Answered by math junkie on November 28, 2021

Keg, 1 byte

t

Try it online!

Sorry, it's a simple literal answer. But then again, all answers in Keg are going to be simple literal answers. Works because characters auto-push and auto-print.

Here's a script that will generate a triangular source code for any given n.

Answered by lyxal on November 28, 2021

dc, 4 bytes

B
1f

Try it online!

Explanation:

B   Push 11 on the stack.
1   Push 1 on the stack.
f   Print the items on the stack, starting at the top, each one with a terminal newline.

Answered by Mitchell Spector on November 28, 2021

Charcoal, 13 bytes

F
E⁺
.¦.
×⊕λ.

Try it online! Explanation: In Charcoal, newlines, which I will represent below with ¶, are simply parts of string literals.

F¶

Loop over the characters in the string literal .

E⁺¶.¦.¶

Concatenate the string literals ¶. and , loop over the characters, and print each result on its own line.

×⊕λ.

Repeat . by one more than the character index (0-indexed).

Answered by Neil on November 28, 2021

Retina, 1 byte

`

Try it online!

The backtick sets the configuration, which in this case is empty. By default, Retina outputs the number of matches of the regex on the input. In this case that regex is the empty string, so the output is 1

Answered by math junkie on November 28, 2021

JavaScript (ES7),  43  34 bytes

A triangle of 7 rows, filled with 0's.

f
=(
s=`
`)=>
s[7]?
'':0+s
+f(0+s)

Try it online!

Commented

f   // f is a recursive function
=(   // taking
s=`   // a string s initialized to
`)=>   // a linefeed
s[7]?   // if s has more than 7 characters,
'':0+s   // stop recursion; otherwise append a 0, followed by s,
+f(0+s)   // followed by the result of a recursive call with 0 + s

Answered by Arnauld on November 28, 2021

Python 2, 53 43 bytes

I think we are allowed to output different characters. Because of this, I simply printed $10^i$ at every iteration.

#
##
###
i=1;
exec
"prin
t i;i*
=10;"*8

Try it online!

Answered by dingledooper on November 28, 2021

Pyth, 1 byte

Z

Try it online!

In Pyth, Z is initialized to 0. Output is implicit so 0 will be printed


4 bytes

Z
T;

Try it online!

T is initialized to 10 and implicitly printed. ; is a no-op in this context.

Answered by math junkie on November 28, 2021

R, 34 bytes

#
d=
cat
d(9^
(1:7)
,sep="
")#####

Try it online!

Outputs $9^1$ to $9^7$:

9
81
729
6561
59049
531441
4782969

Answered by Robin Ryder on November 28, 2021

Perl 5, 66 54 53 19 bytes

#
##
use
####
Quine

I am submitting this as a joke because I did not even bother trying to write some optimized code. Instead, I am using a module from CPAN that causes the program to print itself.

The Quine.pm module can be found on CPAN and was released in January 2001, long before this question was posted here. So I assume that it is acceptable, as it seems to be the tradition in other Code Golf questions.

Edit 1: Saved 12 bytes by removing the semicolon after the use statement.

Edit 2: Thanks to Arnauld for pointing out that I did not need the final newline character, saving one byte.

Edit 3: Thanks to petStorm who made a great improvement by putting the use statement and the module name on separate lines, reducing the program to only 19 bytes. This exercise that started as a joke is now a very competitive entry. It would be difficult to do better in a non-obscure language (insert joke about Perl's readability here).

Answered by RaphaelQuinet on November 28, 2021

Answered by Shaggy on November 28, 2021

Haskell, 76 64 53 bytes

u
 =
 (9
 ^) 
 <$>[
 1..9]
main=  
 mapM_  
 print u 

Try it online!

This prints the first 9 powers of 9.

Answered by Grain Ghost on November 28, 2021

Wolfram Language (Mathematica), 43 bytes


"
"<
>".
"~Ta
ble~#
&/@Ran
ge [8*1]

Try it online!

Answered by ZaMoC on November 28, 2021

brainfuck, 1 byte

.

Outputs a single null byte.

Try it online!

Answered by S.S. Anne on November 28, 2021

C (gcc), 53 bytes

;
m
ain
(n){
9/pr
intf(
"%dn",
n)&&mai
n(n*10);}

Prints powers of 10.

Try it online!

Answered by S.S. Anne on November 28, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP