17
\$\begingroup\$

Print 0 to 100 without using characters 1,2,3,4,5,6,7,8,9 in your code.

Seperator of numbers can be comma, whitespace or newline.

Shortest code wins.

New contributor
Daemon is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
\$\endgroup\$
5
  • 1
    \$\begingroup\$ Nice first question, try to post questions in the sandbox, before posting them to the actual website, for feedback! \$\endgroup\$ – EliteDaMyth yesterday
  • \$\begingroup\$ @EliteDaMyth thanks, not my first question though \$\endgroup\$ – Daemon yesterday
  • 7
    \$\begingroup\$ Well, the first question you posted had -5 score, so i was considering this to be your first question. \$\endgroup\$ – EliteDaMyth yesterday
  • 2
    \$\begingroup\$ Many tricks are made possible by allowing 0. Which is what makes this challenge interesting, IMO. \$\endgroup\$ – Arnauld yesterday
  • \$\begingroup\$ I thought "do X without Y" questions weren't allowed anymore. \$\endgroup\$ – Purple P 16 hours ago

51 Answers 51

38
\$\begingroup\$

R, 9 bytes

F:volcano

Try it online!

The sequence operator : coerces its arguments to integers. F is the boolean FALSE, which gets coerced to 0. volcano is one of the many built-in datasets (it gives topographic information about Maunga Whau in New Zealand); since it is a matrix, : fetches the value at position [1, 1] which is luckily equal to 100. The code is therefore equivalent to 0:100.

This answer was inspired by a conversation with Giuseppe and Kirill L. in the comments under Giuseppe's R answer.

\$\endgroup\$
6
  • 3
    \$\begingroup\$ I thought Mathematica had weird builtins. Why is volcano specifically about Maunga Whau in New Zealand? \$\endgroup\$ – caird coinheringaahing yesterday
  • 2
    \$\begingroup\$ @cairdcoinheringaahing This dataset was digitized by Ross Ihaka, a New Zealand statistician and one of the creators of R, who then included it in R as a good example for a contour map. I don't know why he chose that volcano; maybe he lived nearby, or maybe that was just the first map he found! \$\endgroup\$ – Robin Ryder 23 hours ago
  • \$\begingroup\$ @cairdcoinheringaahing The number of built-ins in R is still way lower than in Mathematica, of course! \$\endgroup\$ – Robin Ryder 23 hours ago
  • \$\begingroup\$ One more golf you might be able to do: a:b will create the vector c(a,a+1,a+2,...,a+k) where a+k<=b, so 0:2.5 will yield 0 1 2. Hence if you can find a short-named dataset that starts with/easily computes to 100.x then you can potentially get a shorter answer. \$\endgroup\$ – Giuseppe 21 hours ago
  • 1
    \$\begingroup\$ @Giuseppe I tried that, but volcano is the only dataset whose first entry is in \$[100, 101)\$. Using anything else than the first entry leads to at least 9 bytes, even for a dataset with a 3-character name (e.g. sum(BOD) or npk[pi], which don't give 100 anyway). I don't think it can get shorter using this approach. \$\endgroup\$ – Robin Ryder 13 hours ago
11
\$\begingroup\$

Python 3: 27 23 20 Bytes

Thanks to caird coinheringaahing for -4 bytes, ovs for -3 bytes

print(*range(*b'e'))

I'm pretty poor at golfing, so there's probably a better way to do this.

TIO

\$\endgroup\$
11
  • \$\begingroup\$ 23 bytes \$\endgroup\$ – caird coinheringaahing yesterday
  • 1
    \$\begingroup\$ Hey @DonThousand, I accidentally downvoted your submission, my bad, i was upvoting, but it was a misclick, i have fixed my mistake, sorry again. \$\endgroup\$ – EliteDaMyth yesterday
  • 1
    \$\begingroup\$ You can replace ord('e') with *b'e' for -3 bytes. \$\endgroup\$ – ovs yesterday
  • 5
    \$\begingroup\$ Strings with a leading b are objects of type bytes, which behave like lists of integers in many ways. This is doing the same as range(*[101]). \$\endgroup\$ – ovs yesterday
  • 1
    \$\begingroup\$ Byte strings have special iteration built-in to them. This code snippet should help clarify: for char in b'hello': print(char) \$\endgroup\$ – User 12692182 yesterday
7
\$\begingroup\$

Jelly, 2 bytes

³Ż

Try it online!

Outputs a list. If the separator must be a single character, 3 bytes

How it works

³ŻK - Main link. Takes no arguments
³   - Yield 100
 Ż  - Range from 0 to 100
  K - Join by spaces (optional)
\$\endgroup\$
8
  • \$\begingroup\$ wtf happens here xD \$\endgroup\$ – azro yesterday
  • \$\begingroup\$ @azro Added an explanation \$\endgroup\$ – caird coinheringaahing yesterday
  • \$\begingroup\$ What the ....??? What on earth is this language? (goes lookup Jelly) \$\endgroup\$ – Erwin Moller 9 hours ago
  • \$\begingroup\$ @ErwinMoller No need to look it up, just click the link in the Header to visit the GitHub page! :) \$\endgroup\$ – caird coinheringaahing 9 hours ago
  • 1
    \$\begingroup\$ @MartinBraun In most challenges (I.e. those more complex than this), creating a competitive answer in a golfing language is just as difficult as doing so in a “real” language. You’ll see that I helped golf the Python answer just above (sorting by votes), and I can tell you that was just as simple as writing this answer \$\endgroup\$ – caird coinheringaahing 4 hours ago
