Skip to main content
Commonmark migration
Source Link

#C (with GCC extensions), 76 bytes * 0.8 = 60.8

C (with GCC extensions), 76 bytes * 0.8 = 60.8

__uint128_t i;main(){char s[50];for(;inet_ntop(10,&i,s,49),puts(s),++i>0;);}

This uses the 128-bit integers GCC extension to simply count up from :: to ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff. inet_ntop() correctly formats each address so the -20% bonus can be claimed.

###Output

Output

Using sed to output every millionth line up to 10 million:

$ ./ipv6all | sed -n '1~1000000p;10000000q'
::
4042:f00::
8084:1e00::
c0c6:2d00::
9:3d00::
404b:4c00::
808d:5b00::
c0cf:6a00::
12:7a00::
4054:8900::
$ 

Note I am using a little-endian x86_64 machine, and that network addresses are typically always in network-order (big-endian), so the endianness is effectively swapped by using inet_ntop(). This does not matter - all addresses will still (eventually) be displayed.

#C (with GCC extensions), 76 bytes * 0.8 = 60.8

__uint128_t i;main(){char s[50];for(;inet_ntop(10,&i,s,49),puts(s),++i>0;);}

This uses the 128-bit integers GCC extension to simply count up from :: to ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff. inet_ntop() correctly formats each address so the -20% bonus can be claimed.

###Output

Using sed to output every millionth line up to 10 million:

$ ./ipv6all | sed -n '1~1000000p;10000000q'
::
4042:f00::
8084:1e00::
c0c6:2d00::
9:3d00::
404b:4c00::
808d:5b00::
c0cf:6a00::
12:7a00::
4054:8900::
$ 

Note I am using a little-endian x86_64 machine, and that network addresses are typically always in network-order (big-endian), so the endianness is effectively swapped by using inet_ntop(). This does not matter - all addresses will still (eventually) be displayed.

C (with GCC extensions), 76 bytes * 0.8 = 60.8

__uint128_t i;main(){char s[50];for(;inet_ntop(10,&i,s,49),puts(s),++i>0;);}

This uses the 128-bit integers GCC extension to simply count up from :: to ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff. inet_ntop() correctly formats each address so the -20% bonus can be claimed.

Output

Using sed to output every millionth line up to 10 million:

$ ./ipv6all | sed -n '1~1000000p;10000000q'
::
4042:f00::
8084:1e00::
c0c6:2d00::
9:3d00::
404b:4c00::
808d:5b00::
c0cf:6a00::
12:7a00::
4054:8900::
$ 

Note I am using a little-endian x86_64 machine, and that network addresses are typically always in network-order (big-endian), so the endianness is effectively swapped by using inet_ntop(). This does not matter - all addresses will still (eventually) be displayed.

deleted 15 characters in body
Source Link
Digital Trauma
  • 73k
  • 9
  • 112
  • 264

#C (with GCC extensions), 7876 bytes * 0.8 = 6260.48

main__uint128_t i;main(){__uint128_t i=0;charchar s[50];for(;inet_ntop(10,&i,s,49),puts(s),++i>0;);}

This uses the 128-bit integers GCC extension to simply count up from :: to ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff. inet_ntop() correctly formats each address so the -20% bonus can be claimed.

###Output

Using sed to output every millionth line (takes a minute or soup to run)10 million:

$ time ./ipv6all | sed -n '1~1000000p' | head'1~1000000p;10000000q'
::
4042:f00::
8084:1e00::
c0c6:2d00::
9:3d00::
404b:4c00::
808d:5b00::
c0cf:6a00::
12:7a00::
4054:8900::
$ 

Note I am using a little-endian x86_64 machine, and that network addresses are typically always in network-order (big-endian), so the endianness is effectively swapped by using inet_ntop(). This does not matter - all addresses will still (eventually) be displayed.

#C (with GCC extensions), 78 bytes * 0.8 = 62.4

main(){__uint128_t i=0;char s[50];for(;inet_ntop(10,&i,s,49),puts(s),++i>0;);}

This uses the 128-bit integers GCC extension to simply count up from :: to ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff. inet_ntop() correctly formats each address so the -20% bonus can be claimed.

###Output

Using sed to output every millionth line (takes a minute or so to run):

$ time ./ipv6all | sed -n '1~1000000p' | head
::
4042:f00::
8084:1e00::
c0c6:2d00::
9:3d00::
404b:4c00::
808d:5b00::
c0cf:6a00::
12:7a00::
4054:8900::
$ 

Note I am using a little-endian x86_64 machine, and that network addresses are typically always in network-order (big-endian), so the endianness is effectively swapped by using inet_ntop(). This does not matter - all addresses will still (eventually) be displayed.

#C (with GCC extensions), 76 bytes * 0.8 = 60.8

__uint128_t i;main(){char s[50];for(;inet_ntop(10,&i,s,49),puts(s),++i>0;);}

