# Print 0 to 100 without 1-9 characters

Print integers 0 to 100 (inclusive) without using characters 123456789 in your code.

Separator of numbers can be comma or white space (by default <blank>, <horizontal tabulator>, <newline>, <carriage return>, <form feed> or <vertical tabulator>).

Shortest code wins.

• Many tricks are made possible by allowing 0. Which is what makes this challenge interesting, IMO. Commented Feb 23, 2021 at 17:08
• I thought "do X without Y" questions weren't allowed anymore. Commented Feb 24, 2021 at 3:34
• @PurpleP They're allowed, but discouraged. Interesting ones are fine. Commented Feb 25, 2021 at 0:06
• Is there a requirement to stop printing at 100? Commented Feb 25, 2021 at 16:44
• Can I use non-ASCII encoding?
– user100411
Commented Oct 17, 2021 at 20:36

# Pyt, 7 bytes

00⁺⁺ᴇŘÁ


Try it online!

0           push 0
0⁺⁺        push 0 and increment twice
ᴇ       10^2
Ř      push Řange (0,1,...,100)
Á     push contents of Árray to stack; implicit print


# Hebigo, 25 bytes

print: : :* range:ord:"e"


## Pascal, 94 B

This full program complies with ISO standards 7185 (“Standard Pascal”) and 10206 (“Extended Pascal”). The statement write(integerExpression) is automatically expanded to write(integerExpression:integerDefaultMinimumWidth). The value of integerDefaultMinimumWidth is implementation-defined. The following code requires that integerDefaultMinimumWidth ≥ 4 to ensure adequate number separation.

program p(output);var n:integer;begin n:=succ(succ(0));for n:=0 to sqr(n*n*n+n)do write(n)end.


70 B: Provided that the character 'd' has an (implementation-defined) ordinal value of 100 (like in ASCII) you can write:

program p(output);var c:char;begin for c:=''to'd'do write(ord(c))end.


Note, the first character literal '' is chr(0). It is assumed that '' does not denote an end-of-line character. Pascal specifically bans multi-line string/char literals.

6510 Assembler for C64 (159 Bytes)

*=$c000 a=0^0 b=a+a ldx #0 txa dex stx r+b stx w+b stx z+b stx p+b stx o+b stx y+b sec sbc 0 tay iny sty r+a sty w+a sty z+a sty p+a sty o+a sty y+a lda 0 lsr lsr tay dey sty s+a ldy 0 iny sty q+a sty t+a sty o-a tya iny sty p-a clc adc s+a sta x+a lda s+a clc adc s+a adc s+a tay iny iny sty z-a lda 0 asl tay iny iny iny iny iny iny sty c+a ldx #0 d txa q ldy #0 sec s sbc #0 bcc t iny bne s t cpy #0 beq u sta v+1 tya r jsr 0 v lda #0 u clc x adc #0 w jsr 0 lda #0 z jsr 0 inx c cpx #0 bne d lda #0 p jsr 0 lda #0 o jsr 0 y jmp 0  • Very good entry. Commented Nov 17, 2023 at 16:26 # COMMODORE 64 = 34 Bytes 0?B:B=B-(A=.):IFB<aS(" ")*πgO  Or without the keyword abbreviations: 0 PRINTB:B=B-(A=.):IFB<ASC(" ")*πGOTO  • I tidied up this entry to show the symbolic listings a bit better, and linked to the C64 Wiki for an explanation of Commodore BASIC Keyword Abbreviations. Commented Nov 17, 2023 at 16:25 # Hexagony, 19 bytes &!)')$0<.0.>.;/-{@_

In hexagon layout:

   & ! )
' ) \$ 0
< . 0 . >
. ; / -
{ @ _


Completely ungolfed:

    & ! ) {
. . . . .
. . . . . .
& ) 0 ; 0 ' -
. . . . . .
. . . . .
@ . . .


The solution works by maintaining an invariant at the beginning of each iteration that the current memory cell zero or negative (current number - 100 on all iterations except the first one) and the cell to the left is the current number.

• &! copies current number from the cell to the left (due to the memory invarant) and prints it

• ) increments current cell, so it will be current number for the next iteration

• { moves to the memory cell to the left, pointing towards two cells with zeros

• & copies zero from one of those cells into current cell

• )0; sets current cell value to 10 (ascii code for newline) and prints it

• 0 sets current cell value to 100 = 10 * 10 + 0

• ' moves to the memory cell to the back right without turning memory pointer around, so now it points towards next number to the left and 100 to the right.

• - computes next number - 100

• Finally pointer leaves the right corner while moving to the right, so it wraps around to the top row if next number - 100 is zero or negative, or to the bottom row otherwise where it terminates at @.

Golfed solution fits everything into a hexagon with side 3 by taking advantage of changing instruction pointer's direction, grid wrapping and idempotency of - operator.

I don't know if a solution with side 2 (7 cells) is possible, but this solutions uses 9 different operators without counting the ones that control direction, so it definitely won't fit. A more optimal side 3 solution might also be possible.

• Welcome to Code Golf! This is an excellent answer, with a great explanation of the workings. I hope to see more from you in future! Commented Nov 19, 2023 at 12:48

# Setanta, 57 43 bytes