7
\$\begingroup\$

Retina 0.8.2, 33 26 24 bytes


,,

,,,,,,
,
,,,,,

$.`

Try it online! Explanation: The first stage inserts two commas, which the second stage increases to 20 (it's complicated). The third stage multiplies by 5 to give 100. The last stage then inserts the number of commas so far at each position.

\$\endgroup\$
3
  • \$\begingroup\$ Nice! You can golf it a bit by computing 100 as 4*5*5 tio.run/##K0otycxL/P@fSwcIuHTAFILmUtFL@P8fAA \$\endgroup\$ – Leo 22 hours ago
  • 1
    \$\begingroup\$ @Leo You should have used 0514150 commas for a nice symmetry! \$\endgroup\$ – Neil 20 hours ago
  • 1
    \$\begingroup\$ @Leo (Although as it happens I found a shorter solution, which I then verified using a Python script. The only other solution with the same length simply has the first two stages swapped.) \$\endgroup\$ – Neil 20 hours ago
6
\$\begingroup\$

GNU Octave, 14, 5 bytes

0:'d'

TIO by Giuseppe

\$\endgroup\$
3
  • \$\begingroup\$ I think just 0:'d' should work. \$\endgroup\$ – Giuseppe yesterday
  • \$\begingroup\$ @Giuseppe: nice one \$\endgroup\$ – Thor yesterday
  • 2
    \$\begingroup\$ Also, Octave is on TIO if you want to add a link :-) \$\endgroup\$ – Giuseppe yesterday
6
\$\begingroup\$

Ruby 22 bytes 12 bytes - thanks to @manatwork

p *0..?d.ord

Try it online!

\$\endgroup\$
3
  • 1
    \$\begingroup\$ A splat * operator will do it instead of .to_a: p *0..?d.ord \$\endgroup\$ – manatwork yesterday
  • \$\begingroup\$ thanks @manatwork \$\endgroup\$ – EliteDaMyth yesterday
  • \$\begingroup\$ You can switch to Ruby 1.8 and remove the .ord \$\endgroup\$ – pxeger yesterday
6
\$\begingroup\$

JavaScript (V8), 28 bytes

We cannot write \$100\$ or \$101\$ in hexadecimal with 0's and letters only (0x64 and 0x65 respectively), but we can write \$202\$ (0xCA) and use \$2n<202\$ as the condition of the for loop.

for(n=0;n+n<0xCA;)print(n++)

Try it online!


30 bytes

This version computes \$10^2\$ with the hexadecimal representation of \$10\$.

for(n=0;n<=0xA*0xA;)print(n++)

Try it online!


31 bytes

This version builds the string "100".

for(n=0;n<=-~0+'00';)print(n++)

Try it online!

\$\endgroup\$
0
6
\$\begingroup\$

Raku, 10 bytes

put 0..Ⅽ

Try it online!

here is the Unicode character ROMAN NUMERAL ONE HUNDRED.

Any other Unicode character with a defined value of 100 could be used:

௱: TAMIL NUMBER ONE HUNDRED
൱: MALAYALAM NUMBER ONE HUNDRED
፻: ETHIOPIC NUMBER HUNDRED
ⅽ: SMALL ROMAN NUMERAL ONE HUNDRED
佰: CJK UNIFIED IDEOGRAPH-4F70
百: CJK UNIFIED IDEOGRAPH-767E
陌: CJK UNIFIED IDEOGRAPH-964C

All are three UTF-8 bytes long, like .

\$\endgroup\$
3
  • \$\begingroup\$ Anytime you have 0..foo, you can use ^foo. So you can get 8 bytes with put ^Ⅽ \$\endgroup\$ – user0721090601 17 hours ago
  • \$\begingroup\$ @user0721090601 Incorrect. ^foo is the same as 0..(foo-1), not 0..foo. \$\endgroup\$ – Sean 16 hours ago
  • \$\begingroup\$ Ack, duh. Ignore me \$\endgroup\$ – user0721090601 16 hours ago
6
\$\begingroup\$

R, 11 bytes

F:(0xA*0xA)
F:0xA^(T+T)

Try it online!

Uses this tip.

Still being beaten by some volcano in New Zealand, though...

Old answer:

R, 16 bytes

F:paste0(+T,0,0)

Try it online!

Thanks to Kirill L. for correcting an error.

R's ASCII=>byte function is utf8ToInt, which unfortunately has an 8 in it. Luckily, : will attempt to coerce its arguments to numeric types, so we construct 100 by pasting together +F (which coerces its value to 0) and two 0s. This would also work, though longer, without a 0 as F:paste(+T,+F,+F,sep="").

Possibly there's a very short builtin dataset with a sum that's close to 100, though I haven't been able to find one.

\$\endgroup\$
8
  • \$\begingroup\$ I believe according to the task, you should start with F rather than T. \$\endgroup\$ – Kirill L. yesterday
  • \$\begingroup\$ 9 bytes (but yours is much more elegant!) \$\endgroup\$ – Robin Ryder yesterday
  • \$\begingroup\$ @KirillL. oh yes, my mistake. Thanks. \$\endgroup\$ – Giuseppe yesterday
  • \$\begingroup\$ @RobinRyder I guess with Kirill's correction, that one won't quite work, although seq(0,a=Nile) is close. Feel free to post that approach yourself if you can fix it! \$\endgroup\$ – Giuseppe yesterday
  • 2
    \$\begingroup\$ @Giuseppe, yeah, but F:sum(T|Nile) is still only 13 bytes. \$\endgroup\$ – Kirill L. yesterday
5
\$\begingroup\$

Bash, 25 23 bytes

seq 0 $(printf %d "'d")

Try it online!

-2 thanks to @manatwork

\$\endgroup\$
5
  • 5
    \$\begingroup\$ Using $(..) is good coding habit, but is longer than `..`. And no need to quote ”%d” as contains nothing special. In change the “'d” contains character with special meaning, but only one, so escaping it with \ is shorter. Try it online! \$\endgroup\$ – manatwork yesterday
  • 1
    \$\begingroup\$ What is happening with the 'd? I assume printf is interpreting it as its ascii numeric value but I don't see it mentioned in the docs. \$\endgroup\$ – Jonah yesterday
  • \$\begingroup\$ @manatwork thanks! \$\endgroup\$ – Wasif yesterday
  • 1
    \$\begingroup\$ How weird, @Jonah. I can't find where I learned about that feature. Only found in the printf specification's Examples section. Maybe Wasif knows a better documentation. \$\endgroup\$ – manatwork yesterday
  • 1
    \$\begingroup\$ @Jonah found it few days ago here, Actually I don't know a lot of documentation on bash \$\endgroup\$ – Wasif yesterday
4
\$\begingroup\$

Powershell, 18 bytes

0..[byte][char]'d'
\$\endgroup\$
4
  • 1
    \$\begingroup\$ -5 bytes Try it online! \$\endgroup\$ – Zaelin Goodman yesterday
  • \$\begingroup\$ -9 bytes Try it online! \$\endgroup\$ – Julian 23 hours ago
  • \$\begingroup\$ @ZaelinGoodman, Julian for some unknown reason I can't access TIO, I will update as soon as I can go, thanks! \$\endgroup\$ – Wasif 13 hours ago
  • \$\begingroup\$ @Julian Wow, nice one!! \$\endgroup\$ – Zaelin Goodman 7 hours ago
4
\$\begingroup\$

APL(Dyalog Unicode), 8 bytes SBCS

⍳⎕UCS'e'

Try it on APLgolf!

A tradfn submission which prints with space separator.

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

Husk, 4 bytes

ŀc'e

Try it online!

Surprised Husk doesn't have a builtin for 100.

How it works

ŀc'e - Main function, no arguments
  'e - Character literal "e"
 c   - Convert to charcode; 101
ŀ    - Lowered range; [0, 1, ..., 100]
\$\endgroup\$
4
\$\begingroup\$

PowerShell, 16 12 bytes

-4 bytes thanks to @mazzy!

0..(0xa*0xa)

Try it online!

\$\endgroup\$
2
  • \$\begingroup\$ Try it online! \$\endgroup\$ – mazzy 22 hours ago
  • \$\begingroup\$ @mazzy thanks! I feel silly for having missed that, lol \$\endgroup\$ – Zaelin Goodman 3 hours ago
4
\$\begingroup\$

Zsh, 16 bytes

echo {0..$[##d]}

Try it online!

Only builtins, so no seq


For fun, here's a 17 byte answer without 0:

echo {$?..$[##d]}

Try it online!

Also $! or $# will work as 0 replacements.

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

jq, 20 characters

range("e"|explode[])

Sample run:

bash-5.0$ jq -n 'range("e"|explode[])' | head
0
1
2
3
4
5
6
7
8
9

Try it online!

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

Bash, 15 bytes

seq `dc<<<A0Kf`

Try it online!

  • 1 byte saved, thanks to @manatwork.

Previous answer:

Bash + GNU utils, 20

seq 0 inf|sed /.../q

Count from zero to infinity, but stop after the first 3-digit number.

Try it online!


Pure Bash - no external utilities, 32 bytes

a=(a {a..j}{a..j})
echo ${!a[@]}

Try it online!

\$\endgroup\$
6
  • \$\begingroup\$ Your newest solution skips “0” because you missed a space between seq's parameters. Sorry, that looks like +1 character. ☹ \$\endgroup\$ – manatwork yesterday
  • \$\begingroup\$ @manatwork oops - yes, thanks - fixed. \$\endgroup\$ – Digital Trauma 23 hours ago
  • 1
    \$\begingroup\$ As apology, here is a 15 character one, still based on your idea: seq `dc<<<A0Kf`. \$\endgroup\$ – manatwork 23 hours ago
  • \$\begingroup\$ @manatwork - thanks! \$\endgroup\$ – Digital Trauma 23 hours ago
  • 1
    \$\begingroup\$ @Downvoter - please explain how I may improve this answer. \$\endgroup\$ – Digital Trauma 23 hours ago
3
\$\begingroup\$

dc, 14 characters

Thanks to

  • Digital Trauma for the twist in using the stack depth efficiently (-2 characters)
[zpzA0!<m]dsmx

Try it online!

dc, 16 characters

0[pz+dA0>i]dsixp

Sample run:

bash-5.0$ dc -e '0[pz+dA0>i]dsixp' | head
0
1
2
3
4
5
6
7
8
9

Try it online!

\$\endgroup\$
2
  • \$\begingroup\$ Similar idea, same score \$\endgroup\$ – Digital Trauma 23 hours ago
  • 1
    \$\begingroup\$ Thanks @DigitalTrauma. I tried that too earlier, but only now, seeing your suggestion I found the more efficient way. \$\endgroup\$ – manatwork 23 hours ago
3
\$\begingroup\$

Vyxal, jH, 1 byte

ʀ

Try it Online!

Flags for the win. The H flag presets the stack to 100, generate range 0 to 100 and then j flag joins on newlines. The flag was around before this challenge too.

\$\endgroup\$
2
  • \$\begingroup\$ This seems to give the wrong output \$\endgroup\$ – Anush 22 hours ago
  • \$\begingroup\$ @Anush its fixed \$\endgroup\$ – Lyxal 18 hours ago
3
\$\begingroup\$

Perl, 20, 13, 12, 16 bytes

say for 0..ord d 

Try it online!

\$\endgroup\$
6
  • \$\begingroup\$ You can get rid of $,=",";, but you need ord('d') for it to work. \$\endgroup\$ – Paul Picard yesterday
  • \$\begingroup\$ @PaulPicard: unquoted dee works here (perl v5.32.0), e.g. perl -E 'say 0..ord(d)' \$\endgroup\$ – Thor yesterday
  • 1
    \$\begingroup\$ You can remove the parenthesis. \$\endgroup\$ – manatwork yesterday
  • \$\begingroup\$ Without the comma, this doesn't meet the challenge specification to have a separator between numbers. say for 0..ord d would meet the rules. \$\endgroup\$ – Xcali 20 hours ago
  • \$\begingroup\$ @Xcali: indeed, thanks \$\endgroup\$ – Thor 15 hours ago
3
\$\begingroup\$

Deadfish~, 2071 / 8 / 7 bytes

2071 bytes

o{i}c{d}io{i}dc{d}iio{i}ddc{d}iiio{i}dddcddddddoiiiiiicdddddoiiiiicddddoiiiicdddoiiicddoiicdoicociodciioddciiiodddciiiioddddciiiiiodddddciiiiiioddddddc{i}dddo{d}iiic{i}ddo{d}iic{i}do{d}ic{i}o{d}c{i}io{d}dc{i}iio{d}ddc{i}iiio{d}dddc{i}iiiio{d}ddddc{i}iiiiio{d}dddddc{i}iiiiiio{d}ddddddc{i}{i}dddo{d}{d}iiic{i}{i}ddo{d}{d}iic{i}{i}do{d}{d}ic{i}{i}o{d}{d}c{i}{i}io{d}{d}dc{i}{i}iio{d}{d}ddc{i}{i}iiio{d}{d}dddc{i}{i}iiiio{d}{d}ddddc{i}{i}iiiiio{d}{d}dddddc{i}{i}iiiiiio{d}{d}ddddddc{i}{i}{i}dddo{d}{d}{d}iiic{i}{i}{i}ddo{d}{d}{d}iic{i}{i}{i}do{d}{d}{d}ic{i}{i}{i}o{d}{d}{d}c{i}{i}{i}io{d}{d}{d}dc{i}{i}{i}iio{d}{d}{d}ddc{i}{i}{i}iiio{d}{d}{d}dddc{i}{i}{i}iiiio{d}{d}{d}ddddc{i}{i}{i}iiiiio{d}{d}{d}dddddc{i}{i}{i}iiiiiio{d}{d}{d}ddddddc{{i}dddddd}dddo{{d}iiiiii}iiic{{i}dddddd}ddo{{d}iiiiii}iic{{i}dddddd}do{{d}iiiiii}ic{{i}dddddd}o{{d}iiiiii}c{{i}dddddd}io{{d}iiiiii}dc{{i}dddddd}iio{{d}iiiiii}ddc{{i}dddddd}iiio{{d}iiiiii}dddc{{i}dddddd}iiiio{{d}iiiiii}ddddc{{i}dddddd}iiiiio{{d}iiiiii}dddddc{{i}dddddd}iiiiiio{{d}iiiiii}ddddddc{{i}ddddd}dddo{{d}iiiii}iiic{{i}ddddd}ddo{{d}iiiii}iic{{i}ddddd}do{{d}iiiii}ic{{i}ddddd}o{{d}iiiii}c{{i}ddddd}io{{d}iiiii}dc{{i}ddddd}iio{{d}iiiii}ddc{{i}ddddd}iiio{{d}iiiii}dddc{{i}ddddd}iiiio{{d}iiiii}ddddc{{i}ddddd}iiiiio{{d}iiiii}dddddc{{i}ddddd}iiiiiio{{d}iiiii}ddddddc{{i}dddd}dddo{{d}iiii}iiic{{i}dddd}ddo{{d}iiii}iic{{i}dddd}do{{d}iiii}ic{{i}dddd}o{{d}iiii}c{{i}dddd}io{{d}iiii}dc{{i}dddd}iio{{d}iiii}ddc{{i}dddd}iiio{{d}iiii}dddc{{i}dddd}iiiio{{d}iiii}ddddc{{i}dddd}iiiiio{{d}iiii}dddddc{{i}dddd}iiiiiio{{d}iiii}ddddddc{{i}ddd}dddo{{d}iii}iiic{{i}ddd}ddo{{d}iii}iic{{i}ddd}do{{d}iii}ic{{i}ddd}o{{d}iii}c{{i}ddd}io{{d}iii}dc{{i}ddd}iio{{d}iii}ddc{{i}ddd}iiio{{d}iii}dddc{{i}ddd}iiiio{{d}iii}ddddc{{i}ddd}iiiiio{{d}iii}dddddc{{i}ddd}iiiiiio{{d}iii}ddddddc{{i}dd}dddo{{d}ii}iiic{{i}dd}ddo{{d}ii}iic{{i}dd}do{{d}ii}ic{{i}dd}o{{d}ii}c{{i}dd}io{{d}ii}dc{{i}dd}iio{{d}ii}ddc{{i}dd}iiio{{d}ii}dddc{{i}dd}iiiio{{d}ii}ddddc{{i}dd}iiiiio{{d}ii}dddddc{{i}dd}iiiiiio{{d}ii}ddddddc{{i}d}dddo{{d}i}iiic{{i}d}ddo{{d}i}iic{{i}d}do{{d}i}ic{{i}d}o{{d}i}c

Try it online!

8 bytes (if you consider Hello, world! a valid separator)

o{{iow}}

Try it online!

7 bytes (If you don't care about seperators)

o{{io}}

Try it online!

Never thought I'd see deadfish be shorter than, well, anything except Unary.

\$\endgroup\$
3
  • \$\begingroup\$ Damn it. Rewriting. \$\endgroup\$ – A username 16 hours ago
  • \$\begingroup\$ @Razetime Remebered w doesn't care about accumulator. \$\endgroup\$ – A username 16 hours ago
  • \$\begingroup\$ "Hello, World!" is not a valid separator. \$\endgroup\$ – pppery 16 hours ago
3
\$\begingroup\$

brainfuck, 138 bytes

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

Try it online!

No numbers is pretty easy, but the golf size is not great... :)

I am sure it can be improved, I am really a beginner in using Brainfuck. I wanted to try it anyway.

How it works:

>>++++++++++<<                LF Char (idx2)
++++++[>>>++++++++<<<-]       Zero char tens (idx3)
++++++[>>>>++++++++<<<<-]     Zero char unit (idx4)
+++++ +++++                   10 counter (tens)
>+++++ +++++<                 10 counter (unit)
[>                            Move to the counter
  [>>.                        Print the tens
    >.+                       Print the unit and increment
     <<.                      Print the LF
       <-]                    Loop 10 times
+++++ +++++                   Restore the counter
>>>----- -----                Restore the digit
  <+                          Increment the tens char
    <<<-]                     Loop everything 10 times
>>>>+.-..                     Print 100 using a cell which is already at char 0
New contributor
Redy000 is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
\$\endgroup\$
1
  • \$\begingroup\$ Welcome to the site, and nice first answer! \$\endgroup\$ – caird coinheringaahing 10 hours ago
2
\$\begingroup\$

Javascript - 50 bytes

for(a of Array("d".charCodeAt()).keys())alert(++a)

Can be shorter, if you allow in reverse (36 chars)

for(i="e".charCodeAt();--i;)alert(i)
\$\endgroup\$
2
\$\begingroup\$

Javascript (Browser), 53 46 37 33 bytes

for(n=0;++n<+atob`MTAx`;)alert(n)

-15 bytes thanks to @EliteDaMyth

\$\endgroup\$
5
  • \$\begingroup\$ change the parseInt() to +atob`MTAx` for 11 bytes \$\endgroup\$ – EliteDaMyth yesterday
  • \$\begingroup\$ @EliteDaMyth thanks for that! \$\endgroup\$ – Wasif yesterday
  • \$\begingroup\$ also @Wasif you dont need the curly braces after the for loop. and you can change the way the for loop works, by incrementing, while checking, i.e. for(n=0;++n<+atob`MTAx`;)alert(n) this is 33 bytes \$\endgroup\$ – EliteDaMyth yesterday
  • \$\begingroup\$ @EliteDaMyth thanks again! \$\endgroup\$ – Wasif yesterday
  • 2
    \$\begingroup\$ you don't need the + in front of atob`MTAx`; \$\endgroup\$ – Wezl yesterday
2
\$\begingroup\$

J, 12 bytes

a.i.@i.'e'"_

Try it online!

\$\endgroup\$
2
\$\begingroup\$

Zsh, 12 bytes

seq 0 $[##d]

Try it online!

  • seq: count
    • from 0
    • $[##d]: to the character value of d
\$\endgroup\$
2
\$\begingroup\$

05AB1E, 2 bytes

тÝ

Try it online!

Outputs a list. If the separator must be a single character, 3 bytes

How it works

тÝ» - Full program
т   - Push 100
 Ý  - Range from 0 to 100
  » - Join with newlines (optional)
\$\endgroup\$
2
\$\begingroup\$

Julia 1.0, 19 bytes

println.(0:0xA*0xA)

Try it online!

\$\endgroup\$
2
\$\begingroup\$

F# (.NET Core), 35 bytes

Seq.iter(printfn"%A"){0..(int 'd')}

Try it online!

(Too bad it wasn't only to 99, could have gotten rid of the Seq.iter due to printing truncation...)

\$\endgroup\$
2
\$\begingroup\$

C (gcc), 38 bytes

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

Try it online!

Without using digit 0, it would be 39 bytes: i;main(){for(;printf("%d ",i++)&'#';);}

\$\endgroup\$

Your Answer

Daemon is a new contributor. Be nice, and check out our Code of Conduct.

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

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