Skip to main content
edited tags
Link
Wheat Wizard
  • 100k
  • 22
  • 282
  • 661
Commonmark migration
Source Link

It is well known, in the field of Mathematics studying infinity, that the Cartesian product of any finite amount of countable sets is also countable.

Your task is to write two programs to implement this, one to map from list to integer, one to map from integer to list.

Your function must be bijective and deterministic, meaning that 1 will always map to a certain list, and 2 will always map to another certain list, etc...

Earlier, we mapped integers to a list consisting only of 0 and 1.

However, now the list will consist of non-negative numbers.

#Specs

Specs

  • Program/function, reasonable input/output format.
  • Whether the mapped integers start from 1 or starts from 0 is your choice, meaning that 0 doesn't have to (but may) map to anything.
  • The empty array [] must be encoded.
  • Input/output may be in any base.
  • Sharing code between the two functions is allowed.

#Scoring

Scoring

This is . Lowest score wins.

Score is the sum of lengths (in bytes) of the two programs/functions.

It is well known, in the field of Mathematics studying infinity, that the Cartesian product of any finite amount of countable sets is also countable.

Your task is to write two programs to implement this, one to map from list to integer, one to map from integer to list.

Your function must be bijective and deterministic, meaning that 1 will always map to a certain list, and 2 will always map to another certain list, etc...

Earlier, we mapped integers to a list consisting only of 0 and 1.

However, now the list will consist of non-negative numbers.

#Specs

  • Program/function, reasonable input/output format.
  • Whether the mapped integers start from 1 or starts from 0 is your choice, meaning that 0 doesn't have to (but may) map to anything.
  • The empty array [] must be encoded.
  • Input/output may be in any base.
  • Sharing code between the two functions is allowed.

#Scoring

This is . Lowest score wins.

Score is the sum of lengths (in bytes) of the two programs/functions.

It is well known, in the field of Mathematics studying infinity, that the Cartesian product of any finite amount of countable sets is also countable.

Your task is to write two programs to implement this, one to map from list to integer, one to map from integer to list.

Your function must be bijective and deterministic, meaning that 1 will always map to a certain list, and 2 will always map to another certain list, etc...

Earlier, we mapped integers to a list consisting only of 0 and 1.

However, now the list will consist of non-negative numbers.

Specs

  • Program/function, reasonable input/output format.
  • Whether the mapped integers start from 1 or starts from 0 is your choice, meaning that 0 doesn't have to (but may) map to anything.
  • The empty array [] must be encoded.
  • Input/output may be in any base.
  • Sharing code between the two functions is allowed.

Scoring

This is . Lowest score wins.

Score is the sum of lengths (in bytes) of the two programs/functions.

replaced http://codegolf.stackexchange.com/ with https://codegolf.stackexchange.com/
Source Link

It is well known, in the field of Mathematics studying infinity, that the Cartesian product of any finite amount of countable sets is also countable.

Your task is to write two programs to implement this, one to map from list to integer, one to map from integer to list.

Your function must be bijective and deterministic, meaning that 1 will always map to a certain list, and 2 will always map to another certain list, etc...

EarlierEarlier, we mapped integers to a list consisting only of 0 and 1.

However, now the list will consist of non-negative numbers.

#Specs

  • Program/function, reasonable input/output format.
  • Whether the mapped integers start from 1 or starts from 0 is your choice, meaning that 0 doesn't have to (but may) map to anything.
  • The empty array [] must be encoded.
  • Input/output may be in any base.
  • Sharing code between the two functions is allowed.

#Scoring

This is . Lowest score wins.

Score is the sum of lengths (in bytes) of the two programs/functions.

It is well known, in the field of Mathematics studying infinity, that the Cartesian product of any finite amount of countable sets is also countable.

Your task is to write two programs to implement this, one to map from list to integer, one to map from integer to list.

Your function must be bijective and deterministic, meaning that 1 will always map to a certain list, and 2 will always map to another certain list, etc...

Earlier, we mapped integers to a list consisting only of 0 and 1.

However, now the list will consist of non-negative numbers.

#Specs

  • Program/function, reasonable input/output format.
  • Whether the mapped integers start from 1 or starts from 0 is your choice, meaning that 0 doesn't have to (but may) map to anything.
  • The empty array [] must be encoded.
  • Input/output may be in any base.
  • Sharing code between the two functions is allowed.

#Scoring

This is . Lowest score wins.

Score is the sum of lengths (in bytes) of the two programs/functions.

It is well known, in the field of Mathematics studying infinity, that the Cartesian product of any finite amount of countable sets is also countable.

Your task is to write two programs to implement this, one to map from list to integer, one to map from integer to list.

Your function must be bijective and deterministic, meaning that 1 will always map to a certain list, and 2 will always map to another certain list, etc...

Earlier, we mapped integers to a list consisting only of 0 and 1.

However, now the list will consist of non-negative numbers.

#Specs

  • Program/function, reasonable input/output format.
  • Whether the mapped integers start from 1 or starts from 0 is your choice, meaning that 0 doesn't have to (but may) map to anything.
  • The empty array [] must be encoded.
  • Input/output may be in any base.
  • Sharing code between the two functions is allowed.

#Scoring

This is . Lowest score wins.

Score is the sum of lengths (in bytes) of the two programs/functions.

edited body
Source Link
Leaky Nun
  • 50.1k
  • 6
  • 110
  • 284
Loading
Tweeted twitter.com/StackCodeGolf/status/726671771492032512
added 54 characters in body
Source Link
Leaky Nun
  • 50.1k
  • 6
  • 110
  • 284
Loading
added 76 characters in body
Source Link
Leaky Nun
  • 50.1k
  • 6
  • 110
  • 284
Loading
added 7 characters in body
Source Link
Leaky Nun
  • 50.1k
  • 6
  • 110
  • 284
Loading
Source Link
Leaky Nun
  • 50.1k
  • 6
  • 110
  • 284
Loading