−14 bytes using Uiua’s approach.

p:=pi@mata le i idir(0,p*p*p*p+p)scriobh(i)


try-setanta.ie link

# UiuaSBCS, 8 6 bytes

⇡-@J@¯


Try it here!

Creates an array of all the numbers less than the difference of J and ¯ in codepoints, or 101.

# Python 3, 33 bytes

for x in range(ord("e")):print(x)


# Elixir, 26 bytes

for x<-0..?d,do: IO.puts x


Try it online!

# Batch, 56 bytes

@set/ax=0xb-0xa
@for /l %%b in (0,%x%,%x%00)do @echo %%b


-61 bytes for @Neil

• You can just use set/ax=0xb-0xa to set x etc.
– Neil
Commented Feb 23, 2021 at 17:01
• @Neil edited thanks Commented Feb 23, 2021 at 17:53
• Actually you don't need y at all, just use %x%00 in its place.
– Neil
Commented Feb 23, 2021 at 17:54
• Also, some general Batch golfing tips: you don't need the space in set/a or )do, and you can remove the @echo off and use @set, @for and @echo instead.
– Neil
Commented Feb 23, 2021 at 17:56
• @Neil thanks! for that Commented Feb 23, 2021 at 17:58

# Red, 36 bytes

repeat n 0 +#"e"[print n +#"a"-#"b"]


Try it online!

# C (gcc), 40 39 bytes

Saved a byte thanks to att!!!

f(i){for(i=0;i<'e';)printf("%d ",i++);}


Try it online!

• 39 bytes
– att
Commented Feb 23, 2021 at 18:31
• @att Nice one - thanks! :D Commented Feb 23, 2021 at 18:50

# C++ gcc, 36 bytes

Try it online!

main(){for(;_<'e';)cout<<_++<<'\n';}


Explanation : I globally initialized varible _ so its initial value is 0, now ascii value of e is 101 so I ran the loop till my variable _ is less than 'e', instead of incrementing it inside the for loop I used post increment while printing to save 1 byte

edit: I misread the question and thought 0 is also not allowed :)

• Could you explain the code please?
– user7467
Commented Oct 14, 2021 at 16:41
• @Anush I have added explanation, hope it helps. Commented Oct 14, 2021 at 16:51
• Do you know what this would be in C?
– user7467
Commented Oct 14, 2021 at 20:46
• You'll have to include the _ declaration with the code I'm afraid, since it won't work without it. I'm not familiar with C++ golfing, but I believe you'd have to include the rest of the boilerplate, since this is a full program
– Jo King
Commented Oct 16, 2021 at 8:59

# APL, 13 bytes

0,⍳⍎'00',⍨⍕*0


*0 ⍝ Exponential of zero = 1
⍕ ⍝ Convert to symbol '1'
'00',⍨ ⍝ Append two zeros
⍎ ⍝ Convert to number 100
⍳ ⍝ Make sequence from 1 to 100
0, ⍝ Append zero to the left

# Rust, 35 bytes

||for c in 0..b'e'{println!("{c}")}


Attempt This Online!

# C# .NET 4.7.2

With 0, 47 bytes

for(int i=0;i<=0xA*0xA;)Console.WriteLine(i++);


Without 0, 59 bytes

for(int i='a'-'a',j='r'-'@';i<=j+j;)Console.WriteLine(i++);


# Commodore C64 BASIC (THEC64, Ultimate64) 36 PETSCII characters

This can be done as a zero liner in direct mode in Commodore C64 BASIC. It relies on the default value of memory location zero being 47, so this will produce different results on other Commodore machines even though the have the same or a very similar interpreter, and the results will be different on the C128 in C64 mode too in some cases. The screen shot shows a proper representation, but {PI} is the PETSCII Pi symbol in my example, and upper case letters are shifted PETSCII graphics for keyword abbreviations.

x%={PI}+{PI}:fOi=.topE(.)+pE(.)+x%:?i;:nE


Commodore 64 = 27 Bytes

0FORO=.TO{PI}+{PI}*{PI}*{PI}*{PI}:PRINTO;:NEXT


# Scratch, 104 bytes

Try it on Scratch!

Requires list x to be visible, which is the norm by default on creation.

define
delete all of[x v
repeat(join(<not<>>+())(join(()+())(()+(
add((item[last]of[x v])+<not<>>)to[x v


# COMMODORE 64 (improved version) = 25 Bytes

0fOI=ATOA♥("-"):?I:nE

0 FORI=ATOASC("-"):PRINTI:NEXT

"-" = Character 100

To get the correct character in the code you have to poke it in first with POKE2061,100.

• You can edit your entries with improved versions that have fewer bytes, leaving your old answer below. Please consider formatting your answers as the standard used by other answers. Commented Nov 17, 2023 at 16:30

# vemf, 5 bytes

0,│d↨


cancats 0 and the integers on [1, 100]

# Brachylog, 9 bytes

{ẉ₂<}ⁱ¹⁰¹


Try it online!

Technically this doesn’t use 1 or 2, but rather ¹ and ² :)

### Explanation

{   }ⁱ¹⁰¹     Iterate 101 times
ẉ₂           Print the input (implicitely 0 for the first iteration)
<          Input of the next iteration > current Input