| Bytes | Lang | Time | Link |
|---|---|---|---|
| 070 | AWK | 241115T181457Z | xrs |
| 083 | GFortran | 190813T021458Z | roblogic |
| 072 | Casio BASIC CASIO fx9750GIII | 241114T174242Z | madeforl |
| 004 | Thunno 2 Ṡ | 230810T101945Z | The Thon |
| 058 | Julia | 201210T122638Z | Amir rez |
| 035 | Perl 5 | 201210T055348Z | Xcali |
| 008 | Pip s | 201210T023615Z | Razetime |
| 057 | MUMPS | 200227T060012Z | Michael |
| 034 | 8088 Assembly | 190813T151730Z | 640KB |
| 026 | Pure Bash | 150713T024249Z | Digital |
| 040 | PowerShell 6 | 190813T142408Z | mazzy |
| 084 | Scala | 190813T135339Z | V. Court |
| 042 | Ahead | 190813T122136Z | snail_ |
| 029 | Zsh | 190813T024046Z | roblogic |
| 2902 | brainfuck | 190812T140857Z | Kamila S |
| 900 | Malbolge | 190812T134816Z | Kamila S |
| nan | TheC64Mini and Commodore BASIC C64/128 | 190812T131250Z | Shaun Be |
| 064 | Ruby | 150716T064814Z | clapp |
| 012 | Dyalog APL | 150903T132917Z | Adá |
| 059 | jq 1.5 | 150713T172027Z | manatwor |
| 135 | C++14 | 160117T185549Z | Yytsi |
| 047 | Matlab | 160117T172913Z | brainkz |
| 034 | Perl 6 | 160117T155104Z | Brad Gil |
| 060 | JavaScript 74 72 65 | 150713T161518Z | wolfhamm |
| 157 | Python 3 | 150716T093254Z | Tim Pede |
| 022 | CJam | 150712T164652Z | Sp3000 |
| 012 | Pyth | 150716T020859Z | Maltysen |
| 065 | Mumps | 150715T124727Z | zmerch |
| 022 | J | 150714T142353Z | lynn |
| 057 | Python 2 | 150714T120051Z | Brian |
| 052 | Haskell | 150713T165732Z | lynn |
| 062 | Javascript ES6 | 150712T190503Z | George R |
| 057 | JavaScript ES6 | 150713T155026Z | rink.att |
| 057 | Befunge93 | 150713T144107Z | Sok |
| 047 | J | 150713T120144Z | gar |
| 014 | CJam | 150712T164233Z | Dennis |
| 052 | Python 2 | 150713T031637Z | xnor |
| 104 | Java | 150712T203439Z | Ypnypn |
| 055 | Python 2 | 150712T171640Z | Kade |
| 017 | Pyth | 150712T180508Z | Ypnypn |
| 075 | C | 150712T170844Z | BrainSte |
| 063 | TIBasic | 150712T171318Z | gengkev |
AWK, 70 bytes
END{for(;i++<split("0123456789abcdef",a,X);)for(j in a)print a[i]a[j]}
31 bytes, probably against rules
END{for(;i++<48;)printf"%X ",i}
GFortran, 93 83 bytes
Prints 00 through ff. Saved 10 bytes using print loops instead of do.. enddo.
character(16)H;H='0123456789abcdef'
print*,((H(i:i)//H(j:j),' ',j=1,16),i=1,16)
end
Stretching the rules, here's a 26-byte solution using print formatting
print'(z3)',(i,i=0,99);end
Casio BASIC (CASIO fx-9750GIII), 72 bytes
Lbl A
J→I
20→B
While I
Locate B,7,StrMid("0123456789ABCDEF",1+I Rmdr 16,1)
I Int÷ 16→I
Dsz B
WhileEnd
Isz J
Goto A
each number overwrites the other on the display.
Thunno 2 Ṡ, 4 bytes
kfDṖ
Explanation
kfDṖ # Implicit input
kf # Push "0123456789ABCDEF"
DṖ # Cartesian product with itself
# Join on spaces
# Implicit output
Julia - 58 bytes
a="0123456789abcdef"
for i in a
for j in a
print(i*j*" ")
end
end
Pip -s, 8 bytes
_TB16M,h
Explanation
_TB16M,h
,h range 0...99
M map using lambda:
_TB16 convert to hexadecimal
join with spaces(-s flag)
MUMPS, 57 bytes
f i=1:1:48 w $tr(i\16,0),$e("0123456789abcdef",i#16+1),!
Output
>d ^xmsdgolf
1
2
3
4
5
6
7
8
9
a
b
c
d
e
f
10
11
..
28
29
2a
2b
2c
2d
2e
2f
30
Explanation
f i=1:1:48 ; loop from 1 to 48
w $tr(i\16,0) ; print i div 16, and ditch any zeros
$e("0123456789abcdef",i#16+1) ; extract the nth character from the string, where n is i mod 16 + 1
! ; crlf
8088 Assembly, IBM PC DOS, 34 bytes
Bytes xxd:
00000000: 43e8 0900 e806 00b0 20cd 10eb f3b1 04d2 C....... .......
00000010: c38a c324 0f3c 0a7c 0204 0704 30b4 0ecd ...$.<.|....0...
00000020: 10c3
Unassembled:
BYTE_LOOP:
43 INC BX ; increment counter
E8 0009 CALL HB ; display high byte
E8 0006 CALL HB ; display low byte
B0 20 MOV AL, ' ' ; display space delimiter
CD 10 INT 10H ; call BIOS, write char to console
EB F3 JMP BYTE_LOOP ; keep looping forever
HB PROC
B1 04 MOV CL, 4 ; set up bitshift for 4 bits
D2 C3 ROL BL, CL ; shift counter left 4 bits
8A C3 MOV AL, BL ; put counter into AL
24 0F AND AL, 0FH ; isolate nibble
3C 0A CMP AL, 0AH ; is nibble A-F?
7C 02 JL NOT_ALPHA ; if not, skip adjustment
04 07 ADD AL, 'A'-'9'-1 ; adjust ASCII value to A-F
NOT_ALPHA:
04 30 ADD AL, '0' ; decimal to binary convert
B4 0E MOV AH, 0EH ; BIOS tty function
CD 10 INT 10H ; call BIOS, write char to console
C3 RET ; return to program
HB ENDP
Standalone PC DOS exactable, output is to console and will keep displaying until program is stopped. Just a scratch ASCII manipulating program here. There are just no built-ins or convenience methods in x86 or DOS/BIOS APIs to convert binary values to strings for output.
Output:
Scala, 84 bytes
val l=(0 to 9)++"A,B,C,D,E,F".split(",")
l.foreach(x=>l.foreach(y=>println(x+""+y)))
Slightly better built version, using what you could call a cartesian product. Try it online! Output goes with leading 0s and a trailing newline. Starts at 00 and counts up to FF (255 in base 10).
Scala, 89 bytes
for(x<-1 to 48)println(if(x%16>9)x/16+"a,b,c,d,e,f".split(",")(x%16-10)else x/16+""+x%16)
First answer, because why not, I like its hacks. Try it online! Output goes with leading 0s and a trailing newline. Starts at 01 and counts up to 30 (48 in base 10).
Ahead, 42 bytes
Prints hex numbers starting at 0 forever. Will eventually overflow, though.
>t>:16;r
Cvn:/61\<
>$>:10/7*v
^oNndo++0'<
Zsh, 44 29 bytes
-15, via GammaFunction try it online!
h=({0..9} {a..f});echo $^h$^h
Original (44 bytes):
g=0123456789abcdef;h=(${(s::)g});echo $^h$^h
brainfuck, 2902 bytes
Easy to outgolf, but worth giving a shot
+>+[<[>>+>+<<<-]>>[<<+>>-]>[[-]>>>>>[-]++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++<<<[-]++++++++++++++++++++++++++++++++++++++++++++++++>[-]<[>+<<+>-]<[>+<-]<]>+<<+<<[>>->+<<<-]>>>[<<<+>>>-]<[->+<<[>>>-<<+<-]>[<+>-]>>[<->[-]]<[<<<+>>>-]<]>>[-]<<<<[>>+>+<<<-]>>[<<+>>-]>[[-]>>.>.>>>++++++++++++++++++++++++++++++++.[-]<<[-]<<[>>+<<<+>-]<[>+<-]>>>>>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++<<[<<<<+>>>>-]+>>[<<<<<<-<+>>>>>>>-]<<<<<<<[>>>>>>>+<<<<<<<-]>[>>>>-<<<<[-]]>>>>>>[-]++<<[<<<<<+>+>>>>-]<<<<<[>>>>>+<<<<<-]>[<<<[-]>[-]>>>>>>>>[<<<<<<<<+>+>>>>>>>-]<<<<<<<[>>>>>>>+<<<<<<<-]>[-]]>>>>>>[-]<<<<<<]<<<[>>+>+<<<-]>>[<<+>>-]>[[-]>>>>[-]<[>+<<<+>>-]<<[>>+<<-]>>>>>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++<<[<<<<+>>>>-]+>>[<<<<<<-<+>>>>>>>-]<<<<<<<[>>>>>>>+<<<<<<<-]>[>>>>-<<<<[-]]>>>>>>[-]+++<<[<<<<<+>+>>>>-]<<<<<[>>>>>+<<<<<-]>[<<<[-]>[-]>>>>>>>>[<<<<<<<<+>+>>>>>>>-]<<<<<<<[>>>>>>>+<<<<<<<-]>[-]]>>>>>>[-]<<<<<<]<<<[>>+>+<<<-]>>[<<+>>-]>[[-]>>>>[-]<<[>>+<<<+>-]<[>+<-]>>>[<<<<+>>>>-]+>[<<<<<-<+>>>>>>-]<<<<<<[>>>>>>+<<<<<<-]>[>>>>-<<<<[-]]>>>>>>+++++<<[<<<<<+>+>>>>-]<<<<<[>>>>>+<<<<<-]>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~X]\[ZYRv98TSLKoO10FKDh+GFE>CB;_?>=}|49870/.R2+*Non&%I#"!&%${A!~}_u;yxqpo5mrqpoh.lkdibgf_%]\[!_XW{[ZYXQPt7SRQPOHGkKJIHAF?cC<;@?8\6;492V6v.-,P*p.'K+$j"'~D|#"y~wv<]yxqvutsrk1onmfN+cba`&d]#DZ_^]VzTSXQVOs65QJINGkE-IBAe(D=<A:98\654981Uv.32+*)M-,%k#(!E}$#"!x>v{t:xwputm3kpoh.fN+Lbg`ed]\"!Y^]VzZYXQVOsS54JImMFKJIHAe?>C<`@?87[;{32V05.-2+O)o-,+$H('&}Cdzy~wv<]sxqvonm3k1oQmf,jihgfeG]#a`_X|V[TxXQPUTMLp3ONMLEDhH*)ED=a;@?>76;4X816/43,P*).',%I#i!&}|Bcb~w|u;yxwputm3qSong-kjihgfH%]\a`_XW{UTYXQuUTMRKPOHlFKDhBAe?>=B;_9>=6Z:981Uv.32+*)M-,%k#(!E%$#c!x>|u;yxZpo5srqSi/z
TheC64Mini and Commodore BASIC (C64/128, PET, VIC-20, C16/+4) - 164 BASIC and Tokenized bytes used
0 fOd=.to255:n=d:fOi=1to.stE-1:h%(i)=n/(16^i):n=n-(h%(i)*(16^i)):nEi:h$=""
1 fOi=1to.stE-1:ifh%(i)<10tHh$=h$+cH(48+h%(i))
2 ifh%(i)>9tHh$=h$+cH(55+h%(i))
3 nEi:?h$" ";:nEd
Prints a double-space after the hex number to nicely align the printing at 40/80 columns as well as the 22 columns on the VIC-20.
Ruby, 64 bytes
h='0123456789abcdef'.split //;h.each{|i|h.each{|j|print i,j,?\s}}
Explanation:
h = '0123456789abcdef'.split // # Split string of hex chars at
# matches of //, returns array
# splits array by characters
h.each { |i| # loop 1
h.each { |j| # loop 2
print i,j,?\s # print() can take multiple params,
# and it is the same as printing
# each one using a separate print().
# ?x is the same as 'x', so ?\s is
# the same as "\s", which is " ".
}
}
Dyalog APL, 12 bytes
∘.,⍨16↑⎕D,⎕A
00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F
20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F
30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F
40 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E 4F
50 51 52 53 54 55 56 57 58 59 5A 5B 5C 5D 5E 5F
60 61 62 63 64 65 66 67 68 69 6A 6B 6C 6D 6E 6F
70 71 72 73 74 75 76 77 78 79 7A 7B 7C 7D 7E 7F
80 81 82 83 84 85 86 87 88 89 8A 8B 8C 8D 8E 8F
90 91 92 93 94 95 96 97 98 99 9A 9B 9C 9D 9E 9F
A0 A1 A2 A3 A4 A5 A6 A7 A8 A9 AA AB AC AD AE AF
B0 B1 B2 B3 B4 B5 B6 B7 B8 B9 BA BB BC BD BE BF
C0 C1 C2 C3 C4 C5 C6 C7 C8 C9 CA CB CC CD CE CF
D0 D1 D2 D3 D4 D5 D6 D7 D8 D9 DA DB DC DD DE DF
E0 E1 E2 E3 E4 E5 E6 E7 E8 E9 EA EB EC ED EE EF
F0 F1 F2 F3 F4 F5 F6 F7 F8 F9 FA FB FC FD FE FF
jq 1.5: 65 59 characters
(56 characters code + 3 characters command line option.)
[range(10)]+"a b c d e f"/" "|{a:.[],b:.}|"\(.a)\(.b[])"
Sample run:
bash-4.3$ jq -n -r '[range(10)]+"a b c d e f"/" "|{a:.[],b:.}|"\(.a)\(.b[])"' | head
00
01
02
03
04
05
06
07
08
09
On-line test (Passing -r through URL is not supported – check Raw Output yourself.)
jq 1.5: 56 characters
(53 characters code + 3 characters command line option.)
[[range(10)]+"a b c d e f"/" "|"\(.[])\(.[])"]|sort[]
This produces correct output, however is not exactly a counter: it not generates the values in order, just sorts them after.
On-line test (Passing -r through URL is not supported – check Raw Output yourself.)
C++14 - 135
#include<string>
#include<iostream>
void f(){std::string a="0123",b="0123456789ABCDEF";for(char c:a)for(char d:b)std::cout<<c<<d<<" ";}
Matlab: 47 bytes
q=[48:57,97:102,''];fliplr(char(combvec(q,q)'))
I don't know if it would be considered as counter. The code generates vector of hex numbers from 00 to ff. q is a string '0123456789abcdef' in double format. Combvec generates all possible pairs between q and q. Char converts it to string format and fliplr flips the columns to get:
00
01
...
08
09
0a
0b
0c
0d
0e
0f
10
11
...
fd
fe
ff
Perl 6, 34 bytes
The shortest that I can come up with that doesn't use any sort of conversion is:
put [X~] (|(0..9),|('A'..'F'))xx 2 # 34 bytes
prints 00 ... FF space separated in order.
If you want more you can swap 2 for a larger number.
(don't use a number bigger than 4 as it concatenates the values together before outputting anything, so it would use a significant amount of RAM )
Shortest that will never stop writing hex values
put [R~] (|(0..9),|('A'..'F'))[.polymod: 16 xx*]for 0..* # 56 bytes
If printf were allowed
printf "%X ",$_ for 0..* # 24 bytes
If a base conversion function were allowed
put .base(16)for 0..* # 21 bytes
JavaScript 74 72 65 60
//for(i=0,a="0123456789ABCDEF";i++<49;)console.log(a[i>>4]+a[i%16])
for(i=0;i++<48;)console.log((i>>4)+"0123456789ABCDEF"[i%16])
Python 3, 157 bytes
As far as I can tell, this is the only submission so far that can keep counting upwards forever. (Of course, I can't read Haskell or Mumps, but they all seem to be doing a two-character loop...) EDIT: Okay, not the only one, but perhaps the only one in a non-golfy language?
n=bytearray(b'0')
while 1:
print(repr(n)[12:-2]);p,o=len(n),1
while o:
p-=1;m=n[p];n[p]={57:65,70:48}.get(m,m+1);o=m==70
if o and p==0:p=1;n[:0]+=b'0'
Proof of correctness (wraps the above in a function, changing only print to yield, and then loops as high as you like):
def golfed_code():
n=bytearray(b'0')
while 1:
yield(repr(n)[12:-2]);p,o=len(n),1
while o:
p-=1;m=n[p];n[p]={57:65,70:48}.get(m,m+1);o=m==70
if o and p==0:p=1;n[:0]+=b'0'
TEST_LIMIT = 100000
for n, h in enumerate(golfed_code()):
assert hex(n).upper()=='0X'+h,'{} != {}'.format(hex(n).upper(),'0X'+h)
if n == TEST_LIMIT:
break
(Thanks to Sp3000 for saving me 3 bytes.)
CJam, 22 bytes
1{_GbA,6,'af++f=oNo)}h
This runs forever, and thus is probably one of the rare times where it's a good idea not to include a permalink.
Pyth - 12 bytes
Uses cartesian product, and sorts at the end to get in correct order, then joins by spaces. Prints 00-ff inclusive.
jdS^s+<G6UT2
jd Join by spaces
S Sort lexiographically
^ 2 Cartesian product repeat twice
s+ Append then concatenate entire list
<G6 First six of alphabet
UT Range 0-9
Mumps - 65 bytes
S Q="0123456789ABCDEF" F I=1:1:16 F J=1:1:16 W $E(Q,I),$E(Q,J),!
Nope... Mumps ain't dead yet! :-)
J, 22 bytes
>{;~'0123456789abcdef'
Counts to ff. Prints an extra newline between each block of 0x10 numbers, like so:
...
0d
0e
0f
10
11
...
Python 2 - 57 bytes
h='0123456789ABCDEF'
' '.join([i+j for i in h for j in h])
This outputs 00 to FF, with spaces between.
Haskell, 52 bytes
a="0123456789abcdef";main=mapM putStrLn$mapM id[a,a]
Javascript ES6, 67 62 bytes
(x=''.replace.bind('0123456789ABCDEF',/./g))(n=>x(o=>' '+n+o))
JavaScript (ES6), 57 bytes
Same approach as the Python ones I suppose.
for(i of c='0123456789ABCDEF')for(j of c)console.log(i+j)
Befunge-93, 57 bytes
<_v#-*44:+1,*84,g2:\,g2:\
^ >$1+:9-!#@_0
0123456789ABCDEF
Prints numbers from 00to 8F. If you prefer your programs to run forever, the version below is non-terminating and will continually output all numbers from 00 to FF.
<_v#-*44:+1,*84,g2:\,g2:\
^ >$1+:35*`!*0
0123456789ABCDEF
J, 47 bytes
'0123456789abcdef'{~([:|:2 256$(]#i.),256$i.)16
prints 00 to ff
CJam, 21 14 bytes
A,_6,'Af++m*S*
Prints the numbers 00 to 9F.
Try it online in the CJam interpreter.
How it works
A, e# Push [0 ... 9].
_ e# Push a copy.
6, e# Push [0 ... 5].
'Af+ e# Add 'A' to each. This pushes "ABCDEF".
+ e# Concatenate. This pushes [0 ... 9 'A' ... 'F'].
m* e# Cartesian product. This pushes [[0 0] ... [9 'F'].
S* e# Join, separating by spaces.
Python 2, 52
a=0
for b in'0123456789ABCDEF'*4:print`a`+b;a+=b>'E'
Prints 00 to 3F. Takes advantage of the fact that the first digit a is always a number in this range. Loops through four cycles of the second digit b, incrementing a whenever the second digit is F.
This is one char shorter than the more direct
for a in'0123':
for b in'0123456789ABCDEF':print a+b
Java, 104 bytes
char t[]="0123456789abcdef".toCharArray(),i;void f(){for(;i<99;)System.out.println(""+t[i/16]+t[i++%16]);}
If the i<99 is removed, it still reaches 30, but eventually crashes. I'm not sure if that's acceptable.
Python 2, 66 55 Bytes
This should really have been the most obvious approach to me..
a='0123456789ABCDEF'
for x in a:
for y in a:print x+y
Old (66 Bytes): Technically this causes an error after FF, but it does reach 30.
n=1;a='0123456789ABCDEF'
while 1:print a[n/16]*(n>15)+a[n%16];n+=1
I assumed string formatting wasn't allowed since I'm pretty sure it would go through base conversion, but if it was allowed, this would be 29 bytes:
n=1
while 1:print"%x"%n;n+=1
Pyth, 17 bytes
VJs++kUT<G6FYJ+NY
How it works:
<G6 # "abcdef"
UT # [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
k # an empty string (so + means concatenation, not addition)
s++ # join them all ("0123456789abcdef")
J # call this J
V # for each N in J...
FYJ # for each Y in J...
+NY # print N and Y
C, 78 75 bytes
x(y){return y+48+y/10*7;}f(j){for(j=0;printf("%c%c ",x(j/16),x(15&j++)););}
We define a function f() to be called with no arguments for printing, and a helper function x(int). This breaks at FF.
Amazingly, this is one byte shorter than the more obvious:
char*s="0123456789ABCDEF";h(j){for(j=0;printf("%c%c ",s[j/16],s[15&j++]););}
Warning: it is not recommended to run this code outside of a debug environment...
Testing:
int main(int argc, char** argv) {
f();
return 0;
}
Output:
00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F 30 31 32 33 34 35 36 (...)
Of course, the more robust (and cheat-y) approach is this 34-byte function:
g(i){for(i=0;printf("%x ",i++););}
TI-Basic, 63 bytes
:For(I,0,4,16⁻¹
:Disp sub(" 0123456789ABCDEF",1+16fPart(I),2
:Output(7,1,int(I
:End
This is 63 bytes, according to the memory management screen on my calculator, a TI-84+. Make sure to start the program with a partially filled home screen!