This uses the 128-bit integers GCC extension to simply count up from :: to ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff. inet_ntop() correctly formats each address so the -20% bonus can be claimed.

###Output

Using sed to output every millionth line up to 10 million:

$ ./ipv6all | sed -n '1~1000000p;10000000q'
::
4042:f00::
8084:1e00::
c0c6:2d00::
9:3d00::
404b:4c00::
808d:5b00::
c0cf:6a00::
12:7a00::
4054:8900::
$ 

Note I am using a little-endian x86_64 machine, and that network addresses are typically always in network-order (big-endian), so the endianness is effectively swapped by using inet_ntop(). This does not matter - all addresses will still (eventually) be displayed.

edited body
Source Link
Digital Trauma
  • 73k
  • 9
  • 112
  • 264

#C (with GCC extensions), 78 bytes * 0.8 = 62.4

main(){__uint128_t i=0;char s[50];for(;inet_ntop(10,&i,s,49),puts(s),++i>0;);}

This uses the 128-bit integers GCC extension to simply count up from :: to ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff. inet_ntop() correctly formats each address so the -20% bonus can be claimed.

###Output

Using sed to output every millionth line (takes a minute or so to run):

$ time ./ipv6all | sed -n '1~1000000p' | head
ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff
bfbd:f0ff:ffff:ffff:ffff4042:fffff00:ffff:ffff
7f7b:e1ff:ffff:ffff8084:ffff1e00:ffff:ffff:ffff
3f39:d2ff:ffff:ffff:ffffc0c6:ffff2d00:ffff:ffff
fff6:c2ff:ffff:ffff:ffff9:ffff3d00:ffff:ffff
bfb4:b3ff:ffff:ffff:ffff404b:ffff4c00:ffff:ffff
7f72:a4ff:ffff:ffff:ffff808d:ffff5b00:ffff:ffff
3f30:95ff:ffff:ffffc0cf:ffff6a00:ffff:ffff:ffff
ffed:85ff:ffff:ffff:ffff12:ffff7a00:ffff:ffff
bfab:76ff:ffff:ffff:ffff4054:ffff8900:ffff:ffff
$ 

Note I am using a little-endian x86_64 machine, and that network addresses are typically always in network-order (big-endian), so the endianness is effectively swapped by using inet_ntop(). This does not matter - all addresses will still (eventually) be displayed.

#C (with GCC extensions), 78 bytes * 0.8 = 62.4

main(){__uint128_t i=0;char s[50];for(;inet_ntop(10,&i,s,49),puts(s),++i>0;);}

This uses the 128-bit integers GCC extension to simply count up from :: to ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff. inet_ntop() correctly formats each address so the -20% bonus can be claimed.

###Output

Using sed to output every millionth line (takes a minute or so to run):

$ ./ipv6all | sed -n '1~1000000p' | head
ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff
bfbd:f0ff:ffff:ffff:ffff:ffff:ffff:ffff
7f7b:e1ff:ffff:ffff:ffff:ffff:ffff:ffff
3f39:d2ff:ffff:ffff:ffff:ffff:ffff:ffff
fff6:c2ff:ffff:ffff:ffff:ffff:ffff:ffff
bfb4:b3ff:ffff:ffff:ffff:ffff:ffff:ffff
7f72:a4ff:ffff:ffff:ffff:ffff:ffff:ffff
3f30:95ff:ffff:ffff:ffff:ffff:ffff:ffff
ffed:85ff:ffff:ffff:ffff:ffff:ffff:ffff
bfab:76ff:ffff:ffff:ffff:ffff:ffff:ffff
$ 

Note I am using a little-endian x86_64 machine, and that network addresses are typically always in network-order (big-endian), so the endianness is effectively swapped by using inet_ntop(). This does not matter - all addresses will still (eventually) be displayed.

#C (with GCC extensions), 78 bytes * 0.8 = 62.4

main(){__uint128_t i=0;char s[50];for(;inet_ntop(10,&i,s,49),puts(s),++i>0;);}

This uses the 128-bit integers GCC extension to simply count up from :: to ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff. inet_ntop() correctly formats each address so the -20% bonus can be claimed.

###Output

Using sed to output every millionth line (takes a minute or so to run):

$ time ./ipv6all | sed -n '1~1000000p' | head
::
4042:f00::
8084:1e00::
c0c6:2d00::
9:3d00::
404b:4c00::
808d:5b00::
c0cf:6a00::
12:7a00::
4054:8900::
$ 

Note I am using a little-endian x86_64 machine, and that network addresses are typically always in network-order (big-endian), so the endianness is effectively swapped by using inet_ntop(). This does not matter - all addresses will still (eventually) be displayed.

edited body
Source Link
Digital Trauma
  • 73k
  • 9
  • 112
  • 264
Loading
Source Link
Digital Trauma
  • 73k
  • 9
  • 112
  • 264
Loading