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.
180 Answers 180
R, 9 bytes
F:volcano
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.
-
15\$\begingroup\$ I thought Mathematica had weird builtins. Why is
volcanospecifically about Maunga Whau in New Zealand? \$\endgroup\$2021年02月23日 20:27:18 +00:00Commented Feb 23, 2021 at 20:27 -
14\$\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– Robin Ryder2021年02月23日 20:58:09 +00:00Commented Feb 23, 2021 at 20:58
-
3\$\begingroup\$ @Giuseppe I tried that, but
volcanois 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)ornpk[pi], which don't give 100 anyway). I don't think it can get shorter using this approach. \$\endgroup\$Robin Ryder– Robin Ryder2021年02月24日 07:08:03 +00:00Commented Feb 24, 2021 at 7:08 -
10\$\begingroup\$ Not that it'd change your byte-count, but you could've just used 0 - the rules only say 1-9 are forbidden... \$\endgroup\$Darrel Hoffman– Darrel Hoffman2021年02月24日 21:45:34 +00:00Commented Feb 24, 2021 at 21:45
-
4\$\begingroup\$ Just impressed by the beauty of this answer! \$\endgroup\$avarice– avarice2021年03月07日 16:47:12 +00:00Commented Mar 7, 2021 at 16:47
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.
-
2
-
3\$\begingroup\$ You can replace
ord('e')with*b'e'for -3 bytes. \$\endgroup\$ovs– ovs2021年02月23日 16:01:59 +00:00Commented Feb 23, 2021 at 16:01 -
9
-
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– User 126921822021年02月23日 16:08:09 +00:00Commented Feb 23, 2021 at 16:08 -
2\$\begingroup\$ @aneroid - that would be a snippet rather than a function or program, so would need to be
lambda:[*range(*b'e')]to comply with site defaults, making it longer than the full programprint(*range(*b'e')). \$\endgroup\$Jonathan Allan– Jonathan Allan2021年02月24日 20:30:48 +00:00Commented Feb 24, 2021 at 20:30
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 \2ドルn<202\$ as the condition of the for loop.
for(n=0;n+n<0xCA;)print(n++)
30 bytes
This version computes \10ドル^2\$ with the hexadecimal representation of \10ドル\$.
for(n=0;n<=0xA*0xA;)print(n++)
31 bytes
This version builds the string "100".
for(n=0;n<=-~0+'00';)print(n++)
-
1\$\begingroup\$ The last one could be 1 byte shorter as
for(n=0;n<=0xA+'0';)print(n++). \$\endgroup\$Robin Ryder– Robin Ryder2021年02月27日 08:46:53 +00:00Commented Feb 27, 2021 at 8:46
brainfuck, 138 bytes
>>++++++++++<<++++++[>>>++++++++<<<-]++++++[>>>>++++++++<<<<-]++++++++++>++++++++++<[>[>>.>.+<<.<-]++++++++++>>>----------<+<<<-]>>>>+.-..
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
-
1\$\begingroup\$ Welcome to the site, and nice first answer! \$\endgroup\$2021年02月24日 10:09:37 +00:00Commented Feb 24, 2021 at 10:09
SHENZHEN I/O, 61 bytes, 7,円 7 Lines
@not
@mov acc dat
@not
tgt acc dat
-mov acc p0
-add x0
slp x0
Outputs 0-100 as simple output, one per time unit. Makes use of the DX300 (XBus <-> Simple Input chip) and LC70G04 (NOT gate), which cost 1\ each but do not use any power or count as lines of code (the game's measure of code length). These are used to generate a value of 1, which it adds and outputs until it hits 100. The value for 100 is generated using the "not" command, which makes the accumulator 100 if it is value 0, otherwise it sets the acc to 0.
(Not pictured: conversion from simple output to the screen's XBus input, for the visualization.)
SHENZHEN I/O (MCxxxx ASM only), 129 bytes, 8,円 16 Lines
@not | not
@mov acc p0 | mul acc
@mov acc dat | dgt 0
@not | sub p0
add p0 | dgt 0
tgt acc dat | mul acc
-mov acc x0 | mov acc p0
slp p0 | slx x0
Outputs 0-100 as one XBus output each. Uses only programmable MCxxxx chips, no logic gates or other components. Generates value 1 in a pretty interesting way:
not # acc = 100
mul acc # 100 * 100 = 999 (max value)
dgt 0 # digit 0 of 999 = 9
sub p0 # 9 - 100 = -91
dgt 0 # digit 0 of -91 = -1
mul acc # -1 * -1 = 1
-
\$\begingroup\$ Nice to see a little more Shenzen I/O rep around here! \$\endgroup\$Natelolzzz– Natelolzzz2025年03月20日 10:06:37 +00:00Commented Mar 20 at 10:06
Vyxal jHRM, 0 bytes
Kinda cheating, but whatever.
How?
# full program
# H flag presets the stack to 100
# R flag does range when number is treated as iterable
# M flag makes range start at 0
# j flag joins the top of the stack by newlines
Jelly, 2 bytes
3Ż
Outputs a list. If the separator must be a single character, 3 bytes
How it works
3ŻK - Main link. Takes no arguments
3 - Yield 100
Ż - Range from 0 to 100
K - Join by spaces (optional)
-
5\$\begingroup\$ wtf happens here xD \$\endgroup\$azro– azro2021年02月23日 18:15:04 +00:00Commented Feb 23, 2021 at 18:15
-
20\$\begingroup\$ Languages designed to be used in code golf kinda ruin the aesthetics of code golf. I prefer to see mad-squeezing of daily used languages that are legitimately used in real production environments, instead. \$\endgroup\$Martin Braun– Martin Braun2021年02月24日 16:07:57 +00:00Commented Feb 24, 2021 at 16:07
-
4\$\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\$2021年02月24日 16:11:41 +00:00Commented Feb 24, 2021 at 16:11
-
8\$\begingroup\$ @MartinBraun This opinion has been shared a gazillion times on meta. The consensus is, just look at other answers. The R answer in particular is quite beautiful. \$\endgroup\$Rushabh Mehta– Rushabh Mehta2021年02月24日 17:16:28 +00:00Commented Feb 24, 2021 at 17:16
-
3\$\begingroup\$ @Sanctus It is 2 bytes. More specifically, it is the hex bytes
83 D2(and4Bfor the 3 byte version). Jelly uses a custom code page to encode its programs in order to make them more "readable", but if you fed a raw byte stream of those two bytes into the Jelly interpreter, it would produce the same output \$\endgroup\$2021年02月26日 15:45:15 +00:00Commented Feb 26, 2021 at 15:45
Raku, 10 bytes
put 0..C
C 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
c: 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 C.
-
\$\begingroup\$ Anytime you have
0..foo, you can use^foo. So you can get 8 bytes withput ^C\$\endgroup\$user0721090601– user07210906012021年02月24日 03:08:49 +00:00Commented Feb 24, 2021 at 3:08 -
\$\begingroup\$ @user0721090601 Incorrect.
^foois the same as0..(foo-1), not0..foo. \$\endgroup\$Sean– Sean2021年02月24日 03:54:19 +00:00Commented Feb 24, 2021 at 3:54 -
\$\begingroup\$ Ack, duh. Ignore me \$\endgroup\$user0721090601– user07210906012021年02月24日 04:13:18 +00:00Commented Feb 24, 2021 at 4:13
-
\$\begingroup\$ Are there any Unicode characters with a defined value of 101? If so,
puts ^then the character would save bytes \$\endgroup\$2021年03月05日 00:51:17 +00:00Commented Mar 5, 2021 at 0:51 -
\$\begingroup\$ @cairdcoinheringaahing I checked that before posting my answer, but there aren't any. Not too surprising, really. \$\endgroup\$Sean– Sean2021年03月05日 01:02:18 +00:00Commented Mar 5, 2021 at 1:02
R, 11 bytes
F:(0xA*0xA)
F:0xA^(T+T)
Uses this tip.
Still being beaten by some volcano in New Zealand, though...
Old answer:
R, 16 bytes
F:paste0(+T,0,0)
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.
-
\$\begingroup\$ I believe according to the task, you should start with
Frather thanT. \$\endgroup\$Kirill L.– Kirill L.2021年02月23日 17:19:18 +00:00Commented Feb 23, 2021 at 17:19 -
\$\begingroup\$ 9 bytes (but yours is much more elegant!) \$\endgroup\$Robin Ryder– Robin Ryder2021年02月23日 17:31:24 +00:00Commented Feb 23, 2021 at 17:31
-
\$\begingroup\$ @KirillL. oh yes, my mistake. Thanks. \$\endgroup\$Giuseppe– Giuseppe2021年02月23日 17:44:41 +00:00Commented Feb 23, 2021 at 17:44
-
2\$\begingroup\$ @Giuseppe, yeah, but
F:sum(T|Nile)is still only 13 bytes. \$\endgroup\$Kirill L.– Kirill L.2021年02月23日 17:48:12 +00:00Commented Feb 23, 2021 at 17:48 -
1\$\begingroup\$ I found out that the
volcanodataset leads to a 9 byte answer, which I posted instead. \$\endgroup\$Robin Ryder– Robin Ryder2021年02月23日 19:34:41 +00:00Commented Feb 23, 2021 at 19:34
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.
-
\$\begingroup\$ Nice! You can golf it a bit by computing 100 as 4*5*5 tio.run/##K0otycxL/P@fSwcIuHTAFILmUtFL@P8fAA \$\endgroup\$Leo– Leo2021年02月23日 21:49:23 +00:00Commented Feb 23, 2021 at 21:49
-
1\$\begingroup\$ @Leo You should have used
0514150commas for a nice symmetry! \$\endgroup\$Neil– Neil2021年02月23日 23:30:21 +00:00Commented Feb 23, 2021 at 23:30 -
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– Neil2021年02月23日 23:40:29 +00:00Commented Feb 23, 2021 at 23:40
-
\$\begingroup\$ As per specification you may not use commas (
,). \$\endgroup\$Kai Burghardt– Kai Burghardt2023年09月06日 16:00:06 +00:00Commented Sep 6, 2023 at 16:00 -
\$\begingroup\$ @KaiBurghardt I think that's just the way the list of excluded digits is formatted. But you can replace the commas with spaces or
¶s to get an alternative program if you so wish. \$\endgroup\$Neil– Neil2023年09月06日 17:21:14 +00:00Commented Sep 6, 2023 at 17:21
C (gcc), 38 bytes
f(i){for(i=0;printf("%d ",i++)&'#';);}
Without using digit 0, it would be 39 bytes: i;main(){for(;printf("%d ",i++)&'#';);}
-
\$\begingroup\$ i as a global defaults to 0 saving a couple characters. Just change your main call to f in your example/ \$\endgroup\$Michael Dorgan– Michael Dorgan2021年02月24日 20:58:48 +00:00Commented Feb 24, 2021 at 20:58
-
\$\begingroup\$ Actually took I it further and made it recursive for a 2 more characters saved: \$\endgroup\$Michael Dorgan– Michael Dorgan2021年02月24日 21:10:12 +00:00Commented Feb 24, 2021 at 21:10
-
\$\begingroup\$ where did you learn this level of programming i don't even understand it \$\endgroup\$vijay kumar– vijay kumar2021年02月25日 07:59:30 +00:00Commented Feb 25, 2021 at 7:59
-
2\$\begingroup\$ @vijaykumar
printfreturns how many bytes are printed.'#'is as same as number 35 (ASCII 35 for "#"). That's all you need to know to make it work. \$\endgroup\$tsh– tsh2021年02月25日 08:08:37 +00:00Commented Feb 25, 2021 at 8:08 -
\$\begingroup\$ Capital C would also work - 64+3 = 'C' :) \$\endgroup\$Michael Dorgan– Michael Dorgan2021年02月25日 19:21:56 +00:00Commented Feb 25, 2021 at 19:21
Zsh, 12 bytes
seq 0 $[##d]
seq: count- from
0 $[##d]: to the character value ofd
- from
Alternative:
Zsh, 12 bytes
! seq 0 $?00
! does nothing, but fails with exit code 1; $? then retrieves the exit code.
-
\$\begingroup\$ Also,
jot $[##d]\$\endgroup\$roblogic– roblogic2025年08月03日 10:00:42 +00:00Commented Aug 3 at 10:00
-
8\$\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– manatwork2021年02月23日 16:23:34 +00:00Commented Feb 23, 2021 at 16:23 -
2\$\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– Jonah2021年02月23日 16:25:15 +00:00Commented Feb 23, 2021 at 16:25 -
\$\begingroup\$ @manatwork thanks! \$\endgroup\$avarice– avarice2021年02月23日 16:27:26 +00:00Commented Feb 23, 2021 at 16:27
-
1\$\begingroup\$ How weird, @Jonah. I can't find where I learned about that feature. Only found in the
printfspecification's Examples section. Maybe Wasif knows a better documentation. \$\endgroup\$manatwork– manatwork2021年02月23日 16:35:49 +00:00Commented Feb 23, 2021 at 16:35 -
2
-
1\$\begingroup\$ Try it online! \$\endgroup\$mazzy– mazzy2021年02月23日 22:12:51 +00:00Commented Feb 23, 2021 at 22:12
-
\$\begingroup\$ @mazzy thanks! I feel silly for having missed that, lol \$\endgroup\$Zaelin Goodman– Zaelin Goodman2021年02月24日 16:36:35 +00:00Commented Feb 24, 2021 at 16:36
-
1\$\begingroup\$ You beat me to it! \$\endgroup\$Walter Mitty– Walter Mitty2021年02月25日 15:34:11 +00:00Commented Feb 25, 2021 at 15:34
-
\$\begingroup\$ Why not just enter 0..100 \$\endgroup\$Can.U– Can.U2023年11月01日 06:00:20 +00:00Commented Nov 1, 2023 at 6:00
PHP, 30 bytes
First time golfing, I hope I posted this right!
while($q<ord(e))echo+$q++,' ';
Thanks to manatwork and Dewi Morgan's suggestions to improving the code! From 34 to 30 bytes!
The code revisions are in the edit history, removed here so it looks cleaner!
-
2\$\begingroup\$ Welcome to Code Golf! Nice first answer. (Don't worry, you posted it correctly :p) \$\endgroup\$2021年02月24日 06:07:53 +00:00Commented Feb 24, 2021 at 6:07
-
1\$\begingroup\$ Unfortunately your solution doesn't output 0. While fixing it, you could reduce its size by removing the single quotes, the braces and the parenthesis around
echo's argument. I would suggest this: Try it online! \$\endgroup\$manatwork– manatwork2021年02月24日 06:08:29 +00:00Commented Feb 24, 2021 at 6:08 -
1\$\begingroup\$ Nice! The space before quotes can go, too :) \$\endgroup\$Dewi Morgan– Dewi Morgan2021年02月25日 16:35:20 +00:00Commented Feb 25, 2021 at 16:35
-
1\$\begingroup\$ Thinking about it, you can also get rid of the third clause if you postincrement and concatenate the variable to the space : `for($q=0;$q<ord(e);)echo$q++." "; Shame none of the permitted separators are characters so they could be unquoted. \$\endgroup\$Dewi Morgan– Dewi Morgan2021年02月25日 16:50:38 +00:00Commented Feb 25, 2021 at 16:50
-
1\$\begingroup\$ And we only need the 4 chars
$q=0because null isn't being cast to an int. We can cast to an int to avoid it, but(int)takes 5 bytes. But adding 0 casts to 0, and we can only do that in 2 bytes, though we need to re-add the space after the echo, so it's effectively 3. Still saves us a byte, though!while($q<ord(e))echo 0+$q++." ";(while has the same bytecount as for with just the middle clause used). \$\endgroup\$Dewi Morgan– Dewi Morgan2021年02月25日 17:22:04 +00:00Commented Feb 25, 2021 at 17:22
Factor, (削除) 46 (削除ここまで) 23 bytes
-23 bytes thanks to Bubbler
0xa sq [0,b] [ . ] each
I've never written anything in Factor before, but it's a surprisingly fun language.
-
2\$\begingroup\$ Thanks for picking up Factor! Lots of golfs are possible on this code. 1) You don't need to dup the 100 in the first place, and then you won't have anything to drop at the end. 2) A range is a sequence, so you can run
eachon it without>array. 3) There are multiple ways to get the constant 100, such asCHAR: dor0xa sq. If you want, drop by the Factor chatroom, and I'll explain things further :) \$\endgroup\$Bubbler– Bubbler2021年03月02日 08:35:03 +00:00Commented Mar 2, 2021 at 8:35
dc, 13 characters
Thanks to
- Daemon for reusing stack depth instead of getting it again, to use shorter operator (-1 character)
[zpdA0>x]dsxx
dc, 14 characters
Thanks to
- Digital Trauma for the twist in using the stack depth efficiently (-2 characters)
[zpzA0!<m]dsmx
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
-
\$\begingroup\$ Similar idea, same score \$\endgroup\$Digital Trauma– Digital Trauma2021年02月23日 20:41:12 +00:00Commented Feb 23, 2021 at 20:41
-
1\$\begingroup\$ Thanks @DigitalTrauma. I tried that too earlier, but only now, seeing your suggestion I found the more efficient way. \$\endgroup\$manatwork– manatwork2021年02月23日 20:54:09 +00:00Commented Feb 23, 2021 at 20:54
-
1\$\begingroup\$ A splat
*operator will do it instead of.to_a:p *0..?d.ord\$\endgroup\$manatwork– manatwork2021年02月23日 16:00:58 +00:00Commented Feb 23, 2021 at 16:00 -
2\$\begingroup\$ You can switch to Ruby 1.8 and remove the
.ord\$\endgroup\$pxeger– pxeger2021年02月23日 20:02:03 +00:00Commented Feb 23, 2021 at 20:02
Vyxal, jH, 1 byte
ʀ
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.
-
\$\begingroup\$ This seems to give the wrong output \$\endgroup\$user7467– user74672021年02月23日 22:00:31 +00:00Commented Feb 23, 2021 at 22:00
-
\$\begingroup\$ @Anush its fixed \$\endgroup\$2021年02月24日 01:53:07 +00:00Commented Feb 24, 2021 at 1:53
-
\$\begingroup\$ +1, first reaction someone seeing this will be "OMGWTFBBQ wat happens here" XD \$\endgroup\$avarice– avarice2021年06月07日 12:19:06 +00:00Commented Jun 7, 2021 at 12:19
Perl, (削除) 20 (削除ここまで), (削除) 13 (削除ここまで), (削除) 12 (削除ここまで), 16 bytes
say for 0..ord d
-
\$\begingroup\$ You can get rid of
,ドル=",";, but you needord('d')for it to work. \$\endgroup\$Sake– Sake2021年02月23日 16:03:58 +00:00Commented Feb 23, 2021 at 16:03 -
1\$\begingroup\$ @PaulPicard: unquoted dee works here (perl v5.32.0), e.g.
perl -E 'say 0..ord(d)'\$\endgroup\$Thor– Thor2021年02月23日 16:08:04 +00:00Commented Feb 23, 2021 at 16:08 -
2\$\begingroup\$ You can remove the parenthesis. \$\endgroup\$manatwork– manatwork2021年02月23日 16:11:33 +00:00Commented Feb 23, 2021 at 16:11
-
\$\begingroup\$ Without the comma, this doesn't meet the challenge specification to have a separator between numbers.
say for 0..ord dwould meet the rules. \$\endgroup\$Xcali– Xcali2021年02月24日 00:01:07 +00:00Commented Feb 24, 2021 at 0:01 -
\$\begingroup\$ @Xcali: indeed, thanks \$\endgroup\$Thor– Thor2021年02月24日 05:18:07 +00:00Commented Feb 24, 2021 at 5:18
Zsh, 16 bytes
echo {0..$[##d]}
Only builtins, so no seq
For fun, here's a 17 byte answer without 0:
echo {$?..$[##d]}
Also $! or $# will work as 0 replacements.
-
\$\begingroup\$ Coreutils solution for 14B:
jot - 0 $[##d]\$\endgroup\$roblogic– roblogic2021年11月10日 01:55:03 +00:00Commented Nov 10, 2021 at 1:55
Bash, (削除) 18 (削除ここまで) (削除) 16 (削除ここまで) 14 bytes
seq 0 $[++x]00
Thanks @manatwork for -2, @Jonah for -2
-
\$\begingroup\$ You don't need the braces. \$\endgroup\$manatwork– manatwork2021年02月27日 02:53:31 +00:00Commented Feb 27, 2021 at 2:53
-
\$\begingroup\$ Welcome to Code Golf! Nice first answer. \$\endgroup\$2021年02月27日 04:14:18 +00:00Commented Feb 27, 2021 at 4:14
-
\$\begingroup\$
seq 0 $[++x]00for 14. \$\endgroup\$Jonah– Jonah2021年02月28日 03:43:37 +00:00Commented Feb 28, 2021 at 3:43
Perl 5 (ppencode-compatible), 64 bytes
You didn't clarify that I must separate each with exactly one character, so here it is mine.
print length uc xor s qq q xor print while length ne ord qw q eq
Explained
# print(length) did not work for zero as $_ is not defined at then
print length uc xor
s qq q xor
# delimiter
print
while
# equals to: length ne 101
length ne ord qw q eq
Bash, 15
seq `dc<<<A0Kf`
- 1 byte saved, thanks to @manatwork.
Previous answer:
Pure Bash (no external utilities), 23
- 9 bytes saved thanks to @ArcticKona.
eval echo {0..$[++x]00}
-
\$\begingroup\$ Your newest solution skips "0" because you missed a space between
seq's parameters. Sorry, that looks like +1 character. ☹ \$\endgroup\$manatwork– manatwork2021年02月23日 20:28:40 +00:00Commented Feb 23, 2021 at 20:28 -
\$\begingroup\$ @manatwork oops - yes, thanks - fixed. \$\endgroup\$Digital Trauma– Digital Trauma2021年02月23日 20:30:11 +00:00Commented Feb 23, 2021 at 20:30
-
1\$\begingroup\$ As apology, here is a 15 character one, still based on your idea:
seq `dc<<<A0Kf`. \$\endgroup\$manatwork– manatwork2021年02月23日 20:31:19 +00:00Commented Feb 23, 2021 at 20:31 -
\$\begingroup\$ @manatwork - thanks! \$\endgroup\$Digital Trauma– Digital Trauma2021年02月23日 20:43:19 +00:00Commented Feb 23, 2021 at 20:43
-
1\$\begingroup\$ for pure bash try
eval echo {0..$[++x]00}\$\endgroup\$Arctic Kona– Arctic Kona2021年10月29日 07:40:29 +00:00Commented Oct 29, 2021 at 7:40
PICO-8, (削除) 50 (削除ここまで) 45 bytes
i=0-#"0"repeat i+=#"0"?i
until#tostr(i)>#"00"
-5 bytes by replacing print with its shorthand, ?.
Demo (50 byte version; 45 byte version has same output):
-
3\$\begingroup\$ Glad to see some PICO-8 on CGCC! It's such a fun little engine to tinker around with. \$\endgroup\$SjoerdPennings– SjoerdPennings2021年11月03日 08:50:43 +00:00Commented Nov 3, 2021 at 8:50
Javascript, 48 bytes
for(a of Array("e".charCodeAt()).keys())alert(a)
Can be shorter, if you allow in reverse (36 chars)
for(i="e".charCodeAt();--i;)alert(i)
-
\$\begingroup\$ Your 50 bytes solution doesn't output 0. To fix it just remove that unnecessary pre-incrementation and change the "d" to "e". \$\endgroup\$manatwork– manatwork2021年02月27日 22:22:12 +00:00Commented Feb 27, 2021 at 22:22
-
\$\begingroup\$ @manatwork i thought we didnt have to print 0, at the time i wrote the solution. I'll fix it :) thanks \$\endgroup\$user100752– user1007522021年02月28日 16:52:38 +00:00Commented Feb 28, 2021 at 16:52
-
\$\begingroup\$ 40 forward \$\endgroup\$l4m2– l4m22022年03月28日 19:20:50 +00:00Commented Mar 28, 2022 at 19:20
Python, (削除) 25 (削除ここまで) 23 bytes
print(*range(ord('e')))
-2 by Steffan, remove first parameter (0) from call to range
-
1\$\begingroup\$ The
0,is not needed \$\endgroup\$naffetS– naffetS2022年07月07日 19:54:10 +00:00Commented Jul 7, 2022 at 19:54 -
1\$\begingroup\$ Thanks a lot! I'll use it. \$\endgroup\$Eric Xue– Eric Xue2022年07月08日 01:41:47 +00:00Commented Jul 8, 2022 at 1:41
-
\$\begingroup\$ 21 bytes Try it online! \$\endgroup\$vengy– vengy2025年04月07日 02:37:44 +00:00Commented Apr 7 at 2:37
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
8 bytes (if you consider Hello, world! a valid separator)
o{{iow}}
7 bytes (If you don't care about seperators)
o{{io}}
Never thought I'd see deadfish be shorter than, well, anything except Unary.
-
\$\begingroup\$ Damn it. Rewriting. \$\endgroup\$emanresu A– emanresu A2021年02月24日 03:30:14 +00:00Commented Feb 24, 2021 at 3:30
-
\$\begingroup\$ @Razetime Remebered w doesn't care about accumulator. \$\endgroup\$emanresu A– emanresu A2021年02月24日 03:32:10 +00:00Commented Feb 24, 2021 at 3:32
-
\$\begingroup\$ "Hello, World!" is not a valid separator. \$\endgroup\$The Fifth Marshal– The Fifth Marshal2021年02月24日 04:10:57 +00:00Commented Feb 24, 2021 at 4:10
-
1\$\begingroup\$ Haha reading up on Deadfish~ I realized that exact 7 byte program... but you beat me to it! I actually wrote a Deadfish interpreter for Code Golf that automatically had spaces between output, just because the BASIC interpreter put them there. 😄 Perfect for than program! \$\endgroup\$Caleb Fuller– Caleb Fuller2021年03月07日 16:30:25 +00:00Commented Mar 7, 2021 at 16:30
0. Which is what makes this challenge interesting, IMO. \$\endgroup\$