Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.
Code Golf

Return to Question

Clarity
Source Link
emanresu A
  • 46.2k
  • 5
  • 111
  • 257

The printable ASCII characters (hex codes 20 to 7E) in order are:

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~

(Note that space is in there.)

This string clearly contains all the printable ASCII characters at least once in increasing order when read from left to to right, but not in decreasing order.

The string reversed:

REVERSED:~}|{zyxwvutsrqponmlkjihgfedcba`_^]\[ZYXWVUTSRQPONMLKJIHGFEDCBA@?>=<;:9876543210/.-,+*)('&%$#"! NORMAL: !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~

contains all the printable ASCII characters at least once both in increasing and decreasing order. In other words, when the characters are valued with their numeric code, the longest increasing and longest decreasing subsequences have length 95 (the number of printable ASCII characters).

Challenge

Choose a contiguous subset of N printable ASCII characters, such as LMNOP (N = 5). Write a program using only those N characters whose output contains all 95 ASCII characters in increasing and decreasing order like the example above.

The winner is the submission with the lowest N. In case of ties the shortest code in bytes wins.

Notes

  • A contiguous subset means a set of the printable ASCIIs that all appear in an unbroken line, such as LMNOP or 89:;<=>.
  • Your contiguous subset may "loop around" from ~ to space, but this incurs a +3 penalty on N. So {|}~ has N = 4, but {|}~ ! has N = 6 + 3 = 9.
  • Your program may only contain the N printable ASCII characters from the contiguous subset you've selected. They do not all have to appear and may appear multiple times in any order. (All non-printable ASCII and all non-ASCII is not allowed. This means tabs and newlines are not allowed.)
  • Your output may only contain printable ASCII characters and must be less than 10000 characters long.
  • Your output's longest increasing and decreasing subsequences must both have length 95 (as explained above).
  • Output to stdout. There is no input.
  • N is a positive integer less than 96.

The printable ASCII characters (hex codes 20 to 7E) in order are:

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~

(Note that space is in there.)

This string clearly contains all the printable ASCII characters at least once in increasing order when read from left to to right, but not in decreasing order.

The string

REVERSED:~}|{zyxwvutsrqponmlkjihgfedcba`_^]\[ZYXWVUTSRQPONMLKJIHGFEDCBA@?>=<;:9876543210/.-,+*)('&%$#"! NORMAL: !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~

contains all the printable ASCII characters at least once both in increasing and decreasing order. In other words, when the characters are valued with their numeric code, the longest increasing and longest decreasing subsequences have length 95 (the number of printable ASCII characters).

Challenge

Choose a contiguous subset of N printable ASCII characters, such as LMNOP (N = 5). Write a program using only those N characters whose output contains all 95 ASCII characters in increasing and decreasing order like the example above.

The winner is the submission with the lowest N. In case of ties the shortest code in bytes wins.

Notes

  • A contiguous subset means a set of the printable ASCIIs that all appear in an unbroken line, such as LMNOP or 89:;<=>.
  • Your contiguous subset may "loop around" from ~ to space, but this incurs a +3 penalty on N. So {|}~ has N = 4, but {|}~ ! has N = 6 + 3 = 9.
  • Your program may only contain the N printable ASCII characters from the contiguous subset you've selected. They do not all have to appear and may appear multiple times in any order. (All non-printable ASCII and all non-ASCII is not allowed. This means tabs and newlines are not allowed.)
  • Your output may only contain printable ASCII characters and must be less than 10000 characters long.
  • Your output's longest increasing and decreasing subsequences must both have length 95 (as explained above).
  • Output to stdout. There is no input.
  • N is a positive integer less than 96.

The printable ASCII characters (hex codes 20 to 7E) in order are:

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~

(Note that space is in there.)

This string clearly contains all the printable ASCII characters at least once in increasing order when read from left to to right, but not in decreasing order.

The string reversed:

~}|{zyxwvutsrqponmlkjihgfedcba`_^]\[ZYXWVUTSRQPONMLKJIHGFEDCBA@?>=<;:9876543210/.-,+*)('&%$#"! NORMAL: !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~

contains all the printable ASCII characters at least once both in increasing and decreasing order. In other words, when the characters are valued with their numeric code, the longest increasing and longest decreasing subsequences have length 95 (the number of printable ASCII characters).

Challenge

Choose a contiguous subset of N printable ASCII characters, such as LMNOP (N = 5). Write a program using only those N characters whose output contains all 95 ASCII characters in increasing and decreasing order like the example above.

The winner is the submission with the lowest N. In case of ties the shortest code in bytes wins.

Notes

  • A contiguous subset means a set of the printable ASCIIs that all appear in an unbroken line, such as LMNOP or 89:;<=>.
  • Your contiguous subset may "loop around" from ~ to space, but this incurs a +3 penalty on N. So {|}~ has N = 4, but {|}~ ! has N = 6 + 3 = 9.
  • Your program may only contain the N printable ASCII characters from the contiguous subset you've selected. They do not all have to appear and may appear multiple times in any order. (All non-printable ASCII and all non-ASCII is not allowed. This means tabs and newlines are not allowed.)
  • Your output may only contain printable ASCII characters and must be less than 10000 characters long.
  • Your output's longest increasing and decreasing subsequences must both have length 95 (as explained above).
  • Output to stdout. There is no input.
  • N is a positive integer less than 96.
Commonmark migration
Source Link

The printable ASCII characters (hex codes 20 to 7E) in order are:

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~

(Note that space is in there.)

This string clearly contains all the printable ASCII characters at least once in increasing order when read from left to to right, but not in decreasing order.

The string

REVERSED:~}|{zyxwvutsrqponmlkjihgfedcba`_^]\[ZYXWVUTSRQPONMLKJIHGFEDCBA@?>=<;:9876543210/.-,+*)('&%$#"! NORMAL: !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~

contains all the printable ASCII characters at least once both in increasing and decreasing order. In other words, when the characters are valued with their numeric code, the longest increasing and longest decreasing subsequences have length 95 (the number of printable ASCII characters).

Challenge

#Challenge ChooseChoose a contiguous subset of N printable ASCII characters, such as LMNOP (N = 5). Write a program using only those N characters whose output contains all 95 ASCII characters in increasing and decreasing order like the example above.

The winner is the submission with the lowest N. In case of ties the shortest code in bytes wins.

#Notes

Notes

  • A contiguous subset means a set of the printable ASCIIs that all appear in an unbroken line, such as LMNOP or 89:;<=>.
  • Your contiguous subset may "loop around" from ~ to space, but this incurs a +3 penalty on N. So {|}~ has N = 4, but {|}~ ! has N = 6 + 3 = 9.
  • Your program may only contain the N printable ASCII characters from the contiguous subset you've selected. They do not all have to appear and may appear multiple times in any order. (All non-printable ASCII and all non-ASCII is not allowed. This means tabs and newlines are not allowed.)
  • Your output may only contain printable ASCII characters and must be less than 10000 characters long.
  • Your output's longest increasing and decreasing subsequences must both have length 95 (as explained above).
  • Output to stdout. There is no input.
  • N is a positive integer less than 96.

The printable ASCII characters (hex codes 20 to 7E) in order are:

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~

(Note that space is in there.)

This string clearly contains all the printable ASCII characters at least once in increasing order when read from left to to right, but not in decreasing order.

The string

REVERSED:~}|{zyxwvutsrqponmlkjihgfedcba`_^]\[ZYXWVUTSRQPONMLKJIHGFEDCBA@?>=<;:9876543210/.-,+*)('&%$#"! NORMAL: !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~

contains all the printable ASCII characters at least once both in increasing and decreasing order. In other words, when the characters are valued with their numeric code, the longest increasing and longest decreasing subsequences have length 95 (the number of printable ASCII characters).

#Challenge Choose a contiguous subset of N printable ASCII characters, such as LMNOP (N = 5). Write a program using only those N characters whose output contains all 95 ASCII characters in increasing and decreasing order like the example above.

The winner is the submission with the lowest N. In case of ties the shortest code in bytes wins.

#Notes

  • A contiguous subset means a set of the printable ASCIIs that all appear in an unbroken line, such as LMNOP or 89:;<=>.
  • Your contiguous subset may "loop around" from ~ to space, but this incurs a +3 penalty on N. So {|}~ has N = 4, but {|}~ ! has N = 6 + 3 = 9.
  • Your program may only contain the N printable ASCII characters from the contiguous subset you've selected. They do not all have to appear and may appear multiple times in any order. (All non-printable ASCII and all non-ASCII is not allowed. This means tabs and newlines are not allowed.)
  • Your output may only contain printable ASCII characters and must be less than 10000 characters long.
  • Your output's longest increasing and decreasing subsequences must both have length 95 (as explained above).
  • Output to stdout. There is no input.
  • N is a positive integer less than 96.

The printable ASCII characters (hex codes 20 to 7E) in order are:

 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~

(Note that space is in there.)

This string clearly contains all the printable ASCII characters at least once in increasing order when read from left to to right, but not in decreasing order.

The string

REVERSED:~}|{zyxwvutsrqponmlkjihgfedcba`_^]\[ZYXWVUTSRQPONMLKJIHGFEDCBA@?>=<;:9876543210/.-,+*)('&%$#"! NORMAL: !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~

contains all the printable ASCII characters at least once both in increasing and decreasing order. In other words, when the characters are valued with their numeric code, the longest increasing and longest decreasing subsequences have length 95 (the number of printable ASCII characters).

Challenge

Choose a contiguous subset of N printable ASCII characters, such as LMNOP (N = 5). Write a program using only those N characters whose output contains all 95 ASCII characters in increasing and decreasing order like the example above.

The winner is the submission with the lowest N. In case of ties the shortest code in bytes wins.

Notes

  • A contiguous subset means a set of the printable ASCIIs that all appear in an unbroken line, such as LMNOP or 89:;<=>.
  • Your contiguous subset may "loop around" from ~ to space, but this incurs a +3 penalty on N. So {|}~ has N = 4, but {|}~ ! has N = 6 + 3 = 9.
  • Your program may only contain the N printable ASCII characters from the contiguous subset you've selected. They do not all have to appear and may appear multiple times in any order. (All non-printable ASCII and all non-ASCII is not allowed. This means tabs and newlines are not allowed.)
  • Your output may only contain printable ASCII characters and must be less than 10000 characters long.
  • Your output's longest increasing and decreasing subsequences must both have length 95 (as explained above).
  • Output to stdout. There is no input.
  • N is a positive integer less than 96.
I know I keep removing the printable-ascii tag from things, but if there was one challenge it was designed for...
Link
user62131
user62131
added 46 characters in body
Source Link
Calvin's Hobbies
  • 90.7k
  • 46
  • 348
  • 565
Loading
added 4 characters in body
Source Link
Calvin's Hobbies
  • 90.7k
  • 46
  • 348
  • 565
Loading
added 94 characters in body
Source Link
Calvin's Hobbies
  • 90.7k
  • 46
  • 348
  • 565
Loading
Tweeted twitter.com/#!/StackCodeGolf/status/496915067150282752
Fixed tiny math error
Source Link
Calvin's Hobbies
  • 90.7k
  • 46
  • 348
  • 565
Loading
Source Link
Calvin's Hobbies
  • 90.7k
  • 46
  • 348
  • 565
Loading

AltStyle によって変換されたページ (->オリジナル) /