String Halving
Submit
Language is selected by the extension of the file. See the list of supported languages to know the extension of your language.
Problem
For the given input string, split the string into two halves. If the string does not split evenly, the left side will always be larger. For each of those two halves, the process is repeated. If a half only contains one character, it does not need to be halved further. This is continued until the string is split into several single character parts. The result is printed with each half recursively enclosed in {} brackets.
eg.
This is a sample string.
{{{{{{T}{h}}{i}}{{{s}{ }}{i}}}{{{{s}{ }}{a}}{{{ }{s}}{a}}}}{{{{{m}{p}}{l}}{{{e}{ }}{s}}}{{{{t}{r}}{i}}{{{n}{g}}{.}}}}}
step by step:
This is a sample string.
{This is a sample string.}
{{This is a sa}{mple string.}}
{{{This i}{s a sa}}{{mple s}{tring.}}}
{{{{Thi}{s i}}{{s a}{ sa}}}{{{mpl}{e s}}{{tri}{ng.}}}}
{{{{{Th}{i}}{{s }{i}}}{{{s }{a}}{{ s}{a}}}}{{{{mp}{l}}{{e }{s}}}{{{tr}{i}}{{ng}{.}}}}}
{{{{{{T}{h}}{i}}{{{s}{ }}{i}}}{{{{s}{ }}{a}}{{{ }{s}}{a}}}}{{{{{m}{p}}{l}}{{{e}{ }}{s}}}{{{{t}{r}}{i}}{{{n}{g}}{.}}}}}
--david_werecat
Options
exec is denied
now post-mortem time, all source codes will be revealed
Sample input:_
ASCII stands for American Standard Code for Information Interchange. Computers can only understand numbers, so an ASCII code is the numerical representation of a character such as 'a' or '@' or an action of some sort. ASCII was developed a long time ago and now the non-printing characters are rarely used for their original purpose. Below is the ASCII character table and this includes descriptions of the first 32 non-printing characters. ASCII was actually designed for use with teletypes and so the descriptions are somewhat obscure. If someone says they want your CV however in ASCII format, all this means is they want 'plain' text with no formatting such as tabs, bold or underscoring - the raw format that any computer can understand. This is usually so they can easily import the file into their own applications without issues. Notepad.exe creates ASCII text, or in MS Word you can save a file as 'text only'
Sample output:
{{{{{{{{{{{A}{S}}{{C}{I}}}{{{I}{ }}{{s}{t}}}}{{{{a}{n}}{{d}{s}}}{{{ }{f}}{o}}}}{{{{{r}{ }}{{A}{m}}}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}}{t}}}{{{{e}{p}}{{a}{d}}}{{{.}{e}}{x}}}}{{{{{e}{ }}{{c}{r}}}{{{e}{a}}{t}}}{{{{e}{s}}{{ }{A}}}{{{S}{C}}{I}}}}}}{{{{{{{I}{ }}{{t}{e}}}{{{x}{t}}{{,}{ }}}}{{{{o}{r}}{{ }{i}}}{{{n}{ }}{M}}}}{{{{{S}{ }}{{W}{o}}}{{{r}{d}}{ }}}{{{{y}{o}}{{u}{ }}}{{{c}{a}}{n}}}}}{{{{{{ }{s}}{{a}{v}}}{{{e}{ }}{a}}}{{{{ }{f}}{{i}{l}}}{{{e}{ }}{a}}}}{{{{{s}{ }}{{'}{t}}}{{{e}{x}}{t}}}{{{{ }{o}}{{n}{l}}}{{{y}{'}}{ }}}}}}}}}}
Ranking
Rank | User | Size | Time | Date | Statistics |
---|
1 | leonid | 68 | 0.0263 | 2012/08/16 04:41:17 | 0B / 27B / 40B |
2 | david_werecat | 72 | 0.0233 | 2012/08/16 02:01:52 | 0B / 36B / 33B |
3 | clock | 72 | 0.0203 | 2012/09/11 12:05:50 | 0B / 32B / 38B |
4 | clock(leonid) | 67 | 0.0245 | 2012/09/12 02:12:40 | 0B / 28B / 38B |
Rank | User | Size | Time | Date | Statistics |
---|
1 | tails | 62 | 0.0296 | 2012/09/05 22:09:07 | 0B / 16B / 44B |
2 | ais523 | 76 | 0.2995 | 2012/08/15 16:19:45 | 3B / ?B / ?B |
3 | tanon | 88 | 0.8280 | 2012/09/11 16:04:49 | 0B / ?B / ?B |
4 | tails (ush) | 60 | 0.0137 | 2012/09/12 21:45:54 | 0B / 19B / 39B |
5 | BioFALSE | 142 | 1.0285 | 2014/01/02 09:04:48 | 0B / 38B / 98B |
6 | BioFALSE (cheat) | 4600 | 0.0105 | 2012/12/25 05:10:46 | 0B / 745B / 3700B |
Rank | User | Size | Time | Date | Statistics |
---|
1 | leonid | 84 | 0.0310 | 2012/09/11 06:48:12 | 0B / 43B / 36B |
2 | twobit | 85 | 0.0211 | 2012/08/23 08:42:11 | 0B / 43B / 38B |
3 | recursive | 85 | 0.0197 | 2012/09/11 01:10:19 | 0B / 42B / 38B |
4 | hallvabo | 88 | 0.0270 | 2012/08/23 08:25:06 | 0B / 40B / 43B |
5 | david_werecat | 92 | 0.0194 | 2012/08/15 23:03:49 | 0B / 48B / 39B |
6 | cornchz | 92 | 0.0433 | 2012/09/02 17:54:36 | 0B / 48B / 38B |
Rank | User | Size | Time | Date | Statistics |
---|
1 | youz | 83 | 0.1117 | 2012/09/11 17:24:53 | 0B / 33B / 43B |
Rank | User | Size | Time | Date | Statistics |
---|
1 | youz | 77 | 1.2729 | 2012/09/11 17:25:01 | 0B / 22B / 46B |
Rank | User | Size | Time | Date | Statistics |
---|
1 | pooq | 115 | 0.1296 | 2012/09/06 22:13:55 | 0B / 68B / 40B |
Rank | User | Size | Time | Date | Statistics |
---|
1 | youz | 83 | 0.0138 | 2012/09/11 14:53:44 | 0B / 42B / 38B |
2 | nn(cheat) | 84 | 0.0142 | 2012/09/11 17:35:36 | 0B / 43B / 40B |
3 | nn | 89 | 0.0149 | 2012/09/11 17:23:52 | 0B / 47B / 41B |
4 | clock | 105 | 0.0210 | 2012/09/11 12:35:27 | 0B / 62B / 41B |
5 | 0mg | 106 | 0.0140 | 2012/09/03 15:58:47 | 0B / 52B / 53B |
6 | youz(nu) | 79 | 0.0196 | 2012/09/12 12:03:18 | 0B / 40B / 36B |
Rank | User | Size | Time | Date | Statistics |
---|
1 | pooq | 116 | 0.0175 | 2012/09/06 22:45:15 | 0B / 57B / 51B |
Rank | User | Size | Time | Date | Statistics |
---|
1 | ush(cheat) | 93 | 0.0146 | 2012/08/21 13:48:05 | 0B / 39B / 54B |
2 | ush | 99 | 0.0158 | 2012/08/21 13:17:40 | 0B / 44B / 55B |
3 | inaniwa | 109 | 0.0108 | 2012/08/15 16:20:40 | 0B / 53B / 51B |
4 | nn | 112 | 0.0110 | 2012/09/11 21:17:28 | 0B / 48B / 63B |
5 | david_werecat | 115 | 0.0134 | 2012/08/15 03:33:06 | 0B / 62B / 52B |
6 | tails (ush) | 83 | 0.0112 | 2012/09/12 21:16:15 | 0B / 37B / 46B |
7 | nu(nn,youz) | 85 | 0.0114 | 2012/09/12 11:40:46 | 0B / 37B / 48B |
8 | nn(youz) | 88 | 0.0108 | 2012/09/12 09:27:33 | 0B / 39B / 49B |
Rank | User | Size | Time | Date | Statistics |
---|
1 | uru | 195 | 0.0287 | 2012/08/18 17:09:04 | 0B / 110B / 72B |
Rank | User | Size | Time | Date | Statistics |
---|
1 | Hendrik | 187 | 0.0429 | 2012/09/08 16:03:26 | 0B / 116B / 63B |
2 | George2k | 239 | 0.0430 | 2012/08/22 07:20:27 | 0B / ?B / ?B |
Rank | User | Size | Time | Date | Statistics |
---|
1 | pooq | 140 | 0.4422 | 2012/09/07 05:12:16 | 0B / 76B / 62B |
Rank | User | Size | Time | Date | Statistics |
---|
1 | nn | 88 | 0.0117 | 2012/09/11 21:50:20 | 0B / 41B / 46B |
2 | nn(youz) | 78 | 0.0113 | 2012/11/16 18:14:30 | 0B / 35B / 42B |
Rank | User | Size | Time | Date | Statistics |
---|
1 | tails | 70 | 0.8444 | 2012/09/08 20:57:42 | 0B / 9B / 55B |
2 | nn | 83 | 1.1235 | 2012/08/27 00:46:44 | 0B / 11B / 64B |
Rank | User | Size | Time | Date | Statistics |
---|
1 | tails | 23 | 0.2830 | 2012/08/16 00:36:32 | 0B / 4B / 19B |
Rank | User | Size | Time | Date | Statistics |
---|
1 | tails | 19 | 0.1483 | 2021/04/15 18:10:52 | 7B / 3B / 7B |
Rank | User | Size | Time | Date | Statistics |
---|
1 | nn | 52 | 0.4387 | 2012/08/26 12:14:45 | 4B / 19B / 23B |
Rank | User | Size | Time | Date | Statistics |
---|
1 | nn | 83 | 1.3133 | 2012/09/11 20:08:46 | 0B / 42B / 38B |
2 | nn(youz) | 74 | 1.1261 | 2012/09/13 00:04:17 | 0B / 37B / 33B |
Language Ranking_
Rank | Lang | User | Size | Score |
1 | Jelly | Erik the Outgolfer | 14 | 10000 |
2 | gs2 | tails | 19 | 7368 |
3 | GolfScript | tails | 23 | 6086 |
4 | Vim | nn | 52 | 2692 |
5 | J | I., S. | 55 | 2545 |
6 | goruby | leonid | 58 | 2413 |
7 | Perl | tails (ush) | 60 | 2333 |
8 | Ruby | clock(leonid) | 67 | 2089 |
9 | sed | tails | 70 | 2000 |
10 | Groovy | nn(youz) | 74 | 1891 |
11 | Arc | youz | 77 | 1818 |
12 | AWK | nn(youz) | 78 | 1794 |
13 | JavaScript | youz(nu) | 79 | 1772 |
14 | Scheme | youz | 83 | 1686 |
15 | C | tails (ush) | 83 | 1686 |
16 | Python | leonid | 84 | 1666 |
17 | Haskell | henkma | 86 | 1627 |
18 | Lua | twobit | 107 | 1308 |
19 | Io | pooq | 115 | 1217 |
20 | BASIC | pooq | 116 | 1206 |
21 | Maxima | pooq | 140 | 1000 |
22 | C# | Hendrik | 187 | 748 |
23 | Pascal | uru | 195 | 717 |
return to the top page